Yeah!
There is a difference of opinion, which means "256".
AES has a fixed block size of 128 bits, so "AES 256" means 128-bit blocks, 256-bit key, 14 rounds.
However, Rijndael allows you to change the key size and block size. MCRYPT_RIJNDAEL_256
refers to Rijndael with a block size set to 256 (and I don't know how many rounds). So it really takes 32 bytes IV. Your PHP script does not use AES 256.
This is confirmed in https://bugs.php.net/bug.php?id=47125 - the reporter considers this an error in PHP mcrypt, PHP considers this an error in libmcrypt, but this is not an error, since libmcrypt makes the document which means MCRYPT_RIJNDAEL_256
(at least for the linux man page for mcrypt, my google-fu could not find any real documentation for libmcrypt). This is not the same as AES 256.
So, you encrypt and decrypt ciphers, which, although related, can also be completely different.
The bad news is that Crypto.Cipher.RIJNDAEL does not exist in Crypto.Cipher.RIJNDAEL
. If you can pass the 256-bit key to MCRYPT_RIJNDAEL_128 in a PHP script, then this will be AES 256 (thanks to Paŭlo).
source share