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.

See Also<br />

Recipes 6.7, 6.8, 6.12<br />

6.2 Deciding Whether to Support Multiple<br />

Message Digests or MACs<br />

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

You need to figure out whether to support multiple algorithms in your system.<br />

Solution<br />

The simple answer is that there is no right answer, as we discuss next.<br />

Discussion<br />

Clearly, if you need to support multiple algorithms for standards compliance or legacy<br />

support, you should do so. Beyond that, there are two schools of thought. The<br />

first school recommends that you support multiple algorithms in order to allow users<br />

to pick their favorite. The other benefit of this approach is that if an algorithm turns<br />

out to be seriously broken, supporting multiple algorithms can make it easier for<br />

users to switch. The second school of thought points out that the reality is if an algorithm<br />

is broken, many users will never switch, so that’s not a good reason for providing<br />

options. Moreover, by supporting multiple algorithms, you risk adding<br />

additional complexity to your application, and that can be detrimental. In addition,<br />

if there are multiple interoperating implementations of a protocol you’re creating,<br />

often other developers will implement only their own preferred algorithms, potentially<br />

leading to major interoperability problems.<br />

We personally prefer picking a single algorithm that will do a good enough job of<br />

meeting the needs of all users. That way, the application is simpler to comprehend,<br />

and there are no interoperability issues. If you choose well-regarded algorithms, the<br />

hope is that there won’t be a break that actually impacts end users. However, if there<br />

is such a break, you should make the algorithm easy to replace. Because cryptographic<br />

hash functions and MACs tend to have standard interfaces, that is usually<br />

easy to do.<br />

Besides dedicated hash algorithms such as SHA1 (Secure Hash Algorithm 1) and<br />

MD5 (Message Digest 5 from Ron Rivest), there are several constructs for turning a<br />

block cipher into a cryptographic hash function. One advantage of such a construct<br />

is that block ciphers are a better-studied construct than hash functions. In addition,<br />

needing fewer cryptographic algorithms for an application can be important when<br />

pushing cryptography into hardware.<br />

Deciding Whether to Support Multiple Message Digests or MACs | 253<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!