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.

if an algorithm turns out to be seriously broken, supporting multiple algorithms can<br />

make it easier for users to switch.<br />

However, the other school of thought points out that in reality, many users will<br />

never switch algorithms, even if one is broken. Moreover, by supporting multiple<br />

algorithms, you risk adding more complexity to your application, which can be detrimental.<br />

In addition, if there are multiple interoperating implementations of a protocol<br />

you’re creating, other developers often will implement only their own preferred<br />

algorithms, potentially 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. Many cryptographic<br />

APIs, such as the OpenSSLEVP interface (discussed in Recipe 5.17), provide an<br />

interface to help out here.<br />

See Also<br />

Recipe 5.17<br />

5.2 Figuring Out Which Encryption Algorithm Is<br />

Best<br />

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

You need to figure out which encryption algorithm you should use.<br />

Solution<br />

Use something well regarded that fits your needs. We recommend AES for generalpurpose<br />

use. If you’re willing to go against the grain and are paranoid, you can use<br />

Serpent, which isn’t quite as fast as AES but is believed to have a much higher security<br />

margin.<br />

If you really feel that you need the fastest possible secure solution, consider the<br />

SNOW 2.0 stream cipher, which currently looks very good. It appears to have a<br />

much better security margin than the popular favorite, RC4, and is even faster. However,<br />

it is fairly new. If you’re highly risk-adverse, we recommend AES or Serpent.<br />

Although popular, RC4 would never be the best available choice.<br />

156 | Chapter 5: Symmetric Encryption<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!