For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > June 2005 > Net::SSH::Perl::Cipher Problem.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Net::SSH::Perl::Cipher Problem.
Prasad

2005-06-10, 8:55 am

I am using the following script. Its encrypting the data but when i
decrypt, i am not getting the original text again.


use Net::SSH::Perl::Cipher;
$key =3D "0123456789ABCDEF12345678";
$plaintext=3D"Shankar";
my $cipher =3D Net::SSH::Perl::Cipher->new('D=ADES3',$key);
my $ciphertext =3D $cipher->encrypt($plaintext);
print "The Plain text is : [$plaintext]\n";
print "The Cipher is : [$cipher]\n";
print "The Cipher text is : [$ciphertext] \n";
my $recoveredtext =3D $cipher->decrypt($ciphertext);
print "The recovered text is : [$recoveredtext]\n";


Output
The Plain text is : [Shankar]
The Cipher is : [Net::SSH::Perl::Cipher::DES3=3D=ADHASH(
0x708fc)]
The Cipher text is : [=E8=8E=8B=CF=AA=FEqK]
The recovered text is : [=DCdh=B4=A2=B6=B7]=20


Thanks in Advance.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com