Myths about /dev/urandom (2014)

(2uo.de)

14 points | by signa11 1 hour ago

6 comments

  • xiphmont 41 minutes ago
    Half the entropy is trying to figure out which pieces of this article's text are supposed to be the silly falsehoods being corrected, and which pieces are just the second or third paragraph of a preceding 'Fact'. Deadpool is easier to follow.
    • roter 2 minutes ago
      I saw a note from an earlier year's discussion saying the css has been changed over the years. Perhaps it was easier then to discern fact or myth, truth or fiction.
    • notnmeyer 3 minutes ago
      glad i’m not the only one. i’m more or less baffled reading that.
  • sph 14 minutes ago
    This is a good place as any to ask, last time I didn't get any answer: has there ever been a serious Linux exploit from manipulating/predicting bad PRNG? Apart from the Debian SSH key generation fiasco from years ago, of course.

    Having a good entropy source makes mathematical sense, and you want something a bit more "random" than a dice roll, but I wonder at which point it becomes security theatre.

    Of all the possible avenues for exploiting a modern OS might have, I figure kernel PRNG prediction to be very, very far down the list of things to try.

  • throw0101c 14 minutes ago
  • NooneAtAll3 54 minutes ago
    (2014)
    • ape4 46 minutes ago
      Ah, I wonder what's change since then.
      • vbezhenar 33 minutes ago
        Here's quote from the article:

        > Note from 2024: This article was published on March 16th, 2014. It is still correct in its discussion of entropy and randomness, but the Linux kernel random number generator has been reworked several times since then and does not look like this anymore. Good news: the separation between /dev/urandom and /dev/random is practically gone.

        My understanding is that on modern Linux system:

        At early boot phases, /dev/random can still block, because not enough entropy has been seeded yet. /dev/urandom will not block, but the random data might be of poor quality and not suitable for crypto purposes. This happens very early in the boot, so probably it's not even possible to run user stuff at this time. At least on my laptop, the message "random: crng init done" gets logged almost instantly after boot and long before even initrd starts. Might be different for exotic platforms, I guess.

        Once there was enough entropy seeded, both /dev/random and /dev/urandom works identically, they don't block and they return high quality random data. So for most userspace purposes, these files can be used interchangeably, one is not better than another.

        • mananaysiempre 21 minutes ago
          > Might be different for exotic platforms, I guess.

          Short-lived isolated VMs (like might be used for CI) are one place where entropy can be a problem. The relevant definition of “platform” here is less about the CPU architecture and more about the environment.

          • ChrisSD 4 minutes ago
            VMs should have VirtIO RNG set up so there is a high quality entropy source at boot time, provided by the host system.
  • EMPTYCONTOUR 12 minutes ago
    [flagged]