http://www.mail-archive.com/vnc-list.../msg11719.html
I found the following code through the link above:
#!/bin/perl
use Crypt::CBC;
my $key = pack("C8", 23, 82, 107, 6, 35, 78, 88, 7);
$cipher = Crypt::CBC->new({
'key'=>$key, 'cipher'=>'DES', 'prepend_iv'=>0, 'regenerate_key'=>0
});
$ciphertext = $cipher->encrypt("This data is hush hush");
$plaintext = $cipher->decrypt($ciphertext);
print "Encrypted: $ciphertext\n";
print "Decrypted: $plaintext\n";
#########################################################
This pretty much does what I want, which is ultimately be able to generate a vncpasswd myself. My research on vncpasswd so far is that, it is based on DES, and the obfuscation key value is fixed. Theoretically, this being the case, I should be able to backward engineer a perl script from the C++ source code of vncpasswd.
But the passwd file generated by vncpasswd appear to be unreadable text. Rather different from those generated through the code above, I believe I am missing a step here.
And great brains can help on this?
Aaron