in reply to 256 bit AEC encryption using Crypt::CBC

I tried something different. If you have OpenSSL, then try Crypt::OpenSSL::AES. Here's my resulting script:

#!/usr/local/bin/perl use strict; use warnings; use Crypt::CBC; my $key = 'little brown mouse'; my $cipher = Crypt::CBC->new( -key => $key, -keylength => '256', -cipher => "Crypt::OpenSSL::AES" ); my $encrypted = $cipher->encrypt_hex($key); my $decrypted = $cipher->decrypt_hex($encrypted); print $encrypted, "\n"; print $decrypted, "\n";

Replies are listed 'Best First'.
Re^2: 256 bit AEC encryption using Crypt::CBC
by Anonymous Monk on Dec 18, 2009 at 23:24 UTC
    Thanks, I'd tried Crypt::OpenSSL::AES, then I changed the cipher to a variable to easily plug in 'Rijndael' as an option. Adding the keylength didn't change anything. I'm beginning to think that the client hasn't given me accurate samples or that the php version isn't compatible with the perl library.

      Don't change the cipher. The cipher must be exactly "Crypt::OpenSSL::AES" in order to get the keylength of 256.