In other words, is the length of the encrypted data the same as the original data? It seems that it should be. My test code is as follows:
my $What = "Some text to be encrypted."; my $Length = length ( $What ) * 2; my $Cipher = Crypt::CBC->new ( [ key => $DBITT::CryptString ] ); my $CipherText = $Cipher->encrypt ( $What ); my $ASCII = unpack ( "H$Length", $CipherText ); print "Encrypted result of $What is $ASCII."; print " That was " . length ( $ASCII ) . " bytes long.\n"; my $PlainText = $Cipher->decrypt ( $CipherText ); print "And back into the real world we have '$PlainText'.\n"; $PlainText = $Cipher->decrypt ( pack ( "H$Length", $ASCII ) ); print "Try via ASCII string it's '$PlainText'.\n";
and when I run it I get
The two values of $PlainText don't match. Assistance would be greatly appreciated.Encrypted result of Some text to be encrypted. is 52616e646f6d49568bd87928f7ccbbbef6b6fcd504407b611fd9. That was 52 bytes long. And back into the real world we have 'Some text to be encrypted.'. Try via ASCII string it's ''.
--t. alex
"Here's the chocolates, and here's the flowers. Now how 'bout it, widder hen, will ya marry me?" --Foghorn Leghorn
In reply to Length of Crypt::CBC result by talexb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |