21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

with a high-resolution clock (i.e., one running in the GHz range). If your clock has<br />

better than millisecond resolution and the processor is modern, it is probably reasonable<br />

to assume a half-bit of entropy on incoming network packets, even if the packets<br />

are generated by an attacker.<br />

Entropy in the sound device<br />

There is generally some entropy to be had by reading a sound card just from random<br />

thermal noise. However, the amount varies depending on the hardware. Sound cards<br />

are usually also subject to RF interference. Although that is generally not random, it<br />

does tend to amplify thermal noise.<br />

Conservatively, if a machine has a sound card, and its outputs do not fail FIPS-140<br />

tests, we believe it is reasonable to estimate 0.25 bits per sample, as long as an<br />

attacker cannot measure the same samples. Otherwise, do not estimate any.<br />

Entropy from thread timing and other system state<br />

Systems effectively gain entropy based on inputs from the environment. So far, we<br />

have discussed how to estimate entropy by directly sampling the input sources. If<br />

you wish to measure entropy that you are not specifically sampling, it is generally<br />

feasible to query system state that is sensitive to external inputs.<br />

In practice, if you are worried about local attacks, you should not try to measure system<br />

state indirectly, particularly as an unprivileged user. For anything you can do to<br />

measure system state, an attacker can probably get correlated data and use it to<br />

attack your results.<br />

Otherwise, the amount of entropy you get definitely depends on the amount of information<br />

an attacker can guess about your source. It is popular to use the output of<br />

commands such as ps, but such sources are actually a lot more predictable than most<br />

people think.<br />

Instead, we recommend trying to perform actions that are likely to be indirectly<br />

affected by everything going on in the system. For example, you might measure how<br />

many times it takes to yield the scheduler a fixed number of times. More portably,<br />

you can do the same thing by timing how long it takes to start and stop a significant<br />

number of threads.<br />

Again, this works only if local users are not in your threat model. If they are not, you<br />

can estimate entropy by looking at the difference between timestamps, as discussed<br />

earlier in this recipe. If you want to be conservative in your estimates, which is a<br />

good idea, particularly if you might be gathering the same entropy from different<br />

sources, you may want to divide the basic estimate by two or more.<br />

See Also<br />

Recipes 11.5, 11.18<br />

Performing Entropy Estimation and Management | 629<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!