in reply to Encrypt using AES(block size 128-bit) in CBC
Welcome mikemc24,
I downloaded your code and verified your results. I made some small changes:
I got the 'Good!' result, so I think your Perl script is working.my $encrypted = $cipher->encrypt_hex($user_string); my $decrypted = $cipher->decrypt_hex($encrypted); print $encrypted, "\n\n"; print $decrypted, "\n\n"; if ( $user_string eq $decrypted ) { print "Good!\n"; }
The way it looks to me, you need to verify that the exact '-key' and '-iv' are correct. If they are correct, then your source string for comparison should be verified as being correct.
Good Luck...Ed
"Well done is better than well said." - Benjamin Franklin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Encrypt using AES(block size 128-bit) in CBC
by mikemc24 (Novice) on Jun 14, 2015 at 17:39 UTC | |
by flexvault (Monsignor) on Jun 14, 2015 at 21:04 UTC | |
by wrog (Friar) on Jun 14, 2015 at 22:53 UTC |