function decrypt($key, $iv, $string = "") { $key = base64_decode($key); $iv = base64_decode($iv); $string = base64_decode($string); return strippadding(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $string, MCRYPT_MODE_CBC, $iv)); }
function decrypt($data, $key = null, $iv = null) { $key = $key ? base64_decode($key) : base64_decode(DEFAULTKEY); $iv = $iv ? base64_decode($iv) : base64_decode(DEFAULTIV); return strippadding(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($data), MCRYPT_MODE_CBC, $iv)); }
function allpay_decrypt($sValue, $sSecretKey, $iv) { $sValue = str_replace(' ', '+', $sValue); $str = strippadding(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $sSecretKey, hex2bin($sValue), MCRYPT_MODE_CBC, $iv)); return $str; }