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;
}
Member Avatar for diafol

Sounds like you're passing non-hex digit 's' in the $key. Hex = 0->f

WHat does $key contain?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.