21
\$\begingroup\$

I'm putting together a design for a hardware random number generator that will utilize multiple sources of entropy (combined):

  • Ambient light
  • Ambient sound (and sound levels)
  • Ambient temp
  • Ambient humidity
  • Position of the device itself (upside down, tilted left, titled right, etc)
  • Other sources in the future, possibly even GPS data (marked possible because two users may be standing next to each other, hence possibly deterministic if you know them.)

My idea is to make an entropy pool 'recharger' that people can carry around with them during their day while it continues to write to a USB drive.

After a few hours, the user will have a nice ~4GB entropy pool that can be plugged in to a PC and used. I can't afford the really expensive QRNG's based on light or radioactive decay, so I'm trying to come up with something cheaper.

In your opinion, is Arduino the best choice for prototyping this? If not, what would you recommend?

\$\endgroup\$
0

9 Answers 9

22
\$\begingroup\$

I think you'll want to go down the path busz suggests. Search for the concept "diode noise". The PN junctions in diodes and transistors can produce close to perfect Gaussian white noise. Sampling that should be a source of entropy that's better than any environmental source.

The problem with most environmental/ambient data is the values just don't change that much over time: temperature, humidity, light and sound all have less than an order-of-magnitude of variability with really strong modes. An accelerometer to measure motion might be a good source of variability if mounted on a person, but you'd likely have to do a bit of signal processing to remove the normal modes of oscillation that are present in how humans move. An ambient light & sound source might have some pretty high variability if placed in an high-density urban space, but again I think there would be a lot of repetition. I still think the best source of entropy would be going down towards fundamental physical properties of materials like diode noise than going up in scale and looking at environmental factors capable of being read by a microcontroller.

\$\endgroup\$
8
\$\begingroup\$

There are some interesting circuits for HRNG without the need for ambient entropy sources: http://www.cryogenius.com/hardware/rng/ http://robseward.com/itp/adv_tech/random_generator/ and more...

It's definitely possible to adapt one of these circuits to an Arduino shield. The Arduino would then act as a gateway between the HRNG and a PC.

If you really need ambient entropy input, the arduino has 6 analog input channels so you can read out almost any sensor that you can think of and use the data as a source for a random seed.

\$\endgroup\$
0
6
\$\begingroup\$

Two comments:

  1. Look into Bruce Schneier's Yarrow PRNG algorithm. The main point is that you can have a really lousy source of "true" random information; as long as you accumulate enough of it over time, the resulting uncertainty can be combined with software pseudo-random number generation techniques to yield decent random numbers.

  2. On the other hand, I have to agree with most other answerers. Slowly-changing signals from environmental sensors are lousy sources of entropy, and could easily be influenced. Make sure you use something that is based on intrinsic device noise, and it will be insensitive of environmental changes.

\$\endgroup\$
6
\$\begingroup\$

I just spotted this Random Number Generator:

Hourglass Random Number Generator http://makezineblog.files.wordpress.com/2009/12/usbsand.jpg?w=600&h=703

over on Make:Blog and thought you might be interested.

\$\endgroup\$
2
  • \$\begingroup\$ Are you referring to the "USB Hourglass random number generator" ? \$\endgroup\$
    – davidcary
    Jun 6, 2013 at 3:32
  • \$\begingroup\$ Yes that was the one. The original link was to its' home page on comcast which is no longer there. Thanks. Fixed the links now. \$\endgroup\$
    – Amos
    Jun 28, 2013 at 21:42
3
\$\begingroup\$

I agree with the above two responses. Human activities and ambient readings will make a terrible random pool. But it sounds like you will only be convinced of this by trying it and checking the resulting randomness yourself. It will be a great learning experience for you!

Arduino is fine for this application. All of the sensors you are interested in can be attached to Arduino and there are Arduino libraries available for those sensors.

Check out these tutorials on connecting sensors to Arduino: http://www.ladyada.net/learn/sensors/

\$\endgroup\$
0
3
\$\begingroup\$

This may be an option for you. Its from sparkfun and not cheap, but it will probably be excellent as a 'true' random number generator. It uses a geigercounter to generate the random numbers.

https://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=132

\$\endgroup\$
0
3
\$\begingroup\$

A number of the white noise generators in the analog music synthesizers (Moog and Arp) would avalanche a transistor. If you query online for the Minimoog schematic or the ARP4027 you should find the schematics.

I did a PCB layout for the ARP4027. If you can't find the schematic send me an email.

National had made a digital random number generator -- the MM5437. IIRC there were some programs for an AT-tiny that would do this too. Could be a fun little project.

\$\endgroup\$
2
\$\begingroup\$

I have read recently a very interesting discussion of using resistors to generate random noise. Due to quantum effects, a resistor will produce a very small voltage. This can be amplified with an op-amp to produce a high quality source of random noise.

\$\endgroup\$
2
\$\begingroup\$

You could use the sensor input as seeds to a pseudo-random number generator. The Linux OS uses input from the keyboard/mouse as seeds to /dev/random. Just an idea.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.