当然是你用错了!
函数mcrypt_get_block_size()需要有一个数值型的参数或者两个字符型的参数
而常量MCRYPT_RIJNDAEL_128是字符型的,你
mcrypt_get_block_size($cipher_alg);
当然要报参数错了
Warning: mcrypt_get_block_size() expects exactly 2 parameters, 1 given ...
下次请把提示信息贴完整!
函数mcrypt_get_block_size()需要有一个数值型的参数或者两个字符型的参数
而常量MCRYPT_RIJNDAEL_128是字符型的,你
mcrypt_get_block_size($cipher_alg);
当然要报参数错了
Warning: mcrypt_get_block_size() expects exactly 2 parameters, 1 given ...
下次请把提示信息贴完整!
Rijndael-128Warning: Wrong parameter count for mcrypt_get_block_size() in ..../htdocs/crypttest.php on line 10
Original string: Applied Cryptography, by Bruce Schneier, is a wonderful cryptography reference.
Encrypted string: 97c07b2854ac0ac542e904b7b4e87f8c0cf119c7f798b4fe3bb54aa421dec2b936a377dc879ff122c25426a54f06c4830ac2cf57a8ad88f81aaa3ae537a488cf60b533d5d3299bd567734ba08e927fc4
Decrypted string: Applied Cryptography, by Bruce Schneier, is a wonderful cryptography reference.