Re:A Lesson In Timing Attacks (or, Don't use MessageDigest.i...
by jgrahamc on Thursday August 13, 2009 @12:37PM
(#761134)
I believe that Ruby's Digest == method suffers from a similar issue. It uses rb_str_cmp to compare the hex strings, which uses rb_memcmp to do the comparison which uses memcmp.
The implementation of memcmp bails out as soon as it finds a difference:
The implementation of memcmp bails out as soon as it finds a difference:
I suppose I ought to be reporting that somewhere. OK, I just told the security alias for Ruby about it.