Decrypt AES-256-CFB in PHP with openssl instead mcrypt
问题 The function below correctly decrypt the data in php5 function decrypt_mcrypt($key, $str) { $str = base64_decode($str); $iv = substr($str, 0, 16); $str = substr($str, 16); return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $str, MCRYPT_MODE_CFB, $iv); } I tried to use openssl instead of mcrypt (in php7), but got garbage on the output. function decrypt_openssl($key, $str) { $str = base64_decode($str); $iv = substr($str, 0, 16); $str = substr($str, 16); return openssl_decrypt($str, 'AES-256-CFB',