Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Encrypting Passwords

Post Reply
andymac
Posts: 2
Joined: 2009-09-12 16:15

Encrypting Passwords

Post by andymac »

Hi,

I'm building my own little app for remotely installing UltraVNC. I'd like to give the user the option to enter a password which I'll then encrypt and write to the ini file. Can anyone point me in the direction of documentation on how to handle the encryption?

andymac
YY
200
200
Posts: 996
Joined: 2006-11-13 15:11

Re: Encrypting Passwords

Post by YY »

You can use VNCPWD to encrypt a plain text password, and then write it into the ultravnc.ini.

Just two notes:
1. The encrypted password inside ultravnc.ini having 2 extra characters at the end (i.e. 18 characters rather than 16), I don't know why this is required. In my test, it looks like this extra character can be anything, but w/o it the UVNCserver will consider password is not setted. So after using VNCPWD to creat a password, I append two extra zero ("00") when putting it into the ultravnc.ini

2. I don't know whether VNCPWD is a freeware /GPL/.... Check it yourself.
andymac
Posts: 2
Joined: 2009-09-12 16:15

Re: Encrypting Passwords

Post by andymac »

YY wrote:You can use VNCPWD to encrypt a plain text password, and then write it into the ultravnc.ini.
Thanks, I've used VNCPWD before and it's a good little app. I'd like to include this functionality natively in my own app though so I don't have to rely on VNCPWD to do this for me but I haven't been able to find documentation on how the encrypted password is created.
YY
200
200
Posts: 996
Joined: 2006-11-13 15:11

Re: Encrypting Passwords

Post by YY »

I know almost nothing on programming. Sorry can't help.

Just know that the VNC password is encrypted with DES algorithm. The following are some pages regarding DES, see if you can find something useful.
DES Encryption -- http://www.tropsoft.com/strongenc/des.htm
The DES encryption algorithm -- http://www.iusmentis.com/technology/encryption/des/
DES Encryption -- http://www.gnu.org/s/libc/manual/html_n ... ption.html
DES Encryption Package -- http://www.efgh.com/software/des.htm
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Encrypting Passwords

Post by Rudi De Vos »

You also can check the uvnc source code...
The encryption and writing to ini file is in the code.
YY
200
200
Posts: 996
Joined: 2006-11-13 15:11

Re: Encrypting Passwords

Post by YY »

YY wrote:The encrypted password inside ultravnc.ini having 2 extra characters at the end (i.e. 18 characters rather than 16), I don't know why this is required. In my test, it looks like this extra character can be anything, but w/o it the UVNCserver will consider password is not setted.
Rudi, then what is the purpose of these two extra characters of the excrypted password?
Robert_Zenz
8
8
Posts: 22
Joined: 2009-07-28 09:58
Location: Vienna, Austria
Contact:

Re: Encrypting Passwords

Post by Robert_Zenz »

Hello guys.

You can find the encrypting method at vncviewer, vncAuth.cpp, Line 86. It does lead down to an external call to an DES encryption method: http://en.wikipedia.org/wiki/Data_Encryption_Standard

Bobby
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Encrypting Passwords

Post by Rudi De Vos »

The MS function that write to the ini file, auto add some checksum
code. WritePrivateProfileStruct()
[post=49774][/post]

When the data is retreived, we don't do a checksum verification
of the GetPrivateProfileStruct(), so you can add manual some extra chars.
YY
200
200
Posts: 996
Joined: 2006-11-13 15:11

Re: Encrypting Passwords

Post by YY »

I got it now.

Thanks so much, Rudi. :)
Post Reply