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.

about? For example, it is possible to monitor electromagnetic signals coming from a<br />

computer to capture every signal coming from that machine. The CIA has been<br />

known to do this with great success. In such a case, there may be absolutely no<br />

entropy at all without some sort of measures to prevent against such attacks.<br />

Most people are not worried about such a threat model because the attack requires a<br />

high degree of skill. In addition, it generally requires placing another machine in<br />

close proximity to the machine being targeted. A more realistic assumption, is that<br />

someone with a local (nonroot) account on the machine will try to launch an attack.<br />

Quite a bit of the entropy an interactive Unix system typically gathers can be<br />

observed by such an attacker, either directly or indirectly.<br />

If you are not worried about people with access to the local system, we believe you<br />

should at least assume that attackers will somehow find their way onto the same network<br />

segment as the machine that’s collecting entropy. You should therefore assume<br />

that there is little entropy to be had in network traffic that the machine receives,<br />

because other machines on the network may be able to see the same traffic, and even<br />

inject new traffic.<br />

Another threat you might want to consider is the possibility of an attacker’s finding a<br />

way to pollute or destroy one or more entropy sources. For example, suppose you<br />

are using a hardware random number generator. The attacker may not have local<br />

account access and may not have the resources or know-how for an electromagnetic<br />

signal capture attack. However, there may be an easy way to break the physical random<br />

number generator and get it to produce a big string of zeros.<br />

Certainly, you can use FIPS 140 testing as a preventive measure here, as discussed in<br />

Recipe 11.18. However, those tests are not very reliable. You might still want to<br />

assume that entropy sources may not provide any entropy at all.<br />

Such attacks are probably worst-case in most practical systems. You can prevent<br />

against tainted entropy sources by using multiple entropy sources, under the<br />

assumption (which is probably pretty reasonable in practice) that an attacker will not<br />

have the resources to effectively taint more than one source at once.<br />

With such an assumption, you can estimate entropy as if such attacks are not possible,<br />

then subtract out the entropy estimate for the most plentiful entropy source. For<br />

example, suppose that you want to collect a 128-bit seed, and you read keyboard<br />

input and also read separately from a fast hardware random number generator. With<br />

such a metric, you would assume that the hardware source (very likely to be the most<br />

plentiful) is providing no entropy. Therefore, you refuse to believe that you have<br />

enough entropy until your entropy estimate for the keyboard is 128 bits.<br />

You can come up with more liberal metrics. For example, suppose you are collecting<br />

a 128-bit seed. You could have a metric that says you will believe you really have 128<br />

bits of entropy when you have collected at least 160 bits total, where at least 80 of<br />

those bits are from sources other than the fastest source. This is a reasonable metric,<br />

622 | 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!