use Crypt::CBC; 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*", $CipherText ); print "Encrypted result of $What is $ASCII.\n"; 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*", $ASCII ) ); print "Try via ASCII string it's '$PlainText'.\n"; __DATA__ Encrypted result of Some text to be encrypted. is 52616e646f6d49569aee93f3d204172c101f93dcae2a2a94dd1142acf98a0067bdf2f0edfcb06b3543f3cf8d05decc33. That was 96 bytes long. And back into the real world we have 'Some text to be encrypted.'. Try via ASCII string it's 'Some text to be encrypted.'.