21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

assume that you always need it, then figure out if your design somehow provides it.<br />

Generally, that will be the case if you use a hash function in a component of a MAC<br />

that requires a nonce, and not true otherwise (however, see Recipe 6.8).<br />

As a result, you should consider MD5 to have, at best, 64 bits of strength. In fact,<br />

considering the weaknesses inherent in MD5, you should assume that, in practice,<br />

MD5’s strength is less than that. 64 bits of security is on the borderline of what is<br />

breakable. (It may or may not be possible for entities with enough resources to bruteforce<br />

64 bits in a reasonable time frame.)<br />

Table 6-1 lists popular cryptographic hash functions and compares important properties<br />

of those functions. Note that the two MDC-2 constructs we detail are covered<br />

by patent restrictions until August 28, 2004, but everything else in this list is widely<br />

believed to be patent-free.<br />

When comparing speeds, times were measured in x86 cycles per byte processed<br />

(lower numbers are better), though results will vary slightly from place to place.<br />

Implementations used for speed testing were either the default OpenSSLimplementation<br />

(when available); the implementation in this book using OpenSSLversions of<br />

the underlying cryptographic primitives; or, when neither of those two were available,<br />

a reference implementation from the Web (in particular, for the last three SHA<br />

algorithms). In many cases, implementations of each algorithm exist that are more<br />

efficient, but we believe that our testing strategy should give you a reasonable idea of<br />

relative speeds between algorithms.<br />

Table 6-1. Cryptographic hash functions and their properties<br />

Algorithm Digest size<br />

Davies-Meyer-AES-<br />

128<br />

128 bits (same length<br />

as cipher block size)<br />

Security<br />

confidence<br />

256 | Chapter 6: Hashes and Message Authentication<br />

Small message<br />

speed (64<br />

bytes), in cycles<br />

per byte a<br />

Large message<br />

speed (8K), in<br />

cycles per byte<br />

a All timing values are best cases based on our empirical testing, and assume that the data being processed is already in cache. Do not expect<br />

that you’ll quite be able to match these speeds in practice.<br />

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

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.<br />

Uses<br />

block<br />

cipher<br />

Good 46.7 cpb 57.8 cpb Yes<br />

MD2 128 bits Good to low 392 cpb 184 cpb No<br />

MD4 128 bits Insecure 32 cpb 5.8 cpb No<br />

MD5 128 bits Very low, may be<br />

insecure<br />

40.9 cpb 7.7 cpb No<br />

MDC-2-AES-128 256 bits Very high 93 cpb 116 cpb Yes<br />

MDC-2-DES 128 bits Good 444 cpb 444 cpb Yes<br />

RIPEMD-160 160 bits High 62.2 cpb 20.6 cpb No<br />

SHA1 160 bits High 53 cpb 15.9 cpb No<br />

SHA-256 256 bits Very high 119 cpb 116 cpb No<br />

SHA-384 384 bits Very high 171 cpb 166 cpb No<br />

SHA-512 512 bits Very high 171 cpb 166 cpb No

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

Saved successfully!

Ooh no, something went wrong!