USB Random Number Generator
jayakody2000lk.blogspot.com
jayakody2000lk.blogspot.com
Also, usually HW RNGs include a firmware module that is constantly monitoring the entropy output and shutting off the generator in case of it sinking below a certain threshold to detect hardware failure and prevent it from causing predictable output.
Some more information on this subject can be found at Wikipedia: https://en.wikipedia.org/wiki/Hardware_random_number_generat... I do not want to discourage anybody from working on such things. I think this is a nice project idea and a very good opportunity to learn a lot about random numbers. Please, though, always put a big warning on any crypto things you designed youself and do not present them as a finished product.
[edit]s/such a/this/1[/edit]
This sentence reminded me of the recent revelation of some smartcards:
http://arstechnica.com/security/2013/09/fatal-crypto-flaw-in...
Afaik the failure was exactly that there was insufficient HW failure detection.
edit:
> Even worse, the firmware includes a line of code that ensures that the "RNG" never outputs the same "random" number twice in a row.
Also this reminds me of another anecdote. In math/stats class teacher told us of a experiment where two people were to write a 100 digit random sequence of 0s and 1s on a paper. One person was to use a coin flip, an the other was to just make the bits up. Then the person administering the experiment would take the sequences and guess which one was true random (coin flipped) and which one was human-generated. The trick being that humans tend to avoid repetition, and the one with (iirc) 6 consecutive 0s or 1s was most likely true random.
Designing a reliably fair and balanced RNG is not as easy a task as it may seem at first glance.
For those wanting a cheap HWRNG, a growing number of CPUs include them now. The SoC around which the rPi is based includes one that in my tests reliably pumps out 550+kbit/sec and passes the test I've thrown its output at - getting at it is easy so you just need a secure+reliable method for passing the bits to where you need them. Newer Intel chips also include a HWRNG, though I don't know if is as easy to expose (with the rPi just enable the relevant kernel module and read from /dev/hwrng).
[I did add notes on this to the "comparison of random number generators" page on Wikipedia but "User:Trinitresque" deemed the info not worthy and reverted the lot, I disagree of course but my day job and other commitments don't allow time for arguing the toss with Wikipedia editors!]
Yes. However, running your own entropy generator looks ok to me (which is then fed to a random number generator)
Unless your entropy generator is only generating "nothing" this shouldn't be a problem beyond possible attacks to reading of the data
Sure they do. I just read a paper how you could make a bias to this hwrng. I think it was even here on HN.
The end result should almost certainly be at least as secure as the default entropy sources of keyboard timing, hard drive read/write latency, etc. If you're using a lot of random numbers, then /dev/urandom would become far more secure, and /dev/random would become far faster, since the entropy pool wouldn't drain as quickly.
I'm not sure it's quite as bad as rolling your own crypto. If you have a RNG you can run it through statistical tests, e.g. NIST's DIEHARD tests. If you know the physical principles on which your device works, I can't imagine a scenario where you'd be getting randomly-distributed bits that aren't actually random. And if you add those bits to your system's entropy pool, rather than using them directly, then it should be fine. That said, I agree that you still shouldn't use it in a production environment!
Your suggestion for e.g. the RPi RNG is problematic because (last I checked) there wasn't information online about how that actually works. For RNGs, I'd much prefer trusting my own design than a black box which could be outputting an AES-encoded string of all 0s for all I know!
I wonder though. There's a possibility that you'll screw something up and miss it during testing, but I've also seen some scary analyses of expensive off the shelf RNG hardware.
I'd say that if you're in a position of highly restricted capital that requires generation of tons and tons of secure random numbers, the ugly truth is that an open source DIY solution for generating your own entropy (especially if you can use multiple designs that are separately tested) might be safer than dumping your limited resources on proprietary unknowns.
I'm not totally sure as to which algorithms fit this definition but some suggestions might be DSA/ECDSA, Diffie-Hellman, SRP, etc.
In this sense, rolling your own is a good start. It may not be a perfect implementation yet, this version may not even be secure but the fact that someone is making a start on an open source/open hardware version is commendable.
I hope this initiative pans out to something great!
did one of these in 1993, working with pxn when we were both at Fringeware. It turned out to be nearly impossible to eliminate a 60Hz signal without going to pure (D cell) battery power, and a metal chassis.
I'd expect there to be all sorts of harmonics on a USB device.
Spotting correlation and skew is interesting. Finding the right balance of speed and fidelity is tricky.
Here's some previous comment about Entropykey (https://news.ycombinator.com/item?id=1453299) and here's some stuff about testing and using hardware RNGs that I was reading a while ago (https://news.ycombinator.com/item?id=6060636)
http://emergent.unpythonic.net/01257868826
Too much for you? You can live with security by obscurity? Buy this thing:
With both systems you can just feed the noise into /dev/random You should make some tests from time to time to test reliability. Not sure you can use it with windows.
- If you have something that someone else wishes to use, you lend it to them.
- If someone else has something that you wish to use, you borrow it from them.
I don't know why this in particular has bothered me so much, it's just a small thing. Apologies for any offence, none intended.
Generally speaking, if we have 2 to 4 independent sources of random numbers (/dev/random, user input, external generator, something else), what's the best way to combine all of them in a single key to ensure that weakness in one of the? Is XOR enough? Using a cryptographic hash function is not acceptable because it may have a backdoor (so instead of multiple sources we get back to trusting only one).
That's a good point. It is common to use a transistor to measure temperature. One could control temperature of the 3904 with a peltier if needed.
silicon bandgap temperature sensor https://en.wikipedia.org/wiki/Silicon_bandgap_temperature_se...
http://www.sensorsmag.com/sensors/temperature/temperature-se...
1. a die (D6, D20, etc) enclosed in a clear dome with a base that will pop and cause it to fly into the air and land. The base would ideally be made to pop electronically, maybe by a servo
2. a camera directly overhead the die which feeds into a computing device
3. OCR software that receives the camera input and outputs the number on the die
I wonder how well it would last over time? Assuming a normal (not precision casino) die, bought off the shelf from a high street store - would you be able to see any pattern in 1 million rolls? Would deformation of the popping base affect randomness at all?
How about a webcam sampling "snow" from an untuned TV?
http://www.wired.com/politics/security/commentary/securityma...
Here's a bit of python code I wrote that could be adapted to do what you're asking for. It's designed to source random data from smartcards (via PKCS#11 libraries) at the moment but changing the data source to the output of another program would be trivial: https://github.com/infincia/TokenTools/blob/master/token-rng...
There are also a few mature projects designed to do this job (rngd and another one I cant remember the name of at the moment) that could also probably be made to work from arbitrary sources if they don't already, but if you wanted to do-it-yourself on the software side along with the hardware, that python up there would get you started.