Andi Kleen wrote:Good. /dev/random was a poor choice for most applications. I've always lamented the naming scheme (which for a long time caused many applications to use /dev/random when /dev/urandom would have been more appropriate). ? You say get_random_bytes() acts like reading from /dev/random, but then your subsequent sentences are consistent with it acting like reading from /dev/urandom, so I'm lost. /dev/urandom also runs its inputs through cryptographic hash functions to ensure that it acts as a cryptographic-quality pseudorandom number generator. /dev/urandom also won't block on depletion. /dev/urandom also affects the entropy pool. /dev/urandom is a pseudorandom number generator. "not trivially predictable" seems overly dismissive. /dev/urandom is a lot better than "not trivially predictable"; it is intended as a cryptographic-quality PRNG. It's not just "run through a few hashes and what not": it uses cryptographic hash functions in an appropriately chosen way to ensure that its output will be cryptographically strong (assuming it has been properly seeded, and assuming that the cryptographic hash functions have no relevant security holes). I'm not sure what you mean by "conserving entropy". Are you referring to the impact on other applications that use /dev/random? If the impact of get_random_bytes() on /dev/random-users is the same as the impact of /dev/urandom on /dev/random-users, then I don't understand the objection. This term has a standard well-defined meaning in the cryptographic literature. That's how I define it. "pseudorandom" implies that it is not true, information-theoretic randomness; rather, it refers to bits that are computationally indistinguishable from true randomness. This statement looks confused to me. You really have to separate users of /dev/random from users of /dev/urandom if you want to make these kinds of statements, and you need to separate information-theoretic security ("entropy") from computational security (where, confusingly, sometimes people also use the word "entropy" to refer to computational indistinguishability from true entropy; let's try to avoid that here, since there seems to be some confusion about information-theoretic vs computational security). Once /dev/urandom is properly seeded, it doesn't matter how much output you grab from /dev/urandom; all subsequent users of /dev/urandom will continue to get cryptographic-quality pseudorandom bits (bits that cannot be distinguished from true randomness by any computationally feasible computation, so far as we know). Perhaps you are referring to the effect that reading from /dev/urandom has on user of /dev/random. I'm not sure I fully understand the issue. Are you saying that if /dev/random is relatively starved for entropy, and if Alice reads lots of bits from /dev/urandom, and then Bob reads from /dev/random, then Bob might block waiting for /dev/random's pool to be replenished? If that's the issue, then the solution seems to be to fix /dev/urandom and /dev/random, as this is a general issue for all users of /dev/random, not specific to get_random_bytes() or to this particular use of random bits for glibc. (Keep in mind your earlier claim that no one uses /dev/random.) Note that /dev/random will block if it thinks there is not sufficient entropy availbale; it doesn't return low quality entropy. I'm not clear on the scenario under which you expect some user to get low quality entropy. Seems to me cleaner fix /dev/urandom to work that way, if this is the concern, rather than narrowing in on glibc's use of /dev/urandom. I never made that assumption. Once /dev/urandom is seeded with 128 bits of high-quality entropy, all of its subsequent outputs will be fantastic (computationally indistinguishable from true randomness). --
| Ingo Molnar | [patch 02/13] syslets: add syslet.h include file, user API/ABI definitions |
| Heiko Carstens | Re: 2.6.25-rc6-git6: Reported regressions from 2.6.24 |
| Greg Kroah-Hartman | [PATCH 010/196] Chinese: add translation of Codingstyle |
| Rafael J. Wysocki | [Bug #10629] 2.6.26-rc1-$sha1: RIP __d_lookup+0x8c/0x160 |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Linus Torvalds | Re: [GIT]: Networking |
| Mark Lord | Re: [BUG] New Kernel Bugs |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
