This one crosses multiple disciplines (PERL, VNC, Registry editing) so maybe I'll get lucky and someone has done this before. The folks in the PERL groups are crusty old buzzards and I KNOW they'd shout me down for posting there.
I'd like to write a PERL script that will take a plaintext password, encrypt it and write it to the registry of the local machine (Which will be windows XP FWIW). The encryption bit is killing me.
use Crypt::TripleDES;
my $des = new Crypt::TripleDES;
my $key='238210763578887'; #Fixed encryption key from VNC source.
my $plaintext_pw="abcd1234";
my $encrypted_pw= $des->encrypt3($plaintext_pw, $key)
Simple eh? However, I'm not ending up with what I expect. I'd wager that most of my problem stems from the fact that I'm not used to working with binary data, and it's difficult to know what $encrypted_pw contains and what it SHOULD contain.
I can easily read the binary password from the windows registry, but it's not the same as $encrypted_password even though it SHOULD be. Then I keep thinking or SHOULD it be? Does Windows do something to the binary data that I don't know about and need to reverse? With textual data I can always do a print "Name's value is $value\n" and figure out what's what. Not so binary data.
I've run across a couple of perl modules that implement the specific encryption algorighm from VNC using the VNC source, but I'd prefer to do this with standard perl modules if it's possible. Compiling modules from source makes me feel dirty .
I'd also prefer not to do some cobbled together solution with .reg files and DOS batch commands. Someone ALWAYS wants to suggest that, but it's not flexible enough for my purposes, and you still have to deal with getting the password into the .reg file.
Anyone got some leads for me?
Thanks.
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
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
VNC password encryption using PERL.
Not the best solution but...
I've contacted the authors of various VNC related utilities and everyone is using the encryption algorithm pulled directly from the VNC source. This casts serious doubts on my ability to implement this the way I wanted, so at this point I'm going to run with plan B. I've got a perl module called VNC::DES that implements the VNC encryption/decryption algorithm. It's not a standard module, but it's going to do what I need it to.
You are correct.
Indeed you are correct. I'd done experiments on both DES as well as TripleDES, and had the tripleDES code handy.
I ended up hacking vncpasswd to take a password on STDIN and spit out the encrypted password suitable for inclusion in a .vnc file or a registry hive.
I ended up hacking vncpasswd to take a password on STDIN and spit out the encrypted password suitable for inclusion in a .vnc file or a registry hive.