News for hackers. Stuff that matters.
Re:Everything you need to know about cryptography in 1 hour by Groxx on Friday May 14, 2010 @07:22AM (#1347064)
Am curious as to why to use "x |= MAC_computed[i] − MAC_received[i];" instead of the block-wise comparison. Wouldn't the x |= approach be less secure, because two (or more) differences may cancel each other out? (am assuming that |= == ||= in Ruby, or a bitwise OR)
Re:Everything you need to know about cryptography in 1 hour by gjm11 on Friday May 14, 2010 @07:31AM (#1347083)
No, not possible for differences to cancel. The bitwise OR of a bunch of things is zero only if all of the individual things are zero. The difference between two things is zero only if they're equal. Therefore, the final value of x is zero only if all the elements of MAC_computed and MAC_received match.

(And -- the main point here -- how long it takes to do the calculation should be totally independent of what's actually in the arrays: no early termination, no operations that take different amounts of time depending on how many elements match, etc.)

Re:Everything you need to know about cryptography in 1 hour by Groxx on Friday May 14, 2010 @07:35AM (#1347092)
ah, bitwise or, was thinking incorrectly for some reason. And early termination makes sense, thanks! Didn't think of that.