7 ms·
The Raspberry Pi’s Hardware Random Number Generator
- e3pi 13y agoDo hw rng's get a test suite certificate(NIST's?), like a Swiss watch, or like a optical sextant's `Certificate of Errors'? Tables of mean, standard deviation, etc, for expected physical dependent parameters(what: speed? temp? ...)?
- EvanKelly 13y agoHere are the NIST recommendations referenced in the FIPS 140-2 approved RNG appendix: http://csrc.nist.gov/publications/nistpubs/800-90A/SP800-90A.pdf http://csrc.nist.gov/publications/nistpubs/800-90A/SP800-90A...
- schrodingersCat 13y agoPerhaps this is a new application for the pi? A dedicated entropy appliance could be useful
- ChuckMcM 13y agoHeh, there was a company that offered just such a beast, basically a network socket and an API to fetch a random number. I thought it was a really subtle joke (like that time I carried around a Diet Coke as my Halloween costume) but once people connected the dots between "Ok, you care so much about a cryptographically secure random number generator you buy an appliance that does nothing else, and then you talk to it over the network..." As I was building IR beacons for mobile robots at the time, it led me to suggest an IR LED that was connected to a thermal emission source, then you could pick up random numbers by sampling the IR spectrum for a some period of time in your area. At least that way you don't know when the randomness was sampled (well not exactly), and your sniffer has to capture all radiated IR in all directions to ensure it has a complete history if it wants to back correlate it. Harder but still not as simple as just putting it in your machine. (which if you care enough you will do)
- jfb 13y agoSimilar in spirit to SGI's Lavarand [1] [1] http://web.archive.org/web/19971210213248/http://lavarand.sgi.com/ http://web.archive.org/web/19971210213248/http://lavarand.sg...
- justin66 13y agoAwesome. Thank you for sharing that.
- toomuchtodo 13y agoYou'd use radioactive decay: http://www.fourmilab.ch/hotbits/ http://www.fourmilab.ch/hotbits/ You could probably do it with the radioactive source in a smoke detector.
- daurnimator 13y agoCheck out http://www.entropykey.co.uk/ http://www.entropykey.co.uk/
- sneak 13y agoI have one of these, they work well and are relatively inexpensive. I am particularly impressed by the design.
- sswezey 13y agoFor random dice generation: http://gamesbyemail.com/News/DiceOMatic http://gamesbyemail.com/News/DiceOMatic
- moocowduckquack 13y agoIt might even replace the use of atomic vector plotters suspended in a nice hot cup of tea.
- trebor 13y agoIs there a way to seed /dev/urandom and /dev/random from it?
- moonboots 13y agoRng-tools [1], mentioned in the article, can use a hardware rng's output as input to the kernel's prng. However, it needs to be configured correctly to avoid potential problems [2]. [1] http://www.gnu.org/software/hurd/user/tlecarrour/rng-tools.html http://www.gnu.org/software/hurd/user/tlecarrour/rng-tools.h... [2] https://news.ycombinator.com/item?id=6040975 https://news.ycombinator.com/item?id=6040975
- codezero 13y agoWhat barriers keep thermal random number generators from being widely available? Or are they actually?
- schrodingersCat 13y agoThough I can't speak to they're adoption in actual hardware, thermal noise generators are apparently a common way to generate random numbers (https://en.wikipedia.org/wiki/Hardware_random_number_generator https://en.wikipedia.org/wiki/Hardware_random_number_generat...). I would be interested to hear details on how the pi's generator works.
- DanBC 13y agoSometimes they're not very good. Sometimes they're just very expensive. There are a range of different hardware devices available on various plugin boards. And processors have started to include them as well. Here's a very old (1997?) examination of 3 hardware devices: (http://www.robertnz.net/true_rng.html http://www.robertnz.net/true_rng.html) and he has some nice information here too: (http://www.robertnz.net/hwrng.htm http://www.robertnz.net/hwrng.htm) Here's my list of recent reading, not all of it relevant. (http://csrc.nist.gov/groups/ST/toolkit/rng/documents/nissc-paper.pdf http://csrc.nist.gov/groups/ST/toolkit/rng/documents/nissc-p...) (http://www.paulm.org/random.html http://www.paulm.org/random.html) (http://www.cryptography.com/public/pdf/IntelRNG.pdf http://www.cryptography.com/public/pdf/IntelRNG.pdf) Build one yourself: (http://www.labbookpages.co.uk/electronics/hwRNG.html http://www.labbookpages.co.uk/electronics/hwRNG.html) Here's a list of devices: (http://www.westphal-electronic.com/ http://www.westphal-electronic.com/) (http://www.trng98.se/shop/index.php http://www.trng98.se/shop/index.php) (http://www.comscire.com/ http://www.comscire.com/) (http://www.idquantique.com/random-number-generators/products... http://www.idquantique.com/random-number-generators/products...) (http://www.letech.jpn.com/ http://www.letech.jpn.com/) And someone upthread posted a link to EntropyKey.
- codezero 13y agoThanks, very helpful.
- steve918 13y agoA good number of Intel processors have hardware rngs. http://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide http://software.intel.com/en-us/articles/intel-digital-rando... Of course they're not on $35 boards, but the server machines you are using may already have this.
- shawnz 13y agoIntel's RDRAND is mentioned in the article as well, near the end. I suspect this article is doing so well because of the recent realization of Intel's involvement with the NSA, and the high potential for backdoors to be included in such a technology.
- mahyarm 13y agoBroadcom is a similarly huge USA company in ARM computers & networking, are we sure they haven't been involved with the NSA either?
- PeterisP 13y agoWe can't be sure, but it should be much easier to audit a small system like Pi, rather than an Intel processor that, above all, can be remotely patched.
- btian 13y agoIntel processor can be remotely patched?! Then why did Intel spend $475m to fix the FDIV bug?
- ethomson 13y agoI'm going to go out on a limb and suggest that the FDIV bug - or heck, even the much more recent (1997!) F00F bug - might not be so contemporary or represent the state of the art of Intel processors.
- 13y ago
- PeterisP 13y agoIt may well be that small hardware could be better for generating keys, as it is much easier to audit the total system, and I'd trust it more than an Intel processor with known remote patching capabilities. If you're security-sensitive then it could be good having a small, dedicated system like the Pi, and make sure that your private key never leaves it.
- tptacek 13y agoIf you don't trust a chip vendor's remote patching, there's nothing you can trust on the chip cryptographically at all.
- ippisl 13y agoAre there any possible realistic solutions to the trusted hardware issue?
- girvo 13y agoDesign and build it yourself?
- ooorlllyyy 13y agoWait a second, wouldn't this statement imply that things like cert-pinning and PFS are completely useless? Does skepticism of remote patching while trust of the original chip not protect you against being specially targeted if you assume that the chips aren't being wholesale manufactured with back doors built in?
- tptacek 13y agoYes, if you think the NSA has backdoored all mainstream Intel chips, then certificate pinning and forward secrecy are not particularly meaningful.
- ooorlllyyy 13y ago
- Osmium 13y agoDoes anyone have a link for a spec for the RNG? Specifically, where does it get its entropy from? Couldn't find it in the source link. Only mention I could find is a vague mention of "thermal noise" which could mean anything.
- DanBC 13y agoI found the link on Reddit. They're asking similar questions. So far Reddit hasn't got any answers; someone posted a link to a mailing list. Here's a similar link. (https://lkml.org/lkml/2013/3/24/144 https://lkml.org/lkml/2013/3/24/144) > This adds a driver for random number generator present on Broadcom BCM2835 SoC, used in Raspberry Pi and Roku 2 devices. Here's a github for the blob source (https://github.com/raspberrypi/linux/blob/rpi-3.6.y/drivers/char/hw_random/bcm2708-rng.c https://github.com/raspberrypi/linux/blob/rpi-3.6.y/drivers/...) It's a frustrating lack of information. :-/ (I posted here partly because of the Intel RdRand stuff the other day, but also RPis are fun and this could be a fun experiment.)
- zepolud 13y agoThe only use for a binary blob that purports to a be a secure RNG is to feed it to /dev/random.
- jevinskie 13y agoIt isn't a binary blob, it is a blob of hardware gates. The RNG is interfaced with simple MMIO and just four memory mapped registers.
- Scaevolus 13y agoSome of these comments are particularly worrying: /* double speed, less random mode */ #define RNG_RBG2X 0x2 /* the initial numbers generated are "less random" so will be discarded */ #define RNG_WARMUP_COUNT 0x40000 A black box random number generator with some numbers being vaguely "less random"? That seems like an exceedingly poor idea.
- hamburglar 13y agoThe article is a bit vague about what exactly they're trying to say. What was unexpected? I read it three times before I decided they're comparing a lousy homegrown software RNG to the Pi's hardware RNG, which turns out to be good. Yes? Why would that be unexpected?
- wodenokoto 13y agoThe way I read it was that it is surprising that it is there at all. Apparently a lot of android devices don't have one, and don't have time to collect pseudo random data for their software rng to make secure certificates when you boot it for the first time, which posses a security risk for android devices. That's how I read the article in relation to recent news.
- steevdave 13y agoActually most ARM processors do have a hardware RNG, just that few companies write a driver for them
- lambda 13y agoThe impression I got was that the existence of a hardware random number generator was unexpected. The rest was just demonstrating that it works, and produces pretty reliable random output. In order to do that, they used a standard tool that tests randomness. But it's nice to make sure your randomness test tool is actually good; so using it on a known-bad RNG, and seeing that it does fail, is a good way to demonstrate that.
- Dylan16807 13y agoEspecially confusing is when the article suddenly says "This is not random". But oh what it means is that the upcoming part of the article, on a completely different topic from the Pi, is not random.
- scruss 13y agoI wrote the article. I'm guessing not everyone on HN is a huge fan of “Strictly Ballroom”, as the title is a key quote for dance movie otaku. It was also a weak joke about testing for random numbers; I'm imagining a little subroutine in a constant state of surprise when it encounters the next random number. While I'm not sure if I implemented it correctly, RANDU isn't some ‘lousy homegrown software RNG’. It was the standard RNG for IBM mainframes in the late 1960s.
- cpeterso 13y agoHere is my proposed RNG for network devices that don't generate much entropy of their own: strace -Tiv -ttt nice curl -Lv --raw $URL 2>&1 | shasum | dd bs=1 count=2 2>/dev/null Possible values of $URL might be https://news.google.com https://news.google.com, https://en.wikipedia.org/wiki/Special:Random https://en.wikipedia.org/wiki/Special:Random, or the Twitter Firehose. :)
- wodenokoto 13y agoIf you are connected to the internet, why not get your randomness from http://www.random.org/ http://www.random.org/ ?
- marshray 13y agoThis thread is a joke, right?
- Dylan16807 13y agoWhat's a joke? There is nothing ridiculous about using network timing as random, that's how /dev/random already works. There is nothing ridiculous about using random.org, though that should be https.
- nwh 13y ago> There is nothing ridiculous about using random.org, though that should be https. Everything is wrong about this. • You can not trust SSL to protect your source of entropy. • You can not trust an external, unverified source of entropy.
- Dylan16807 13y agoPretend for a moment that you have isolated hardware with no trusted random sources. And this hardware already depends on large secret binary blobs to run at all. At this point trust is already hard, and random.org is a hell of a lot better than nothing. If you mix network jitter with external randomness sources that's just about the best possible job you can do. Neither half is perfect but they help.
- TerraHertz 13y agoWhat I found unexpected about the Raspberry Pi, was that the CPU chip is closed - very little data available on what's in it. Suddenly 'discovered' hardware RNG being a case in point.
- technimad 13y agoThat's why I use the BeagleBoard.
- TerraHertz 13y agoSo OK, the Pi has a thermal RNG. Next question - does this: http://www.damninteresting.com/random-event-generators-predict-the-future/ http://www.damninteresting.com/random-event-generators-predi... (and google for related articles) supposedly only happen for some types of hardware RNGs? Nuclear decay based RNGs? Or all types - thermal, semiconductor shot noise, wind-chimes or whatever? Sounds like a candidate for large scale experiment.
- teeja 13y agoFor those looking for something a little less than formal perfection (whatever that really is), FM receivers can be a useful source of rands. Discussion: http://www.ciphersbyritter.com/NEWS5/FMRNG.HTM http://www.ciphersbyritter.com/NEWS5/FMRNG.HTM