我并不十分熟悉的东西,但它似乎是试图MCRYPT_RIJNDAEL_256
替代MCRYPT_RIJNDAEL_128
将是一个明显的下一个步骤…
您是对的,这不是您所需要的。MCRYPT_RIJNDAEL_128
实际上是正确的选择。根据您提供的链接,密钥和IV的长度是应有的两倍:
// How do you do 256-bit AES encryption in PHP vs. 128-bit AES encryption???
// The answer is: Give it a key that's 32 bytes long as opposed to 16 bytes long.
// For example:
$key256 = '12345678901234561234567890123456';
$key128 = '1234567890123456';
// Here's our 128-bit IV which is used for both 256-bit and 128-bit keys.
$iv = '1234567890123456';