0

I am getting :

Warning: pack() [function.pack]: Type H: illegal hex digit s in D:\xampp\htdocs\project\includes\encryption.php on line 139

Warning: pack() [function.pack]: Type H: illegal hex digit s in D:\xampp\htdocs\project\includes\encryption.php on line 139

Warning: pack() [function.pack]: Type H: illegal hex digit s in D:\xampp\htdocs\project\includes\encryption.php on line 139

Warning: pack() [function.pack]: Type H: illegal hex digit s in D:\xampp\htdocs\project\includes\encryption.php on line 139

Warning: pack() [function.pack]: Type H: illegal hex digit s in D:\xampp\htdocs\project\includes\encryption.php on line 139

Warning: pack() [function.pack]: Type H: illegal hex digit s in D:\xampp\htdocs\project\includes\encryption.php on line 139

Warning: pack() [function.pack]: Type H: illegal hex digit s in D:\xampp\htdocs\project\includes\encryption.php on line 139

Warning: pack() [function.pack]: Type H: illegal hex digit s in D:\xampp\htdocs\project\includes\encryption.php on line 139

Warning: pack() [function.pack]: Type H: illegal hex digit s in D:\xampp\htdocs\project\includes\encryption.php on line 139

Warning: pack() [function.pack]: Type H: illegal hex digit s in D:\xampp\htdocs\project\includes\encryption.php on line 139
Ukjl(*&#@!

and line 139 have in following function:

function de_crypt($decrypt, $key){
    $decrypt = explode('|', $decrypt.'|');
    $decoded = base64_decode($decrypt[0]);
    $iv = base64_decode($decrypt[1]);
    if(strlen($iv)!==mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC)){ return false; }
    $key = pack('H*', $key); /* **Line 139** */
    $decrypted = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $decoded, MCRYPT_MODE_CBC, $iv));
    $mac = substr($decrypted, -64);
    $decrypted = substr($decrypted, 0, -64);
    $calcmac = hash_hmac('sha256', $decrypted, substr(bin2hex($key), -32));
    if($calcmac!==$mac){ return false; }
    $decrypted = unserialize($decrypted);
    return $decrypted;
}

Edited by pritaeas: Moved to PHP.

2
Contributors
1
Reply
9
Views
2 Years
Discussion Span
Last Post by diafol
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.