Hi there,
I'm in the unenviable position where I have to maintain functionality with an existing ColdFusion application. As part of it's login process the Coldfusion app stores a cookie with an encrypted string.
encrypt(strToEncrypt, theKey, "AES", "Base64")
I can successfully decrypt this string in PHP using MCrypt and the following code
mcrypt_decrypt(
MCRYPT_RIJNDAEL_128,
base64_decode($theKey),
base64_decode($encrypted_string),
MCRYPT_MODE_ECB, "0000000000000000")
I now have the need to perform the same encryption within PHP so that the ColdFusion app can access the data in the cookie.
At the moment what I have is
mcrypt_encrypt( MCRYPT_RIJNDAEL_128, base64_decode($theKey), $strToEncrypt, MCRYPT_MODE_ECB, "0000000000000000");
This, however, is incompatible with the equivalent ColdFusion encryption algorithm
decrypt(strToDecrypt, theKey, "AES", "Base64")
Throwing a Given final block not properly padded
error.
Any help much appreciated.
James