320 links
Sbgodin
Home
Login
RSS Feed
ATOM Feed
Tag cloud
Picture wall
Daily
Links per page:
20
50
100
page 1 / 1
ZeroBin Security Audit
Nice "equal" function taking constant time to compute. This avoids time attacks, based on the assumption that different things and equal things take different time to compare.
function slow_equals($a, $b)
{
$diff = strlen($a) ^ strlen($b);
for($i = 0; $i < strlen($a) && $i < strlen($b); $i++)
{
$diff |= ord($a[$i]) ^ ord($b[$i]);
}
return $diff === 0;
}
Mon 03 Feb 2014 10:45:01 AM CET
- permalink
-
-
https://defuse.ca/audits/zerobin.htm
en
hack
secu
Links per page:
20
50
100
page 1 / 1