10 comments

  • xiphmont5 hours 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.
    • Tomte3 hours ago
      Hey, someone submitted my old article. On my birthday!<p>Oh, people hate it… and even someone I definitely look up to.<p>You‘re absolutely right, though, I don‘t remember it being that bad, and probably I just read over it when resurrecting the article, because I‘m so familiar with every word.<p>I‘ll slap some &lt;hr&gt; tags on it when I‘m back home from my holiday.
      • Sophira2 hours ago
        If it helps, it used to look like this: <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20140309183752&#x2F;http:&#x2F;&#x2F;www.2uo.de&#x2F;myths-about-urandom&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20140309183752&#x2F;http:&#x2F;&#x2F;www.2uo.de...</a><p>Definitely a lot more readable! Something must have changed in the meantime.<p>It looks like some links have gone too, like the one in the sentence &quot;how does &#x2F;dev&#x2F;random know how much entropy there is available to give out?&quot;
      • flyinprogrammer3 hours ago
        Most importantly -- Happy birthday!!!
      • gblargg3 hours ago
        Label the myths rather than leaving them as plain statements.
        • wang_li1 hour ago
          Yes. It should look like:<p><pre><code> Myth: the moon is made of green cheese. Fact: the moon is made of yellow and green cheese.</code></pre>
      • syncsynchalt49 minutes ago
        Happy birthday!<p>This&#x27;ll all wait for later, hope you&#x27;re enjoying a nice mai tai on your holiday.
    • roter4 hours ago
      I saw a note from an earlier year&#x27;s discussion saying the css has been changed over the years. Perhaps it was easier then to discern fact or myth, truth or fiction.
      • stordoff4 hours ago
        I pulled up a random version from 2014, and it&#x27;s more readable: <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20141023082929&#x2F;https:&#x2F;&#x2F;www.2uo.de&#x2F;myths-about-urandom&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20141023082929&#x2F;https:&#x2F;&#x2F;www.2uo.d...</a>
    • notnmeyer4 hours ago
      glad i’m not the only one. i’m more or less baffled reading that.
    • cyanydeez2 hours ago
      the article is why you need to tell your LLM to &#x27;make noistakes&#x27;
  • sph4 hours ago
    This is a good place as any to ask, last time I didn&#x27;t get any answer: has there ever been a serious Linux exploit from manipulating&#x2F;predicting bad PRNG? Apart from the Debian SSH key generation fiasco from years ago, of course.<p>Having a good entropy source makes mathematical sense, and you want something a bit more &quot;random&quot; than a dice roll, but I wonder at which point it becomes security theatre.<p>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.
    • the847214 minutes ago
      Some of the paranoia has been proven correct. For example both Intel and AMD had RDRAND bugs so not relying on it as sole source was the correct choice.
    • vlovich1234 hours ago
      It’s both hard to attack but also a hugely audited system with a lot of attention paid.<p>That being said, [1] from 2012. The challenge with security is that structural weaknesses can take a long time to be discovered but once they are it’s catastrophic. Modern Linux finally switched to CSPRNG and proper construction and relies less on the numerology of entropy estimation it had been using (ie real security instead of theater). RDRAND has also been there for a long time on the x86 side which is useful because even if it’s insecure it gets mixed with other entropy sources like instruction execution time and scheduling jitter to protect standalone servers and iot devices.<p>Of course you hit the nail on the head in terms of the challenge of distinguishing security theater because you won’t know if the hardening is useful until there’s a problem, but there’s enough knowledgeable people on it that it’s less security theater than it might seem if you know what’s going on.<p>[1] <a href="https:&#x2F;&#x2F;www.usenix.org&#x2F;system&#x2F;files&#x2F;conference&#x2F;usenixsecurity12&#x2F;sec12-final228.pdf" rel="nofollow">https:&#x2F;&#x2F;www.usenix.org&#x2F;system&#x2F;files&#x2F;conference&#x2F;usenixsecurit...</a>
      • jonhohle3 hours ago
        30 years ago BSDs already had non-blocking &#x2F;dev&#x2F;random (there was no difference to &#x2F;dev&#x2F;urandom). OpenBSD especially wouldn’t have shipped something known insecure. Blocking random probably caused more issues (DOS, random hangs, etc.) than a no blocking CSPRNG would have.
        • jlokier1 hour ago
          Linux did &#x2F;dev&#x2F;random first, so naturally it had the oldest design for a few years, without the security expert scrutiny and experience, which the other OSes had for their implementations.<p>OpenBSD didn&#x27;t exist yet when &#x2F;dev&#x2F;random and &#x2F;dev&#x2F;urandom were created for Linux.
    • teravor58 minutes ago
      &#x2F;dev&#x2F;[u]random is actually a CSPRNG. it uses a cryptographic hash function to mix in every drop of randomness accessible to the kernel. predicting it without compromising the kernel entails predicting all the randomness that went into it, past a certain point you are better off bruteforcing the internal state directly and that&#x27;s intractable.<p>the greatest danger is right after boot where it&#x27;s possible the kernel didn&#x27;t have enough randomness to mix in yet. not as much of an issue on modern systems.
    • hannob4 hours ago
      I think this one is among the most significant findings: <a href="https:&#x2F;&#x2F;factorable.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;factorable.net&#x2F;</a><p>I also believe there were some android ASLR issues based on the same weakness (i.e., low early boot-time entropy).<p>But this is all quite old, and there&#x27;ve been massive improvements. Basically, &quot;don&#x27;t use a very old linux kernel&quot; is your mitigation for these issues.
    • GoblinSlayer1 hour ago
      There was a bitcoin key generation flaw on android, and AFAIK people lost money.
    • wat100002 hours ago
      You can analyze it much like you&#x27;d analyze a password. If you construct a password from four words taken from a list of 1024 words, that&#x27;s 40 bits of entropy. On average, a brute force attacker would have to try 2^39 (half the possibilities) random passwords before cracking your account. You can then apply that number to the time&#x2F;money required for one attempt, and see if it&#x27;s sufficiently secure for your tastes. If the answer comes back as 10 minutes, maybe it&#x27;s not good enough. If it&#x27;s 10 quadrillion years, you&#x27;re probably OK.<p>If you have bad PRNG, you should be able to quantify it in terms of bits. The Debian bug resulted in 15 bits of randomness, since all inputs to the PRNG were erased except for the pid, which was 15 bits at the time.<p>Another real-world example, albeit not Linux. I once worked on a program that had the option of encrypting save files. The encryption was custom (not done by me!) and had a bit of an issue. The encryption itself was not bad, but the save file&#x27;s master encryption key was generated from the current time. This reduced the number of bits of randomness to well within brute-force range, especially if you could guess at roughly when the key was created. This was convenient for users who had lost their passwords, but somewhat less convenient for users who wanted to actually protect their data.<p>An attacker isn&#x27;t going to spontaneously try breaking your PRNG, but if you do have an issue, it&#x27;s a real concern. It&#x27;ll be far down the list of things to try just because any modern system will hopefully have very good randomness.
  • throw0101c4 hours ago
    Original discussion from 2014:<p>* <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7359992">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7359992</a><p>Also:<p>2020: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22683627">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22683627</a><p>2018: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17779657">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17779657</a><p>2017: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13332741">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13332741</a><p>2015: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10149019">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10149019</a>
  • jonhohle3 hours ago
    Back in the dinosaur days (around 2005) I was working on a PHP CMS used by a big registrar. Occasionally page loads would block for seconds. It appeared randomly (natch) and was relatively unreproducible.<p>I couldn’t find any good way to debug it and a friend suggested GDB. I had never thought of using such a low level debugger on a scripting language, but what choice did I have? Fired it up, found a blocked process and sure enough it was blocked on reads to &#x2F;dev&#x2F;random.<p>I leaned two things that day: the decision to make and keep &#x2F;dev&#x2F;random blocking was dumb and GDB (or lldb, or valgrind, etc.) is useful for debugging just about anything.
    • hnav11 minutes ago
      for something like this strace is a really good fit
  • iamtedd4 hours ago
    That was hard to tell where the additional commentary on the fact ended and the next myth started.
    • syncsynchalt48 minutes ago
      The CSS has broken some time in the last 12 years, people have posted archive links that make it much clearer [1].<p>The author is on holiday (and enjoying their birthday!) and will get to it when they&#x27;re back home.<p>[1] <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20140309183752&#x2F;http:&#x2F;&#x2F;www.2uo.de&#x2F;myths-about-urandom&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20140309183752&#x2F;http:&#x2F;&#x2F;www.2uo.de...</a>
  • chaboud3 hours ago
    I woke up around 4am, read this, and wondered if I was still in a dream state given the meandering nature of it.<p>Were the man page musings written in response to the (alleged, but... uh... NSA) kleptographic backdoor in Dual_EC_DRBG? It requires multiple successive outputs to compromise and derive internal PRNG state, if memory serves.<p>In that <i>one</i> construction, &#x2F;dev&#x2F;random blocking on seeding would have a mild state-hiding advantage over &#x2F;dev&#x2F;urandom, I imagine... but, sheesh. Nobody use that generator.
  • iamtedd4 hours ago
    Twelve years later, if there&#x27;s still so much misconception about &#x2F;dev&#x2F;(u)random, has the man page been fixed?<p>Edit: can&#x27;t count.
    • Tomte3 hours ago
      Yes. It’s mentioned at <a href="https:&#x2F;&#x2F;www.thomas-huehn.com&#x2F;myths-about-urandom-revisited&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.thomas-huehn.com&#x2F;myths-about-urandom-revisited&#x2F;</a><p>Of course, when searching for man urandom you still found the old versions at the top of the search results for years and years afterwards. And the German Wikipedia page will probably never change.
  • NooneAtAll35 hours ago
    (2014)
    • ape45 hours ago
      Ah, I wonder what&#x27;s change since then.
      • vbezhenar5 hours ago
        Here&#x27;s quote from the article:<p>&gt; 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 &#x2F;dev&#x2F;urandom and &#x2F;dev&#x2F;random is practically gone.<p>My understanding is that on modern Linux system:<p>At early boot phases, &#x2F;dev&#x2F;random can still block, because not enough entropy has been seeded yet. &#x2F;dev&#x2F;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&#x27;s not even possible to run user stuff at this time. At least on my laptop, the message &quot;random: crng init done&quot; gets logged almost instantly after boot and long before even initrd starts. Might be different for exotic platforms, I guess.<p>Once there was enough entropy seeded, both &#x2F;dev&#x2F;random and &#x2F;dev&#x2F;urandom works identically, they don&#x27;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.
        • aomix4 hours ago
          It started looking a whole lot like OpenBSD’s random number system. Private entropy pool from good system entropy seeds a ChaCha20 stream with random reseeds for forward secrecy in case of compromise. I think Linux is even more paranoid in the early boot environment where even in the presence of a seed file it prefers to get system entropy mixed in before confidently saying it can do crypto activities.
        • mananaysiempre5 hours ago
          &gt; Might be different for exotic platforms, I guess.<p>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.
          • ChrisSD4 hours ago
            VMs should have VirtIO RNG set up so there is a high quality entropy source at boot time, provided by the host system.
            • mananaysiempre4 hours ago
              Should, yes. Will, perhaps, but better be aware of the potential problem and check.<p>Just yesterday I encountered people complaining about a VM not connecting to a cloud service when they neglected to put their DNS server’s address in the config for the DHCP server used by that particular host. And a dysfunctional RNG is much more difficult to detect.
  • EMPTYCONTOUR4 hours ago
    [flagged]