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.

Establishing identity<br />

A third use of public key cryptography is in authentication schemes for purposes<br />

of identity establishment (e.g., login). We’ll largely skip this topic for now,<br />

coming back to it in Chapter 8.<br />

In practice, public key cryptography is a complex field with a lot of infrastructure<br />

built around it. Using it effectively requires a trusted third party, which is usually a<br />

public key infrastructure (PKI).<br />

This entire chapter is effective only in the context of some kind of<br />

working PKI, even if it is an ad hoc PKI. Refer to Chapter 10 for PKI<br />

basics.<br />

In this chapter, we’ll describe the fundamentals of key exchange and digital signatures<br />

at a low level. Unfortunately, this area is quite vast, and we’ve had to limit our<br />

discussion to the topics we believe are most relevant to the average developer. We<br />

expect that supplemental recipes for more esoteric topics will gradually become<br />

available on this book’s web site, based on reader contributions.<br />

There are certain interesting topics that we simply don’t have room for in this chapter.<br />

For example, elliptic curve cryptography is a type of public key encryption that<br />

can offer security similar to that of the traditional algorithms presented in this chapter,<br />

with notable speed gains. While elliptic curve cryptography doesn’t speed things<br />

up so much that you would want to use it in places where traditional public key<br />

cryptography isn’t useful, it does allow you to better scale the number of simultaneous<br />

connections you can handle. While elliptic curve cryptography is a fascinating<br />

and useful area, however, it’s not nearly as important as the rest of the material in<br />

this chapter, particularly considering that standards and implementations for this<br />

kind of public key cryptography have emerged only in the last few years, and that the<br />

technology isn’t yet deployed on a wide scale (plus, there are intellectual property<br />

issues when using the standard).<br />

We’ve also limited our examples to OpenSSLwhenever it supports the topic under<br />

discussion. While we do cover Microsoft’s CryptoAPI in several other chapters side<br />

by side with OpenSSL, we won’t be discussing it in this chapter. CryptoAPI’s support<br />

for public key cryptography is sufficiently crippled that providing solutions that<br />

use it would be incomplete to the point of providing you with little or no utility. In<br />

particular, CryptoAPI provides no means to exchange keys in any kind of recognized<br />

portable format (such as DER or PEM; see Recipes 7.16 and 7.17) and no means by<br />

which keys other than randomly generated ones can generate digital signatures.<br />

These limitations effectively rule out a large portion of public key cryptography’s<br />

common uses, which make up the majority of code-related recipes in this chapter.<br />

308 | Chapter 7: Public Key Cryptography<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!