2 ms·
I noticed this https://news.ycombinator.com/item?id=4964720 https://news.ycombinator.com/item?id=4964720 advice is wrong. >Possible timing attack. Consider doin
by bitwisebro 13y ago
I noticed this https://news.ycombinator.com/item?id=4964720 https://news.ycombinator.com/item?id=4964720 advice is wrong.
>Possible timing attack. Consider doing another HMAC of each HMAC and comparing those instead.
The time-insensitive method is to XOR every bit of HMAC_0 with HMAC_1 (keep going even if they are not of equal lengths use 0s) and then (not before) check if the lengths are equal.
- andrewcooke 13y agoeither approach avoids leaking useful information, doesn't it? one does so by guaranteeing identical times. the other by passing the information through a one-way function. the link given in the advice you point to includes a fairly detailed discussion / comparison - https://www.isecpartners.com/blog/2011/february/double-hmac-verification.aspx https://www.isecpartners.com/blog/2011/february/double-hmac-...