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.

One disadvantage of turning a block cipher into a hash function is speed. As we’ll<br />

show in Recipe 6.3, dedicated cryptographic hash constructs tend to be faster than<br />

those based on block ciphers.<br />

In addition, all hash-from-cipher constructs assume that any cipher used will resist<br />

related-key attacks, a type of attack that has not seen much mainstream study.<br />

Because cryptographic hash functions aren’t that well studied either, it’s hard to say<br />

which of these types of hash constructs is better.<br />

It is clear that if you’re looking for message authentication, a good universal MAC<br />

solution is better than anything based on a cryptographic hash function, because<br />

such constructs tend to have incredibly good, provable security properties, and they<br />

tend to be faster than traditional MACs. Unfortunately, they’re not often useful outside<br />

the context of message authentication.<br />

See Also<br />

Recipe 6.3<br />

6.3 Choosing a Cryptographic Hash Algorithm<br />

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

You need to use a hash algorithm for some purpose (often as a parameter to a MAC),<br />

and you want to understand the important concerns so you can determine which<br />

algorithm best suits your needs.<br />

Solution<br />

Security requirements should be your utmost concern. SHA1 is a generally a good<br />

compromise for those in need of efficiency. We recommend that you do not use the<br />

popular favorite MD5, particularly in new applications.<br />

Note that outside the context of a well-designed MAC, it is difficult to use a cryptographic<br />

hash function securely, as we discuss in Recipes 6.5 through 6.8.<br />

Discussion<br />

A secure message digest function (or one-way hash function) should have the following<br />

properties:<br />

One-wayness<br />

If given an arbitrary hash value, it should be computationally infeasible to find a<br />

plaintext value that generated that hash value.<br />

254 | 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!