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.

dom numbers each time. Throw away all of the temporary material once key<br />

exchange is complete.<br />

Discussion<br />

When discarding key material, be sure to zero it from memory, and<br />

use a secure deletion technique if the key may have been swapped to<br />

disk (See Recipe 13.2).<br />

Suppose that you have a client and a server that communicate frequently, and they<br />

establish connections using a set of fixed RSA keys. Suppose that an attacker has<br />

been recording all data between the client and the server since the beginning of time.<br />

All of the key exchange messages and data encrypted with symmetric keys have been<br />

captured.<br />

Now, suppose that the attacker eventually manages to break into the client and the<br />

server, stealing all the private keys in the system. Certainly, future communications<br />

are insecure, but what about communications before the break-in? In this scenario,<br />

the attacker would be able to decrypt all of the data ever sent by either party because<br />

all of the old messages used in key exchange can be decrypted with all of the public<br />

keys in the system.<br />

The easiest way to fix this problem is to use static (long-term) key pairs for establishing<br />

identity (i.e., digital signatures), but use randomly generated, one-time-use key<br />

pairs for performing key exchange. This procedure is called ephemeral keying (and in<br />

the context of keying Diffie-Hellman it’s called ephemeral Diffie-Hellman, which we<br />

discussed in Recipe 8.17). It doesn’t have a negative impact on security because you<br />

can still establish identities by checking signatures that are generated by the static<br />

signing key. The upside is that as long as you throw away the temporary key pairs<br />

after use, the attacker won’t be able to decrypt old key exchange messages, and thus<br />

all data for connections that completed before the compromise will be secure from<br />

the attacker.<br />

The only reason not to use ephemeral keying with RSA is that key generation<br />

can be expensive.<br />

The standard way of using Diffie-Hellman key exchange provides forward secrecy.<br />

With that protocol, the client and server both pick secret random numbers for each<br />

connection, and they send a public value derived from their secrets. The public values,<br />

intended for one-time use, are akin to public keys. Indeed, it is possible to reuse<br />

secrets in Diffie-Hellman, thus creating a permanent key pair. However, there is significant<br />

risk if this is done naïvely (see Recipe 8.17).<br />

446 | Chapter 8: Authentication and Key Exchange<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!