Random number generation is a frequent topic of discussion in projects that involve encryption and security. Intel has just announced a new feature coming to many of their processors that affect random number generation.
The random number generator, which they call Bull Mountain, marks a departure from Intel’s traditional method of generating random number seeds from analog hardware. Bull Mountain relies on all-digital hardware, pitting two inverters against each other and letting thermal noise tip the hand in one direction or the other. The system is monitored at several steps along the way, tuning the hardware to ensure that the random digits are not falling more frequently in one direction or the other. Pairs of 256-bit sequences are then run through a mathematical process to further offset the chance of predictability, before they are then used as a pseudorandom number seed. Why go though all of this? Transitioning to an all-digital process makes it easier and cheaper to reduce the size of microchips.
A new instruction has been added to access this hardware module: RdRand. If it works as promised, this should remove the need for elaborate external hardware as a random number source.
[littlebird] posted a tutorial on making electronic dice. He’s using an ATmega328 for the numbers work, and a mercury switch to activate it all. A nice blue enclosure to match the blue LEDs he’s using for the number display wraps it up nicely. Of course, someone had to mention that this was an amazing amount of over kill and it could just be done with a 555 timer like they used to do “back in the day”. [littlebird] responded with another tutorial to prove that he hadn’t forgotten how to work with the basics. He goes on to point out, now that we see both in action, that he can expand his microcontroller based one quickly with a few lines of code, where every new feature added to the 555 timer version would require additional components.
You can catch videos of both after the break.
Continue reading “Electronic dice, overkill and simplified”
True randomness can be hard to come by in the digital world. [Andy Green] is making it easier to get true entropy by using this random USB dongle. The Whirlygig uses a CPDL to gather data from a set of of oscillators. The oscillators have a constantly fluctuating frequency due to temperature changes; if they run faster they generate more heat which in turn slows them down. This, along with the variable latency associated with polling a USB device, gives great depth of randomness. The device is detected and mounted under ‘/dev/hw_random’ and can then be fed into ‘/dev/random’ using the rng-tools package. [Andy’s] done a lot of testing, both on the hardware, and on the quality of randomness. We didn’t see an option to order this but he’s got hardware and firmware repositories so that you can throw one together yourself.
[Peter] thought of a creative, way to generate random entropy for under $100.
The USB Hourglass combines a sand timer with a rotating mechanism and an optical beam through the center of the timer to observe the falling sand. The amount of light reaching a detector is digitized at frequent intervals and processed by a microcontroller to determine when to rotate the hourglass. The digitized light levels are also sent by USB to a host PC where they can be used as a source of random entropy. Power is supplied over the USB cable.
With the USB Hourglass, the user can look at the sand falling through the center of the hourglass and monitor the randomness in the USB output data. And one can read the code line-by-line, compile it, and upload it to the microcontroller using only open-source and widely supported tools.
[MS3FGX] has done an interesting study about using Bluetooth adapters as a source for Pseudorandom Number Generation (PRNG). As it turns out, the Bluez package has a function that calls a remote Bluetooth adapter to return a random number. He picked up 10 compatible adapters for about $30 from DealExtreme and set about assembling some numbers to see how this compares to an OS-based PRNG.
Because millions of samples are needed for an accurate comparison, time became a problem. The adapters are a little bit slow responding to a request, sending just 4800 numbers in the first 30-second test. This can be overcome with multiple adapters being accessed by multiple computers for hours at a time. What can this be used for? Your guess is as good as ours, but [MS3FGX] has done a great job of writing up his tests. He’s also made a set of 20.7 million randomly generated values available if you want to generate your own statistical analysis.
[Scott] runs gamesbyemail.com. One of his biggest hurdles was producing real random numbers for the games. He had tried various methods like math.random and random.org, but kept getting complaints about the quality of the random numbers. His solution was to build an automatic dice roller. His initial attempts were made from Legos and were never quite reliable enough to be put into the system. The Dice-O-Matic however has proven to be a random number generating monster. It is 7 feet tall and capable of 1.3 million dice rolls per day. Wow.
[aballen] wanted to light the jack-o’-lantern this year with something that didn’t actually require fire. After searching for a project that was cheap and yielded decent results, he ended up just making his own. This project utilizes an ATtiny13 and two LEDs, red and orange. The overall build is quick and simple with some very basic code for the flickering. If you really want it more enclosed, there is this similar project using a cheap electric candle. Of course, not everyone has the time or desire to make one that is this realistic. You could always just go the easy way, no microcontroller required.
Why limit it to just lighting up your pumpkin though? Lets take a stroll through Evil Mad Scientist Laboratories hallways and see the Snap O Lantern or the dark detecting pumpkin and the Cyclonolantern.