http://php.net/manual/zh/function.mcrypt-encrypt.php
Warning
This function has been DEPRECATED as of PHP 7.1.0. Relying on this function is highly discouraged.
那么请问在 php7.1 里 mcrypt_encrypt()该用什么函数代替?
1
explon 2017-02-04 14:01:55 +08:00 1
mcrypt_generic
|
2
explon 2017-02-04 14:03:21 +08:00
|
3
shiji 2017-02-04 14:03:49 +08:00 via Android 1
openssl_encrypt
|
4
shiny 2017-02-04 14:21:16 +08:00
我们线上用 bf-cbc ,转换后
mcrypt_decrypt(MCRYPT_BLOWFISH, $passphrase, base64_decode($data), MCRYPT_MODE_CBC, $iv); openssl_decrypt($data, "BF-CBC", $passphrase, 0, $iv); base64_encode(mcrypt_encrypt(MCRYPT_BLOWFISH, $passphrase, $data, MCRYPT_MODE_CBC, $iv)); openssl_encrypt($data, "BF-CBC", $passphrase, null, $iv); 已经在线上跑了几个星期了,没有问题。 |
5
aliuwrtest 2017-02-04 14:41:26 +08:00
|
6
explon 2017-02-04 15:07:23 +08:00
@aliuwrtest 恩,果然
|