johnnytc4 has asked for the wisdom of the Perl Monks concerning the following question:

I have been trying to encrypt using perl's modules and they don't seem to be matching up with php's counterpart. They both encrypt and descrpyt back to teh original but the encrypted plaintext(after url_encode and base_64 encode) not does seem right.I can't use php's script to decrypt perl's encryption and vise versa.

PERL CODE
REMOVED
PHP CODE
REMOVED

Replies are listed 'Best First'.
Re: Perl encryption not matching PHP encryption
by moritz (Cardinal) on Apr 08, 2011 at 13:39 UTC
      It looks like Crypt::Rijndeal supports 16byte keys but there is no way to communicate that to Crypt::CBC.

        Version 2.30 of C::CBC pod shows that new() accepts keysize via -keysize-value pair. And, currently only C::Blowfish supports variable keysize via Openssl ...

        The -keysize and -blocksize arguments can be used to force the cipher's keysize and/or blocksize. This is only currently useful for the Crypt::Blowfish module, which accepts a variable length keysize. If -keysize is not specified, then Crypt::CBC will use the maximum length Blowfish key size of 56 bytes (448 bits). The Openssl library defaults to 16 byte Blowfish key sizes, so for compatibility with Openssl you may wish to set -keysize=>16. There are currently no Crypt::* modules that have variable block sizes, but an option to change the block size is provided just in case.