The Raspberry Pi’s Hardware Random Number Generator
scruss.com
scruss.com
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.
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?
Let's say I don't think the NSA has backdoored all the mainstream fablines, but have reason to fear being individually targeted, and assume that the NSA has the power to coerce cooperation from Intel. In that case, would skepticism of post-purchase remote patching not be prudent?
So in each case, it seems, whatever trust you have in the initial transaction -- be it a SSL cert presentation, the particular SSL sessions based on it, or just the purchase of your hardware -- being malice-free, then in each case the pinning/PFS/lack of remote patching abilities guarantees the extension of this trust indefinitely, and prevents the other party from going back after the fact and screwing you, it locks the trust in, so to speak.)
(I realized after typing this that I actually have no idea what specifically remote chipset patching refers to or how it's performed, but I assume that it's what it sounds like.) :-/
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.
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.
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.
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)
> 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/...)
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.)
/* 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.[1] http://darrenyates.com.au/electronics/archives/40 [2] http://en.wikipedia.org/wiki/Shot_noise
How it works is basically undocumented although I hear the RPi engineers believe it uses some sort of thermal noise as the source for entropy.
Broadcom do have HWRNG patents though...
https://www.google.co.uk/patents/US6748495 https://www.google.co.uk/patents/US8229108
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.
(An ancient /. article, byte article it links to is dead: http://slashdot.org/story/00/10/27/126258/upgrade-your-penti...)
The idea that it's in any sense easy to "audit" the Raspberry Pi's hardware is head-explodey. No you can't.
This is pure back-rationalization. You like the Raspberry Pi. You don't like Intel Corporation. So you come up with a reason why the R-Pi's hardware RNG might be more trustworthy than than the hardware RNG in a modern Intel computer. It's a crazy reason, not least because the R-Pi's core is produced by another giant semiconductor company.
For this particular chip, you'd think they'd make an exception. But nooooooo.... Can't have those damned hackers actually knowing the register names, addresses and bit functions. That would be unthinkable.
http://csrc.nist.gov/publications/nistpubs/800-90A/SP800-90A...
[1] http://www.gnu.org/software/hurd/user/tlecarrour/rng-tools.h...
Discussion: http://www.ciphersbyritter.com/NEWS5/FMRNG.HTM
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) and he has some nice information here too: (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-p...)
(http://www.paulm.org/random.html)
(http://www.cryptography.com/public/pdf/IntelRNG.pdf)
Build one yourself: (http://www.labbookpages.co.uk/electronics/hwRNG.html)
Here's a list of devices:
(http://www.westphal-electronic.com/)
(http://www.trng98.se/shop/index.php)
(http://www.idquantique.com/random-number-generators/products...)
And someone upthread posted a link to EntropyKey.
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)
[1] http://web.archive.org/web/19971210213248/http://lavarand.sg...
http://www.fourmilab.ch/hotbits/
You could probably do it with the radioactive source in a smoke detector.
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://en.wikipedia.org/wiki/Special:Random, or the Twitter Firehose. :)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.
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.
Alternatively, you suggest a sole remote source over a public internet connection. Assuming an eavesdropper, the source could be compromised or the strength of the resulting cipher be reduced. Assuming a malicious entity with network control, you're pretty much screwed.
If you don't trust your hardware, you can't be working with encryption.
"General purposes" is exceedingly hard to quantify.
Is that not good enough? It's about as secure as your average desktop. You can't make a device more secure than the access to it, and there is no such thing as perfect security.
Sounds like a candidate for large scale experiment.