Why does reading from /dev/urandom deplete entropy so much?



While debugging Exim4's GnuTLS interface, I recently found out that
reading from /dev/urandom depletes entropy as much as reading from
/dev/random would. This has somehow surprised me since I have always
believed that /dev/urandom has lower quality entropy than /dev/random,
but lots of it.

This also means that I can "sabotage" applications reading from
/dev/random just by continuously reading from /dev/urandom, even not
meaning to do any harm.

Before I file a bug on bugzilla, can I ask why /dev/urandom wasn't
implemented as a PRNG which is periodically (say, every 1024 bytes or
even more) seeded from /dev/random? That way, /dev/random has a much
higher chance of holding enough entropy for applications that really
need "good" entropy.

Entropy depletion has become an issue on Linux systems since the
network was removed from the group of entropy sources a few years ago.
Of the around 20 Linux systems that I currently have root privileges
on, only two have a hardware RNG.

What can I do to keep sufficiently high entropy pools even if I read
from /dev/urandom more than once in a while?

Greetings
Marc

--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature | How to make an American Quilt | Fax: *49 3221 2323190
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Why does reading from /dev/urandom deplete entropy so much?
    ... reading from /dev/urandom depletes entropy as much as reading from ... should seed a PRNG from /dev/random instead of using the entropy ... I will go filing a bug against GnuTLS. ...
    (Linux-Kernel)
  • Re: Why does reading from /dev/urandom deplete entropy so much?
    ... reading from /dev/urandom depletes entropy as much as reading from ... higher chance of holding enough entropy for applications that really ... So I guess you could patch your kernel to get more entropy sources ...
    (Linux-Kernel)
  • Re: Why does reading from /dev/urandom deplete entropy so much?
    ... reading from /dev/urandom depletes entropy as much as reading from ... I think that getting some entropy from network is a good thing, even if it's used only in urandom, and I would like a rational discussion of checking the random pool available when urandom is about to get random data, and perhaps having a lower and upper bound for pool size. ...
    (Linux-Kernel)
  • Re: Questions on FIPS140-2 and RNG tests
    ... that's worse than one-time pads, but better than sending plaintext. ... internal entropy to prevent guessing the state. ... In fact, if you want a megabyte of pseudorandom data, reading it from ...
    (sci.crypt)
  • Re: Why does reading from /dev/urandom deplete entropy so much?
    ... reading from /dev/urandom depletes entropy as much as reading from ... higher chance of holding enough entropy for applications that really ... A PRNG is clearly unacceptable. ...
    (Linux-Kernel)