@ 2015-12-15T19:20:35Z <?php
function padding($msg,$nb_chars)
{
$charset = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9');
for($cpt=0;$cpt<$nb_chars;$cpt++)
{
$rand = rand(0,61);
print("!!!!!!!!!!!!!!!!!".$rand);
$msg .= $charset[$rand];
}
return $msg;
}
function mac($msg)
{
$key = "7h3_1337_k3y";
$nonce = "5uc3m01";
$bloc_size = 64;
if(strlen($msg)<$bloc_size)
{
$msg = padding($msg,$bloc_size-strlen($msg));
$mac = $msg;
}
else if(strlen($msg)==$bloc_size)
{
$mac = $msg;
}
else if(strlen($msg)>$bloc_size)
{
$mac = hash_hmac("sha512",$msg.$nonce,$key,true);
}
return crypt($mac,'$6$rounds=5000$OhMyG05h!');
}
$lemessage="UNMESSAGEASSEZLONGPOURTOMBERDANSLECASDUHASHMAPETREGENERERUNHASHAVECLEHASHDECETTEVALEUR";
$mac = mac($lemessage);
$valuemac=hash_hmac("sha512","$lemessage".5uc3m01","7h3_1337_k3y",false);
print("**".strlen($valuemac)."***".$valuemac."*******");
$mac2=eval('return hex2bin("c210825a47af7f8869fb6e11adc9dd3eceb85735c47807badaff958f0af386f5e3f7e24c15034ff6dc71d117697f5853da05bb76ec7086d07f25b53f707d9477");');
$b=mac($mac2);
if($mac==$b)
{
print("OK");
}
else{
print("KO");
}
print($mac);
print($b);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 7.0.0 0.000 0.043 20.27 5.6.16 0.003 0.067 20.55 5.6.15 0.010 0.060 18.28 5.6.14 0.003 0.083 18.18 5.6.13 0.010 0.073 18.16 5.6.12 0.007 0.067 21.14 5.6.11 0.007 0.037 21.14 5.6.10 0.007 0.037 21.07 5.6.9 0.007 0.040 21.03 5.6.8 0.007 0.077 20.45 5.5.30 0.000 0.067 18.05 5.5.29 0.010 0.087 18.02 5.5.28 0.007 0.080 20.79 5.5.27 0.007 0.083 20.83 5.5.26 0.003 0.047 20.89 5.5.25 0.003 0.087 20.57 5.5.24 0.027 0.070 20.26
preferences:dark mode live preview
135.76 ms | 1394 KiB | 7 Q