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.

you use a seed file, you can just collect entropy at install time, at which point interacting<br />

with the person performing the install is not a problem.<br />

Entropy in timestamps<br />

For every piece of data that you think has entropy, you can try to get additional<br />

entropy by mixing a timestamp into your entropy state, where the timestamp corresponds<br />

to the time at which the data was processed.<br />

One good thing here is that modern processors can generate very high-resolution<br />

timestamps. For example, the x86 RDTSC instruction has granularity related to the<br />

clock speed of the processor. The problem is that the end user often does not see<br />

anywhere near the maximum resolution from a timing source. In particular, processor<br />

clocks are usually running in lockstep with much slower bus clocks, which in<br />

turn are running in lockstep with peripheral clocks. Expert real-world analysis of<br />

event timings modulo these clock multiples suggests that much of this resolution is<br />

not random.<br />

Therefore, you should always assume that your clock samples are no more accurate<br />

than the sampling speed of the input source, not the processor. For example, keyboards<br />

and mice generally use a clock that runs around 1 Khz, a far cry from the<br />

speed of the RDTSC clock.<br />

Another issue with the clock is something known as a back-to-back attack, in which<br />

depending on the details of entropy events, an attacker may be able to force entropy<br />

events to happen at particular moments. For example, back-to-back short network<br />

packets can keep a machine from processing keyboard or mouse interrupts until the<br />

precise time it is done servicing a packet, which a remote attacker can measure by<br />

observing the change in response in the packets he sends.<br />

To solve this problem, assume that you get no entropy when the delta between two<br />

events is close to the interrupt latency time. That works because both network packets<br />

and keystrokes will cause an interrupt. *<br />

Timing data is generally analyzed by examining the difference between two samples.<br />

Generally, the difference between two samples will not be uniformly distributed. For<br />

example, when looking at multiple such deltas, the high-order bits will usually be the<br />

same. The floor of the base 2 logarithm of the delta would be the theoretical maximum<br />

entropy you could get from a single timestamp, measured in bits. For example,<br />

if your delta between two timestamps were, in hex, 0x9B (decimal 155), the maximum<br />

number of bits of entropy you could possibly have is 7, because the log of 155<br />

is about 7.28.<br />

* Some operating systems can mitigate this problem, if supported by the NIC.<br />

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