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.

Particularly when an attacker may have local access to a machine, it can be a hopeless<br />

task to figure out what all the possible channels are. Making things difficult is<br />

the fact that machines behave very deterministically. This behavior means that the<br />

only points where there is the possibility for any entropy at all is when outside inputs<br />

are added to the system.<br />

The next problem is that, while a trusted entropy accumulator might be able to<br />

take some measurements of the outside data, there may be nothing stopping an<br />

attacker from taking measurements of the exact same data. For example, suppose<br />

that an operating system uses keyboard strokes as an entropy source. The kernel<br />

measures the keystroke and the timestamp associated with the key press. An<br />

attacker may not be able to measure keystrokes generated by other users, but he<br />

should be able to add his own keystrokes, which the operating system will assume<br />

is entropy. The attacker can also take his own timestamps, and they will be highly<br />

correlated to the timestamps the operating system takes.<br />

If we need to use our own entropy-gathering on a system that does its own, we trust<br />

the operating system’s infrastructure, and we use a different infrastructure (particularly<br />

in terms of the cryptographic design), measuring entropy that the system also<br />

measures will generally not be a problem.<br />

For example, suppose that you have a user interactively type data on startup so that<br />

you can be sure there is sufficient entropy for a seed. If an attacker is a local nonprivileged<br />

user, you can hope that the exact timings and values of key-press information<br />

will contain some data the attacker cannot know and will need to guess. If the system’s<br />

entropy collection system does its job properly, cryptographically postprocessing<br />

entropy and processing it only in large chunks, there should be no practical way<br />

to use system infrastructure as a channel of information on the internal state of your<br />

own infrastructure. This falls apart only when the cryptography in use is broken, or<br />

when entropy estimates are too low.<br />

The worst-case scenario for collecting entropy is generally a headless server. On such<br />

a machine, there is often very little trustworthy entropy coming from the environment,<br />

because all input comes from the network, which should generally be largely<br />

untrusted. Such systems are more likely to request entropy frequently for things like<br />

key generation. Because there is generally little entropy available on such machines,<br />

resource starvation attacks can be a major problem when there are frequent entropy<br />

requests.<br />

There are two solutions to this problem. The first is operational: get a good hardware<br />

random number generator and use it. The second is to make sure that you do<br />

not frequently require entropy. Instead, be willing to fall back on cryptographic<br />

pseudo-randomness, as discussed in Recipe 11.5.<br />

If you take the second approach, you will only need to worry about collecting<br />

entropy at startup time, which may be feasible to do interactively. Alternatively, if<br />

624 | Chapter 11: Random Numbers<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!