From d43308eb56d5c495a52932dd8e63c5437dd8063d Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Thu, 20 Dec 2012 16:44:02 +0100 Subject: [PATCH] Replaced the deprecated use of 'mcrypt_ecb' with 'mdecrypt_generic' --- ykksm-utils.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ykksm-utils.php b/ykksm-utils.php index cddd9fe..f8d2907 100644 --- a/ykksm-utils.php +++ b/ykksm-utils.php @@ -45,11 +45,13 @@ function modhex2hex($m) function aes128ecb_decrypt($key,$in) { - return bin2hex(mcrypt_ecb(MCRYPT_RIJNDAEL_128, - hex2bin($key), - hex2bin($in), - MCRYPT_DECRYPT, - hex2bin('00000000000000000000000000000000'))); + $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', 'ecb', ''); + $iv = hex2bin('00000000000000000000000000000000'); + mcrypt_generic_init($td, hex2bin($key), $iv); + $result = bin2hex(mdecrypt_generic($td, hex2bin($in))); + mcrypt_generic_deinit($td); + + return $result; } function calculate_crc($token)