private static function _aesDecode($data,$privateKey, $iv=''){
$encryptedData = base64_decode($data);
//新版
$decrypted = openssl_decrypt($encryptedData, 'AES-128-CBC', $privateKey, OPENSSL_RAW_DATA|OPENSSL_ZERO_PADDING, $iv);
// $decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $privateKey, $encryptedData, MCRYPT_MODE_CBC, $iv);
$len = strlen($decrypted);
$pad = ord($decrypted[$len-1]);
return substr($decrypted, 0, strlen($decrypted) - $pad);
// return rtrim($decrypted);
}
https://www.uoften.com/article/70389.html