21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Let’s look briefly at the pros and cons of using these functions.<br />

Davies-Meyer<br />

This function is one way of turning block ciphers into one-way hash functions<br />

(Matyas-Meyer-Oseas is a similar technique that is also commonly seen). This<br />

technique does not thwart birthday attacks without additional measures, and it’s<br />

therefore an inappropriate construct to use with most block ciphers because<br />

most ciphers have 64-bit blocks. AES is a good choice for this construct, though<br />

64 bits of resistance to birthday attacks is somewhat liberal. While we believe<br />

this to be adequate for the time being, it’s good to be forward-thinking and<br />

require something with at least 80 bits of resistance against a birthday attack. If<br />

you use Davies-Meyer with a nonce, it offers sufficient security. We show how to<br />

implement Davies-Meyer in Recipe 6.15.<br />

MD2<br />

MD2 (Message Digest 2 from Ron Rivest *) isn’t used in many situations. It is<br />

optimized for 16-bit platforms and runs slowly everywhere else. It also hasn’t<br />

seen much scrutiny, has an internal structure now known to be weak, and has a<br />

small digest size. For these reasons, we strongly suggest that you use other alternatives<br />

if at all possible.<br />

MD4, MD5<br />

As we mentioned, MD4 (Message Digest 4 from Ron Rivest) is still used in some<br />

applications, but it is quite broken and should not be used, while MD5 should<br />

be avoided as well, because its internal structure is known to be quite weak. This<br />

doesn’t necessarily amount to a practical attack, but cryptographers do not recommend<br />

the algorithm for new applications because there probably is a practical<br />

attack waiting to be found.<br />

MDC-2<br />

MDC-2 is a way of improving Matyas-Meyer-Oseas to give an output that offers<br />

twice as many bits of security (i.e., the digest is two blocks wide). This clearly<br />

imposes a speed hit over Matyas-Meyer-Oseas, but it avoids the need for a<br />

nonce. Generally, when people say “MDC-2,” they’re talking about a DES-based<br />

implementation. We show how to implement MDC-2-AES in Recipe 6.16.<br />

RIPEMD-160, SHA1<br />

RIPEMD-160 and SHA1 are both well-regarded hash functions with reasonable<br />

performance characteristics. SHA1 is a bit more widely used, partially because it<br />

is faster, and partially because the National Institute of Standards and Technology<br />

(NIST) has standardized it. While there is no known attack better than a<br />

birthday attack against either of these algorithms, RIPEMD-160 is generally<br />

regarded as having a somewhat more conservative design, but SHA1 has seen<br />

more study.<br />

* MD1 was never public, nor was MD3.<br />

Choosing a Cryptographic Hash Algorithm | 257<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!