Linux RNG May Be Insecure After All
Okian Warrior writes "As a followup to Linus's opinion about people skeptical of the Linux random number generator, a new paper analyzes the robustness of /dev/urandom and /dev/random . From the paper: 'From a practical side, we also give a precise assessment of the security of the two Linux PRNGs, /dev/random and /dev/urandom. In particular, we show several attacks proving that these PRNGs are not robust according to our definition, and do not accumulate entropy properly. These attacks are due to the vulnerabilities of the entropy estimator and the internal mixing function of the Linux PRNGs. These attacks against the Linux PRNG show that it does not satisfy the "robustness" notion of security, but it remains unclear if these attacks lead to actual exploitable vulnerabilities in practice.'"
Of course, you might not even be able to trust hardware RNGs. Rather than simply proving that the Linux PRNGs are not robust thanks to their run-time entropy estimator, the authors provide a new property for proving the robustness of the entropy accumulation stage of a PRNG, and offer an alternative PRNG model and proof that is both robust and more efficient than the current Linux PRNGs.
Linus always says Linux is perfect. Linus can be wrong.
http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/00000/2000/300/2318/2318.strip.gif
.....wait! it's not what you think.
"a new paper analyzes the robustness of /dev/urandom and /dev/urandom."
So now we're putting the dupes together into the same summary? Jeez, can't we at least wait a few hours first?
At what scope/scale of time or range of values does it really matter if a PRNG is robust?
A PRNG seeded by a computer's interrupt count, process activity, and sampled I/O traffic (such as audio input, fan speed sensors, keyboard/mouse input, which I believe is a common seeding method) is determined to be sufficiently robust if only polled once a second, or for only 8 bits of resolution, exactly how much less robust does it get if you poll the PRNG say, 1 million times per second, or in a tight loop? Does it get more or less robust when the PRNG is asked for a larger or smaller bit field?
Unless I'm mistaken, the point is moot when the only cost of having a sufficiently robust PRNG is to wait for more entropy to be provided by its seeds or to use a larger modulus for its output, both rather trivial in the practical world of computing.
"....robustness of /dev/urandom and /dev/urandom"
i will fight to the death any one who says /dev/urandom is less/more robust than /dev/urandom
"As a followup to Linus's opinion people skeptical of the Linux random number generator, a new paper analyzes the robustness of /dev/urandom and /dev/urandom .
I just checked /dev/urandom and /dev/urandom. The bitstreams are identical! Damn you, NSA!
The output of a software RNG, aka PRNG (pseudo random number generator), is completely determined by a seed. In other words, to a computer (or an attacker), what looks like a random sequence of numbers is no more random than, let's say,
(2002, 2004, 2006, 2008, 2010, 2012...)
However, the PRNG sequence is often sufficiently hashed up for many applications such as Monte Carlo simulations.
When it comes to secure applications such as cryptography and Internet gambling, things are different. Now a single SRNG sequence is pathetically vulnerable and one needs to combine multiple SRNG sequences, using seeds that are somehow independently produced, to provide a combined stream that hopefully has acceptable security. But using COTS PC or phone doesn't allow developers to create an arbitary stream of independent RNG seeds, so various latency tricks are used. In general, these tricks can be defeated by sufficient research, so often a secure service relies partly on "security through obscurity", i.e. not revealing the precise techniques for generating the seeds.
This is hardly news. For real security you need specialized hardware devices.
"a new paper analyzes the robustness of /dev/urandom and /dev/urandom"
cool, they really should make random numbers redundant
next, we should make Slashdot moderators redundant.
and then, Slashdot articles redundant.
yay!
It'z teh Linux!!!!!1111oneoneoneeleventyone!!!!!
So, with all the 'revelations' and discussion surrounding this and encryption over the past several weeks, I've been wondering if a local hardware based entropy solution could be developed. By 'solution', I mean an actual piece of hardware that takes various static noise from your immediate area, ranging from 0-40+kHz( or into MHz or greater?), both internal and external to case, and with that noise builds a pool for what we use as /dev/random and /dev/urandom. Perhaps each user would decide what frequencies to use, with varying degrees of percentage to the pool, etc.. etc...
It just seems that with so much 'noise' going on around us in our everyday environments, that we have an oppurtunity to use some of that as an entropy source. Is anyone doing this, cause it seems like a fairly obvious implementation.
These guys had the time, brains and resources available to do a full breakdown of how /dev/random might not be so random.... why not go all the way, submit a patch and fix it?
I want to delete my account but Slashdot doesn't allow it.
From a practical side, we also give a precise assessment of the security of the two Linux PRNGs, /dev/random and /dev/urandom
The internet must have finally run out of porn.
I swear, if I worked for the NSA I'd be pushing out headlines like this to make people ignore real security issues...
The article is a highly academic piece that analyzes the security of the linux rng against a bizarre and probably pointless criteria: What is an attacker's ability to predict the future output of the RNG assuming he knows the entire state of your memory at arbitrary attacker selected points in time and can add inputs to the RNG. Their analysis that the linux rng is insecure under this (rather contrived) model rests on an _incorrect_ assumption that Linux stops adding to the entropy pool when the estimator concludes that the entropy pool is full. Instead they offer the laughable suggestion of using AES in counter mode as a "provably secure" alternative.
(presumably they couldn't get a paper published that said "don't stop adding entropy just because you think the pool is at maximum entropy", either because it was too obviously good a solution or because their reviewers might have noticed that Linux already did that)
zener diodes biased into avalanche mode to generate random noise? I don't think even the NSA has figured out how to hack laws of thermodynamics.
That's not quite the point.
The two random devices are there not to be alternate sources of randomness, but to be a good source of provably random numbers gained from hardware randomness mixed into the entropy pool, and another source of cryptographically random numbers seeded from the first - but with perhaps orders of magnitude less entropy per output bit compared to input bits.
The first source will stop outputting when it runs low on entropy.
/dev/random and /dev/urandom are simply devices that are supposed to return a cryptographically secure continuously-reseeded pseudorandom number stream. /dev/random blocks when the entropy pool is depleted and /dev/urandom continues to produce a pseudorandom pad using the same underlying secure hash algorithm. There are, and have always been, "problems" with how the entropy remaining in /dev/random's pool is calculated insofar that it's the subjective call of whatever entropy provider is restocking the pool. Anyone who cares about that is using dedicated hardware random number generators. Everybody else uses /dev/urandom. The people who use /dev/random are usually those who don't realize that the only difference between it and /dev/urandom is that it blocks.
It's a waste of time to focus on quantifying the entropy metric that /dev/random uses to decide when it's time to block and wait for more entropy. The security of /dev/random and /dev/urandom come from the hash being used to munge the entropy. Various hashes have been and are being used, including SHA-1 and, god forbid, the NSA's favorite, Dual EC DBRG. That's where the weakness in /dev/random / /dev/urandom springs from, not any of that theoretical shit.
If you want to know whether or not your application is getting exploitable correlation-possible randomness from /dev/urandom, examine your kernel's drivers/char/random.c and see which hash it's using.
If the Linux one has questionable randomness then what does that say of the PRNGs in other operating systems, be they open or otherwise?
This is my contention: encryption on the Internet isn't necessarily weak because of the algorithms but because of key selection.
Thus even if we have AES256, maybe the real strength is AES100 or less.
He "confirmed" he'd been asked to backdoor linux, he never confirmed whether or not he agreed... :)
Can anyone provide a link to a site that reviewed the source code and vetted the security of all RNGs?
Time is what keeps everything from happening all at once.
It isn't hard and works best when used to continuously reseed the kernel's entropy pool.
https://www.binarymagi.com/drupal/node/18
Linus signs off on many changes everyday. He does expect you to read the code before trying to change it. That was the problem before - someone put up a change.org petition that made clear they had no idea how it worked.
And if you'd have only guessed "first," like everybody else, you'd have a 5 instead of a 0.
The sequence "1 2 3 4 5 6 7 8 ..." belongs to the set of randomly generated numbers. But there are so many fools out there who would exclude such a sequence from that set. Which would then make that resulting set of random numbers biased.
Haven't these people got anything better to do with their time?
If the CPRNG state is not compromised, the Linux random generators are secure. In fact the property required for robustness is quite strong: Recovery from compromise even if entropy is only added slowly. For example, the OpenSSL generator also does not fulfill the property. Fortuna does, as it is explicitly designed for this scenario.
I also have to say that the paper is not well-written as the authors seem to believe the more complicated formalism used the better. This may also explain why there is no analysis of the practical impact: The authors seem to not understand what "practical" means and why it is important.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Only a fool believes in perfect security.
Yes, there are apparently laws that approximate how it would work, however to know the outputs one would need to have information about all the energy field states that make up the device's matter (and dark matter) at a given plank time.
In the past when I've needed a random number generator I've used a single infrared LED and IR Diode connected to a serial port. Poll the difference between the time it takes a photon to build up, be emitted, and detected multiple times and use the lowest bits as the random values. It's a lot slower, but it's basically the same principal -- Using the quantum uncertainty principal by observing quantum phenomena to generate randomness. In a real pinch, I just have the user move their mouse around like a loon...
Even if we had perfect equations to predict physical phenomena (we do not), we'd still need to know the initial state of the Universe and have 13.7 billion years of clock time (running as fast as absolutely possible) in a separate isolated universe to predict the random numbers with certainty... Any transfer of information between the isolated universe and our own would screw up the future calculations of randomness, due to the cascade of information entanglement.
Predicting the random numbers would be like trying to figure out what hash to include within this message right here [cf372106a91cd957d5a1046b57534485ddbdd4c0] so that when the message is hashed the the result would match that prior value. You could run the hash, insert it, but that would change the message's hash -- True, you could brute force the hash, but the message is entire Universe.
Let's see, we'll try everything before this paragraph using all zeros first, and see if that's the matching hash... nope. So, we'll insert the value we just got and hash it again: [211c7d73a0c66355921ef0dfb99019a2cce71754]? Nope... this could take a while, maybe we should start counting up from 0000000000000000000000000000000000000000 towards ffffffffffffffffffffffffffffffffffffffff to keep track. This is a SHA-1 hash, so it'll take 2^159 iterations on average, (or about 730,750,820,000,000,000,000,000,000,000,000,000,000,000,000,000 tries). You feeling lucky? Further, we could run through all the combinations and never get the message to be self hashing since the answer for above might not be in ASCII hex, or it might not exist in this message's problem space -- i.e., No solution may exist for the above universe. In other words: Our tool / assumption about the universe's laws / our representation of reality might not accurately reflect the true reality that the hash (or diodes) operate within, or our assumption that the problem is solvable may be wrong... So, you see, it's not perfectly random, but since we can't simulate the entire universe within itself, thermodynamics and quantum effects are random enough for our purposes -- Otherwise all lotteries could be considered rigged.
Quick, someone validate RNG's usefulness before its feeling of self-worth is affected! I would, but I don't care.
has some thoughts on the study and the subject:
https://www.schneier.com/blog/archives/2013/10/insecurities_in.html
I think the only question on my mind is what exactly is deemed insecure for? Generating public/private key pairs? Doing encryption for SSL/TLS?
I've been around computers for a good number of years and I know no computer can be truly random, but isn't there a point where we say, "It's random enough."? Is this OP saying.. Linux's RNG isn't "Random Enough." and my question is.. what isn't it random enough for?
http://www.issihosts.com/haveged/
wget http://www.slashdot.org/ | sha512sum
You are being MICROattacked, from various angles, in a SOFT manner.
It's good you posted this, because it just shows how desperate and ridiculous you are as a person that you'd rather cling on to this sensationalist news article rather then do any research into the topic.
Now everyone knows who to ignore in the future.
Linus never said that the Linux RNG is perfect. He leashed out against a person who wanted to remove the rdrand instruction, without understanding that the rdrand instruction doesn't add to the entropy estimate. And he was completely right (even though mocking stupid people is not good style).
This paper is about "vulnerabilities of the entropy estimator" so it is no related to the rdrand thing, because the latter does not contribute to the entropy estimate.
So why did the poster and the editors have to make the connection? There is only two sad answers:
1) They are trolling - and if you read they are unfortunately successfully
2) They are idiots and do not know what they are talking about
Slashdot is becoming the Fox news of the tech-world. :(
I'm having a security panic over here!
as a quick fix I deleted /dev/random and did ln -s /dev/zero /dev/random
Half way down in the comments.
about how they should just shut up because they're not programmers and just understand that they don't know how to write the Linux kernel as well as he does...
Just sample a few kb from the integrated microphone (given that there arent't too many zeros in sequence). It's enough for beating even the mighty NSA.
And have some RNG servers on the internet. There is bound to be a few that are trustworthy.
Linus is waiting.
Plan 9 is much, much better designed than unix, we just need to port our software
I do concur with you, PLAN 9 was indeed a much better designed OS, from the ground up, but, as all the techies who have been in the tech field already know ...
better product does not always become the guaranteed winner in the marketplace
Muchas Gracias, Señor Edward Snowden !
Even if you had perfect measurements and knowledge of the configuration of a system, quantum mechanics has systems that will be probabilistic and random. QM is not about lack of details or making approximations, it posits that natural is inherently probabilistic and not deterministic in certain ways. More details would not help in a system properly setup to utilize those random processes, only QM being wrong. While that is always a possibility, it takes more than people saying they don't like its probabilistic nature to demonstrate that it is not an accurate description of reality.
Huh? Why the hell is this not at -2 (troll, incorrect/FUD/st0n3d) ? /dev/random is defined to be at least as good (crypto/random-wise) as /dev/urandom in Linux, the BSDs, and all their derivates. It is also like that in AIX and Solaris, therefore in everything that matters. Heck, on FreeBSD, /dev/random and /dev/urandom are exactly the same...
I think it is past time for CPUs to provide hardware random numbers. Via CPUs have done this for years, but Via CPUs are just too slow for most uses. (I used to run my mail server on a Via C3... I am a lot happier now that my server runs on an AMD low-power dual-core.)
Recent Intel chips do have some sort of random number generator (RdRand).
Hardware RNG accessories are available but expensive.
There is the LavaRnd project, which I think is really darn cool. However, I downloaded the source code, and it hasn't been updated since 2003... a decade later, GCC won't even compile the code. (GCC now issues warnings about some of the code and they set the "treat warnings as errors" flag. I didn't experiment with disabling that flag and trying the code out.) Also, the supported hardware list is a short list of decade-old webcams.
(Note: this would be a good project for a high school student or college student who knows C: update LavaRnd so it builds with GCC or Clang, get it working with at least one currently-available webcam, and write a report about it.)
The Raspberry Pi has a hardware RNG as part of the system-on-a-chip, and Linux on the Pi supports it. You could set one up as a randomness server to your VMs, and that would be quite inexpensive. At least the VMs could reseed their PRNGs with random values pulled from the Pi.
http://vk5tu.livejournal.com/43059.html
If you have a sound device, Audio Entropy Daemon may work.
http://www.vanheusden.com/aed/
P.S. Haveged looks interesting... I just discovered it and I don't know how well it actually works.
https://www.digitalocean.com/community/articles/how-to-setup-additional-entropy-for-cloud-servers-using-haveged
lf(1): it's like ls(1) but sorts filenames by extension, tersely
To be fair, it is "Offtopic" [sic], however, it IS the 2nd post, and I knew it would be, so why would I have "guessed" first post?
I am also the same guy who won a bet that I could link to my own post in my sig... but I didn't collect because I wouldn't give my PayPal info to some random Slashdot user.
This issue is a bit more complicated than you think.
You don't have to give "paypal info" you only have to give an email address; you can just add a throw-away address to your paypal account, and then delete it right after the payment. If there is even something to worry about there. It doesn't have to be the primary address that can be used to gain access to the account.
But you can't trust a single CPU hardware random number generator.
It could pretty well be a simple 128bit counter, encrypted using a good cypher and a password known to an attacker.
(If its a good cypher, the output *will* look like random noise and the cypher should be *next-bit-attack* resistant, so without the password, no way to know that each block is logically following the other).
That's the debate with Linus mentionned in the summary: You could be the guy who actually designs hardware random number generators, you know you design is a good one, you've checked the hardware implementation and you've controlled the mask that was sent to foundry.
Still, unless you own an electronic microscope, there's no way for you to know that a given CPU actually has your design in it, or if at the lest minute a part of the mask was swapped and replaced with the "counter-with-known-password" by the local NSA insider.
You can use the hardware generator as *A* random source, to be mixed with all other sources, in order to produce a finally random result which is a composite of all source (XOR the sources together, then run it through a secure hashfunction or cryptofunction to remove any bias).
But you can't relly on it as the *ONLY SOURCE* of randomness.
At least the VMs could reseed their PRNGs with random values pulled from the Pi.
Thus the VMs should not *RESEED* with value pulled from the Pi. The VMs should use the Pi as one of the several source of entropy mixed to produce random numbers.
"Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
Yes, Diehard can't tell you if a random number stream is good enough for cryptographic use. But if it tells you that the stream is not good, then it's not good enough for crypto.
Also, while you should use cryptographic whitening techniques for actual crypto use, you shouldn't do that for your Diehard input, because that'll hide any flaws Diehard could have found. There are other kinds of whitening that can make sense (e.g. if you get long runs of the same bit because you're sampling the hardware faster than it changes, you'll want to compress those before doing Diehard.)
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
If you don't trust the server not to play with the clock on your VM, you can't trust the server not to steal your data wholesale.
But there really does need to be a mechanism for the server to feed high-quality randomness to the VM, whether it's through a device driver or a well-known address on the box or something, and it needs to be available at or just after boot time on the VM.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
Yes, the entropy pools could be very similar. But if you're doing anything cryptographically strong, you're going to take the input and run it through a hash function, so on average a one-bit change in the input will change half the bits in the output. If you got the same SSL cert both times, none of the input bits were different.
If your attacker knows the state of your entropy pool when you start, and knows you're only changing a few bits of input, he can model the PRNG's behaviour to try all the different values of those input bits, and probably get lucky about guessing the output.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
Absolutely correct - you can't trust the hardware if you can't see it. Via and Pi are probably ok; people are rather more paranoid about Intel. Audio hardware can be useful (but you have to be sure what it'll do if there's no microphone plugged in.)
And as far as your signature line goes, it's really annoying how hard it's been to tell headlines in the NYT or WSJ from headlines in The Onion lately, especially about politics.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
Believe me, if the CIA is beaming high-powered radio signals at your RNG to bias the output, you've got more serious problems than just a good RNG can fix... (What's the frequency, Kenneth?)
OTOH, if a 60 Hz or 120 Hz signal can bias your generator, that's a much different problem.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks