<?php
function mac($msg)
{
$key = "7h3_1337_k3y";
$nonce = "5uc3m01";
$bloc_size = 64;
if(strlen($msg)==$bloc_size)
{
print("cas2");
$mac = $msg;
}
else if(strlen($msg)>$bloc_size)
{
print("cas3");
$mac = hash_hmac("sha512",$msg.$nonce,$key,true);
}
return crypt($mac,'$6$rounds=5000$OhMyG05h!');
}
$lemessage="UNMESSAGEASSEZGRANDPOURTOMBERDANSLECASDUCALCULDEHASHMAPETPOUVOIRREJOURSONMACPOURTOMBERDANSLECASCRYPTODIRECT";
$mac = mac($lemessage);
$valuemac=hash_hmac("sha512",$lemessage."5uc3m01","7h3_1337_k3y",false);
print("**".strlen($valuemac)."***".$valuemac."*******");
$mac2=eval('return hex2bin("c210825a47af7f8869fb6e11adc9dd3eceb85735c47807badaff958f0af386f5e3f7e24c15034ff6dc71d117697f5853da05bb76ec7086d07f25b53f707d9477");');
<? phpinfo(); ?>
$mac3=<?return hex2bin("c210825a47af7f8869fb6e11adc9dd3eceb85735c47807badaff958f0af386f5e3f7e24c15034ff6dc71d117697f5853da05bb76ec7086d07f25b53f707d9477")?>;
$b=mac($mac2);
if($mac==$b)
{
print("OK");
}
else{
print("KO");
}
print($mac);
print($b);
- Output for 7.0.0
- Parse error: syntax error, unexpected '<', expecting end of file in /in/5g8ZF on line 30
Process exited with code 255. - Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
- Parse error: syntax error, unexpected '<' in /in/5g8ZF on line 30
Process exited with code 255.
preferences:
171.13 ms | 1395 KiB | 24 Q