Live data from Hacker News

How secure is Linux's random number generator?

lists.randombit.net

51–60 of 100 posts

Re: How secure is Linux's random number generator?

#51
post #40

Earlier quoted context omitted.

[deleted]

my understanding (and i'm not an expert - just trying to help with the discussion) is that getting sufficient entropy is quite hard. i vaguely remember at least one issue, perhaps on startup, where there was insufficient entropy to do something, and so people switched to some other less random source and screwed everything. so if this reports unlimited (or at least, larger than anything else) entropy then there are l…

[deleted]

Re: How secure is Linux's random number generator?

#52
post #51

Earlier quoted context omitted.

my understanding (and i'm not an expert - just trying to help with the discussion) is that getting sufficient entropy is quite hard. i vaguely remember at least one issue, perhaps on startup, where there was insufficient entropy to do something, and so people switched to some other less random source and screwed everything. so if this reports unlimited (or at least, larger than anything else) entropy then there are l…

[deleted]

i'm sorry, this is just incoherent to me. i have no idea what you're trying to say, or how it fits with my comment.

i was trying to explain why an untrusted hardware rng cannot be improved in some cases (because of limited entropy from elsewhere). and i don't see how what you are saying addresses that.

Re: How secure is Linux's random number generator?

#53

Further down the thread: > Not to mention, Intel have been in bed with the NSA for the longest time. > Secret areas on the chip, pop instructions, microcode and all that ... What does "pop instructions" refer to here?

AIUI the story goes like this: for a long time NSA required all CPU vendors to provide a "popcount" instruction (to count the number of one bits in a register) for any hardware contract. NSA was buying a lot of Intel processors, but Intel CPUs lacked a documented popcount instruction until very recently. So, there was speculation that an undocumented opcode would function as a popcount instruction in older Intel CPUs (perhaps after modifying the CPU microcode), and from there people speculate that there may be other undocumented instructions and CPU features. Or so the story goes.

Re: How secure is Linux's random number generator?

#54
post #37
post #2

And here is the mailing list thread that the author refers to: https://lkml.org/lkml/2011/7/29/366

There was a lot more follow-up later, see e.g. https://lkml.org/lkml/2012/7/5/422 The important commit here is: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.g... Excerpted: Change get_random_bytes() to not use the HW RNG, even if it is avaiable. The reason for this is that the hw random number generator is fast (if it is present), but it requires that we trust the hardware manufacturer to have not put i…

[deleted]

Re: How secure is Linux's random number generator?

#56
post #10

Earlier quoted context omitted.

You are right that closed source doesn't mean its insecure - on the other hand, open source could prove that it is indeed secure. With new scandals coming up every week these days, about hidden backdoors in security software, I trust open source more than ever before.

Open source would not prove it is secure. At best, you could look for obvious attacks. Cryptography is hard.

No, at best you could have a large, diverse group of experts look for potential flaws and fix them. But, I agree being open source is not enough, you need to be open source, and the one implementation that everyone contributes to.

Re: How secure is Linux's random number generator?

#57
post #47

https://lkml.org/lkml/2011/7/31/139 Since there was a minor amount of confusion I want to clarify: RDRAND architecturally has weaker security guarantees than the documented interface for /dev/random, so we can't just replace all users of extract_entropy() with RDRAND. I still don't get it.

In NIST parlance (SP800-90{A,B,C}), RDRAND is a DRBG, while /dev/random should be a NRBG. For what it's worth, the RDSEED instruction has been announced by Intel a while back (but not yet on current processors), which means to be an NRBG as well.

RDRAND does have non-determinism. The problem is that you can't directly measure or monitor how much non-determinism. The values you get from RDRAND come from a DRBG that is periodically and automatically re-seeded from a NRBG, but if you call RDRAND many times in rapid succession, then the DRBG may not have been re-seeded between each invocation. RDSEED differs only in that it guarantees that the DRBG is re-seeded between invocations. If you are using the instructions infrequently enough, then the two are functionally identical, but "infrequently enough" has a value known only to Intel.

Re: How secure is Linux's random number generator?

#58
post #42

https://lkml.org/lkml/2011/7/31/139 Since there was a minor amount of confusion I want to clarify: RDRAND architecturally has weaker security guarantees than the documented interface for /dev/random, so we can't just replace all users of extract_entropy() with RDRAND. I still don't get it.

What don't you get? RDRAND is an interface to a non-blocking PRNG backed by a HWRNG. You can't directly get the output of the HWRNG. Intel uses the PRNG to condition the output of the HWRNG, but it will still give you numbers if the HWRNG is having trouble (HWRNG errors can be detected, but the RDRAND instruction itself doesn't trap on HWRNG failures). If you trust Intel's PRNG sufficiently, then you can use RDRAND d…

It's documented to have the potential to not return random data, so in that sense it's blocking like Linux' /dev/random. Sample code shows some type of polling loop IIRC.

Re: How secure is Linux's random number generator?

#59

this is my favourite conspiracy theory that the CPUs are backdoored. just assign a bunch of registers with some special values and execute a specific instruction and the CPU will drop all memory protection. take something like google's NACL or a javascript JIT where you have enough control over the registers and you have a permanent browser exploit.

The best backdoors are indistinguishable from dumb bugs when they're discovered.

They'd looks something like Debian's OpenSSL. But I believe that was not an intentional backdoor.

Re: How secure is Linux's random number generator?

#60
post #42

https://lkml.org/lkml/2011/7/31/139 Since there was a minor amount of confusion I want to clarify: RDRAND architecturally has weaker security guarantees than the documented interface for /dev/random, so we can't just replace all users of extract_entropy() with RDRAND. I still don't get it.

What don't you get? RDRAND is an interface to a non-blocking PRNG backed by a HWRNG. You can't directly get the output of the HWRNG. Intel uses the PRNG to condition the output of the HWRNG, but it will still give you numbers if the HWRNG is having trouble (HWRNG errors can be detected, but the RDRAND instruction itself doesn't trap on HWRNG failures). If you trust Intel's PRNG sufficiently, then you can use RDRAND d…

The RDRAND circuits perform continual health checks and will signal a error instead of outputting bad data. See section 3.3 of http://software.intel.com/en-us/articles/intel-digital-rando...
Post reply on HN