7

I was interested in finding out how one can use atmospheric noise to generate true random numbers. I know RANDOM.ORG does it but they (of course) don't explain what the process is and how it can be implemented. I would like to know how the process works and how it can be implemented into java. I have looked into this article but it's for .net so I don't understand it. I also looked into the RANDOM.ORG article on true randomness. If someone can give me a general idea of this works and how it can be implemented, it would be greatly appreciated.

Community
  • 1
  • 1
Jeel Shah
  • 3,274
  • 17
  • 47
  • 68
  • It involves having some transducer connected to your computer which is capable of measuring something random (the examples included lava lamps and radioactive decay). Unless you have such a transducer, you won't be able to do it! – Oliver Charlesworth Nov 28 '11 at 17:09
  • 7
    1. hook radio receiver up to pc. 2. digitize static 3. ??? 4. profit. – Marc B Nov 28 '11 at 17:10
  • 1
    On a more simplistic note, try reading system info, get temperature from your CPU and/or fan - and use it to get your number – Aleks G Nov 28 '11 at 17:14
  • what do you mean by "get temperature from your CPU", how can I do that? and once I get the temperature, how can I use that for random number generation? – Jeel Shah Nov 29 '11 at 14:28

4 Answers4

6

Chances are good that if you bought a computer sometime in the past year, it has a true random number generator embedded directly in the CPU. This became available when Intel began shipping their Ivy Bridge-based Core and Xeon processors in April, 2012.

There's an excellent article in IEEE Spectrum that describes how Intel's digital random number generator works. They basically tied two NOT-gates into a loop, creating an inherently unpredictable circuit that settles into a 0 or 1 state due to the random effects of thermal noise. Thermal noise is just random atomic vibrations, which is pretty much the same underlying physical phenomenon that RANDOM.ORG uses when it samples "atmospheric noise".

For a truly in-depth analysis of Intel's RNG and the quality of its output, see this PDF document from Cryptography Research, particularly page 7.

Intel added a new x86 instruction called RDRAND that allows programs to directly retrieve these hardware-generated random numbers. As of Java 7, the JVM has yet to add native support for this instruction (if it ever will).

However, it is possible to invoke RDRAND from Java using JNI. This is the approach I took with the drnglib project. For example:

DigitalRandom random = new DigitalRandom();
System.out.println(random.nextInt());

The nextInt() method is implemented as a JNI native call that invokes RDRAND. Here's the relevant call stack:

The performance of RDRAND is very good. Using drnglib with eight threads yields ~760 MB/sec of random data.

cambecc
  • 4,083
  • 1
  • 23
  • 24
  • This is an excellently constructed answer! However, what are the options if one does not have computer that was bought in the recent past? Is the only option atmospheric noise or are there other options? – Jeel Shah May 15 '13 at 16:18
  • 1
    There are other options but they are harder from either a theoretical or practical perspective. One of the other answers linked to the wikipedia article on hardware random number generators. The whole article is illuminating but check out this [section on using observed events](http://en.wikipedia.org/wiki/Hardware_random_number_generator#Using_observed_events), particularly the discussion of `/dev/random`, which has its [own article](http://en.wikipedia.org/wiki//dev/random). The amount of effort put into `/dev/random` to provide sufficient randomness for cryptographic purposes is staggering. – cambecc May 15 '13 at 23:39
  • 1
    Basically, gathering randomness from the environment is hard. That's why sites like RANDOM.ORG exist, and why Intel spent years designing and building RDRAND. Here's [yet another wikipedia article](http://en.wikipedia.org/wiki/Entropy_%28computing%29) on the subject. – cambecc May 15 '13 at 23:47
4

You have to hook up a radio receiver into your machine (like this one: Philips FM1236/F TV Tuner/FM Radio/Video PCI Capture Card ).

Plug it into a free PCI Slot, you should be able to test its workings with some audio listening device (like VLC Player).

Then you tune it to a non-sending frequency and have your program connect to the device its representing to make a audio capture (the correct way to do so depends on the card you use, but this will help: http://docs.oracle.com/javase/tutorial/sound/capturing.html )

Then you process the audio capture, in the most simple way: store it as a wave onto your disk and read it byte per byte.

Angelo Fuchs
  • 9,825
  • 1
  • 35
  • 72
  • Your first link is dead, would you have another? – Jeel Shah May 11 '13 at 23:59
  • @gekkostate here you go: http://www.ebay.com/itm/Philips-FM1236-F-TV-Tuner-FM-Radio-Video-PCI-Capture-Card-/281097763240?pt=US_Video_Capture_TV_Tuner_Cards&hash=item4172bb79a8 I wrote the name into my answer so theres no link that could go stale anymore. – Angelo Fuchs May 12 '13 at 15:21
2

From the random.org website:

In late 2009, RANDOM.ORG underwent a major restructuring in response to the increasing number of clients and their need for good reliability and performance. There is now a distributed configuration in which a number of nodes in different geographic locations generate randomness, subject it to statistical tests and then stream the distilled random bits to a cloud hosting service from which the RANDOM.ORG services run. This new architecture has increased the reliability as well as the performance of the service and helps make RANDOM.ORG suitable for the serious applications (e.g., lottery drawings) that are now offered. Tried and true, the random numbers are still generated with atmospheric noise, but the hardware and software used today is a long way from the $10 receiver from Radio Shack that started it all back in 1997.

They don't have pictures of the nodes that measure atmospheric noise, but they do have pictures of the radio noise nodes.

Gilbert Le Blanc
  • 50,182
  • 6
  • 67
  • 111
1

Wikipedia has an interesting page titled Hardware random number generators. Check it out. Very well written and with useful links to various manufacturers. Some of their products are not cheap, though.

DaveShaw
  • 52,123
  • 16
  • 112
  • 141
Valentin
  • 11
  • 1