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
In reply to Re: Encrypt using AES(block size 128-bit) in CBC
by flexvault
in thread Encrypt using AES(block size 128-bit) in CBC
by mikemc24
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |