need help unpacking hmac-md5 hash into md5 hash
Hey Im wondering if theres any code out there to unpack a hmac-md5 hash (with the key) back to the original md5.. I would assume this fairly easy to do and there should be code out there.. I cant find it however.. much appericated. thanks, (and I dont code myself or I would make it) well I do in perl but not php.
heres all the packing that is done anyways not much code here as you can see.. I would just like to UNPACK it.. maybe someone could write a few lines of code for me?
<?php
$hash = md5_hmac(yycc, yyaa);
// MD5 Encryption
function md5_hmac($data, $key)
{
if (strlen($key) > 64)
$key = pack('H*', md5($key));
$key = str_pad($key, 64, chr(0x00));
$k_ipad = $key ^ str_repeat(chr(0x36), 64);
$k_opad = $key ^ str_repeat(chr(0x5c), 64);
return md5($k_opad . pack('H*', md5($k_ipad . $data)));
}
?>
thanks..
Last edited by lynx5; 01-30-2008 at 04:33 AM.
|