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.

SHA-256, SHA-384, SHA-512<br />

After the announcement of AES, NIST moved to standardize hash algorithms that,<br />

when considering the birthday attack, offer comparable levels of security to AES-<br />

128, AES-192, and AES-256. The result was SHA-256, SHA-384, and SHA-512.<br />

SHA-384 is merely SHA-512 with a truncated digest value, and it therefore isn’t<br />

very interesting in and of itself.<br />

These algorithms are designed in a very conservative manner, and therefore their<br />

speed is closer to that expected from a block cipher than that expected from a<br />

traditional cryptographic message digest function. Clearly, if birthday-style<br />

attacks are not an issue (usually due to proper use of nonce), then AES-256 and<br />

SHA-256 offer equivalent security margins, making SHA-384 and SHA-512 overkill.<br />

In such a scenario, SHA1 is an excellent algorithm to pair with AES-128. In<br />

practice, a nonce is a good idea, and we therefore recommend AES-128 and<br />

SHA1 when you want to use a block cipher and a separate message digest algorithm.<br />

Note also that performance numbers for SHA-384 and SHA-512 would<br />

improve on a platform with native 64-bit operations.<br />

The cryptographic hash function constructs based on block ciphers not only tend to<br />

run more slowly than dedicated functions, but also they rely on assumptions that are<br />

a bit unusual. In particular, these constructions demand that the underlying cipher<br />

resist related-key attacks, which are relatively unstudied compared with traditional<br />

attacks. On the other hand, dedicated hash functions have received a whole lot less<br />

scrutiny from the cryptanalysts in the world—assuming that SHA1 acts like a<br />

pseudo-random function (or close to it) is about as dicey.<br />

In practice, if you really need to use a one-way hash function, we believe that SHA1<br />

is suitable for almost all needs, particularly if you are savvy about thwarting birthday<br />

attacks and collision attacks on the block cipher (see Recipe 5.3). If you’re using AES<br />

with 128-bit keys, SHA1 makes a reasonable pairing. However, if you ever feel the<br />

need to use stronger key sizes (which is quite unnecessary for the foreseeable future),<br />

you should also switch to SHA-256.<br />

See Also<br />

Recipes 5.3, 6.5-6.8, 6.15, 6.16<br />

6.4 Choosing a Message Authentication Code<br />

<strong>Problem</strong><br />

You need to use a MAC (which yields a tag that can only be computed correctly on a<br />

piece of data by an entity with a particular secret key), and you want to understand<br />

the important concerns so you can determine which algorithm best suits your needs.<br />

258 | Chapter 6: Hashes and Message Authentication<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!