3 ms·
Are you saying that that article is wrong? I was under the impression that /dev/random and /dev/urandom on Linux were exactly the same thing, but with urandom n
by wyager 12y ago
Are you saying that that article is wrong? I was under the impression that /dev/random and /dev/urandom on Linux were exactly the same thing, but with urandom not being limited by the (very questionable) entropy counter.
I'm pretty sure they are exactly the same on many of the BSDs.
- tptacek 12y agoI wrote that article, so, no.
- Perseids 12y agoThe thing is, /dev/urandom is not even limited by the entropy counter when there is no entropy in the system at all. That was the reason for the RSA factor collisions: The software just used /dev/urandom during boot time when the embedded systems did not have enough entropy available. As a remedy the libreSSL team asked for a Linux syscall with the feature to block if and only if the random pool has not been seeded with at least 128bit of randomness: https://news.ycombinator.com/item?id=8049180 https://news.ycombinator.com/item?id=8049180
- tptacek 12y agoThat's a Linux bug with a universally-deployed userland workaround. There's no question that urandom should work on Linux the way it does on FreeBSD, but that's not a reason to avoid urandom in userland software. The death toll from avoidance of urandom is enormous; the death toll from this bug... isn't.
- nwmcsween 12y agoI would say it was both a Linux and a application bug, you could just open an fd on both random and fallback onto urandom or even better supplement random with a prng such as haveged.
- tptacek 12y ago"Supplementing" random(4) with a userspace PRNG is exactly the anti-pattern that Bernstein is talking about.
- Panino 12y agoI'm pretty sure they are exactly the same on many of the BSDs. * OpenBSD: /dev/random + /dev/urandom are the same and use ChaCha20. * FreeBSD: They are the same (via symlink) and use RC4. Soon will use ChaCha20. * NetBSD: Unsure. Last I checked, /dev/random was broken/non-functional like on Linux, and /dev/urandom was slow, like on Linux. * Dragonfly BSD: Somewhat unsure, but ChaCha output can be xor'd with another stream to produce the returned random numbers. * Bitrig: when it is released, it will use ChaCha20 like OpenBSD. Related: libbsd currently uses RC4 in its arc4random functions but has publicly stated a future switch to ChaCha20.