Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



What about hashing the output from the A/D converter?


What good would that do? It doesn't introduce additional randomness, does it?


It doesn't add more entropy, but it makes the output look better on various tests of randomness.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: