in reply to Determine Encryption Strength - Crypt::CBC & OpenSSL::AES

perlgoon,

I've only used 'Crypt::OpenSSL::AES' and you create a cipher by passing an exact 32 byte string which is 256bits of data. After that de/encrypt is by passing the cipher and an exact 16 byte strings or 128 bits of data.

Also I use 'pack/unpack' to add the length of the actual string to the beginning of the encrypted data. This way you don't care if the data is a multiple of 16 bytes or not.

Note: As a side note, a few years ago several math minded scientists discovered that the original AES128 was more secure than AES256. You may want to google this to verify that this is still true.

Good Luck...Ed

"Well done is better than well said." - Benjamin Franklin

  • Comment on Re: Determine Encryption Strength - Crypt::CBC & OpenSSL::AES

Replies are listed 'Best First'.
Re^2: Determine Encryption Strength - Crypt::CBC & OpenSSL::AES
by Anonymous Monk on Aug 30, 2013 at 16:12 UTC

    Thanks! Yeah I use Crypt::CBC in conjunction just so you don't have to worry about padding to get the proper blocksize. From what I can tell from the documentation, while Crypt::OpenSSL::AES will support keysizes of 16, 24, or 32 bytes... if you use it with Crypt::CBC it will always be 32 bytes. As suggested I verified this with the keysize routine:

    use Crypt::CBC; use Crypt::OpenSSL::AES; my $cipher = Crypt::CBC->new( -key => '1234567890123456', -cipher => 'Crypt::OpenSSL::AES', -header => 'none', -iv => '6543210987654321' ); print $cipher->keysize();

    Again this will ALWAYS returns 32, or 256 bits.