News for hackers. Stuff that matters.
Re:USB True Random Number Generator by aidenn0 on Tuesday June 22, 2010 @06:57PM (#1453506)
I don't know if things are improved, but the last time I looked into HW random number generators, it was RS-232 connected ones, and the quality control was terrible a fairly high percentage of them generated very low quality random numbers. You would think you could mitigate this by xoring two of them together, but this made things much worse since 2 connected to the same outlet tended to be somewhat correlated!

My impression of the HW random number generator industry was that it was all snake oil, only the people selling them didn't necessarily know that was true.

Se also: http://web.archive.org/web/20011027002011/http://dilbert.com...

[edit] The technical section of the webpage[1] directly addresses most of the problems that the RS-232 devices I looked into a number of years ago had; namely it detects when the diodes are going bad, and tries to not exceed the estimated entropy rate (the RS-232 devices just blindly XORed them together at a predefined bitrate; boxes typically had 4 diodes, since 1 or more was bad in almost all shipping boxes). My experience was so bad with those devices though that I would want to spend a lot of time with any HW device before trusting it.

1) http://www.entropykey.co.uk/tech/

Re:USB True Random Number Generator by jacquesm on Wednesday June 23, 2010 @03:56AM (#1454387)
It is incredibly hard to make a really good random number generator in hardware. The best I've ever managed to come up with was also a diode based white noise generator with a PIC chip to digitize the output of the diode after amplification.

One of the problems of that approach is the low quality of the built in A/D converter of the PIC, another the ease with which powerline hum and other electromagnetic noise made it into the circuitry. We did get the circuit to work, but it was hard to duplicate with lots of fiddling required before we had a series of 4 of them good enough for production use.

A typical test run would take a week and it was not rare to see 'good' performance on a test run of a day while still having to discard components after a week.

They were used to power an online casino.

Re:USB True Random Number Generator by stcredzero on Wednesday June 23, 2010 @06:48AM (#1454592)
What about hashing the output from the A/D converter?
Re:USB True Random Number Generator by mfukar on Wednesday June 23, 2010 @07:12AM (#1454617)
What good would that do? It doesn't introduce additional randomness, does it?
Re:USB True Random Number Generator by stcredzero on Wednesday June 23, 2010 @07:27AM (#1454630)
It doesn't add more entropy, but it makes the output look better on various tests of randomness.
Re:USB True Random Number Generator by jacquesm on Thursday June 24, 2010 @06:05AM (#1457724)
Good tests for randomness will pick that out relatively easily.

There is a whole set of tests that you can run to determine the quality of your random data, hashing functions applied to the output of a less than perfect RNG will only fool the most naive of such tests.

Of course it all depends on the quality desired, in my case I had to satisfy all those tests and it was surprisingly hard to do, it's one of the few contracting jobs that I ever landed fixed price that I actually lost money on, the upside is that I learned an awful lot, especially about PCB layout, ground planes, power supply stabilization and semiconductor behaviour as well as analyzing such a system over an extended period.

It's the weirdest thing to be able to graph a perfect sinewave extrapolated from long term analysis of the summation of a few billion samples when looking for 50 or 100 Hz influences, especially if those samples pass most tests for randomness with flying colours. Circuits containing both analog and digital components are a black art, and my hat is definitely off to those that do this for a living and have turned it in to a science. Dabblers like me would do better to know the limits of their knowledge, I did eventually get it to work but if such a job came my way again I'd decline in spite of knowing more now about the subject than back then when I first took that job.

Re:USB True Random Number Generator by DavidSJ on Wednesday June 23, 2010 @01:07AM (#1454167)
My impression of the HW random number generator industry was that it was all snake oil, only the people selling them didn't necessarily know that was true.

In general I find that snake oil salesmen don't realize that they're snake oil salesmen.

Re:USB True Random Number Generator by stcredzero on Tuesday June 22, 2010 @11:39PM (#1454039)
You would think you could mitigate this by xoring two of them together, but this made things much worse since 2 connected to the same outlet tended to be somewhat correlated!

I would collect the bit stream then run the result through SHA256 in 256 bit batches.

Re:USB True Random Number Generator by statictype on Tuesday June 22, 2010 @09:14PM (#1453788)
>fairly high percentage of them generated very low quality random numbers

How do you judge the quality of a series of random numbers?

Re:USB True Random Number Generator by po on Tuesday June 22, 2010 @09:18PM (#1453797)
You run a bunch of Diehard tests on them:

http://en.wikipedia.org/wiki/Diehard_tests

Re:USB True Random Number Generator by po on Tuesday June 22, 2010 @09:34PM (#1453835)
The best part of testing random number generators is playing 200,000 games of craps. My boss protested, but I just questioned his commitment to security…
Re:USB True Random Number Generator by ciupicri on Tuesday June 22, 2010 @09:21PM (#1453811)
FIPS 140-2 mentions some tests. [1]

[1] http://www.fdk.com/cyber-e/pdf/HM-RAE103.pdf