3 ms·
Only if you trust your platform devs to get it right. On Linux that's probably a good bet (and on FreeBSD it's probably an even better bet). But on MacOS or W
by lisper 10y ago
Only if you trust your platform devs to get it right. On Linux that's probably a good bet (and on FreeBSD it's probably an even better bet). But on MacOS or Windows? There's no way to tell whether a CSPRNG has been compromised by looking at its output, so you don't have to put on a very thick tinfoil hat to believe that the probability that these might be compromised somehow is greater than zero, in which case knowing how to roll your own CSPRNG can be very handy. At the very least, knowing these things can help you detect snake oil (like the "measured performance" at http://moonbaseotago.com/onerng/theory.html http://moonbaseotago.com/onerng/theory.html)
- tptacek 10y agoOSX's kernel CSPRNG is Yarrow. Window's CryptGenRandom and derivatives are one of the more well-studied OS CSPRNGs.
- lisper 10y agoAnd you know this how? Have you actually decompiled the kernel to make sure that the /dev/urandom driver actually does what the documentation says it does? If you haven't (and I know that you might actually have done this, but most people would not have) then you're back to trusting the manufacturer. BTW, the most likely threat model is not Apple or Microsoft making a stupid mistake in their PRNG, but rather having made a back-room deal with (say) the NSA to intentionally back-door /dev/urandom.
- hannob 10y agoSome people actually do decompile things to make sure they don't contain security vulns. However, if your threat model includes Apple or Microsoft hiding a backdoor in the OS then you can't use their OS. Designing your own CSPRNG doesn't help you. If you want that level of security you need to switch to an operating system you can trust (what that means is a complicated question which probably includes free software, reproducible builds, transparency logs and then you'll still end up with hardware you can't trust).
- lisper 10y ago> Some people actually do decompile things to make sure they don't contain security vulns. Of course, and tptacek might even be one of them. But most people don't do this. And if you don't do it yourself, if you rely on someone else who says that they did it, how do you know you can trust them? This rabbit hole is, of course, as deep as you care to dig it. It's not possible to function without trusting someone. All I'm saying is that if you choose to go down this particular branch of the rabbit hole, it is possible to learn the essentials more expeditiously than reading a 40 page document. > Designing your own CSPRNG doesn't help you That depends on what kind of back door it is. If it's just /dev/urandom which is compromised then rolling your own CSPRNG does help. And a backdoored /dev/urandom is not a completely unreasonable threat model. It's a lot easier to hide a backdoor in a CSPRNG than in just about any other part of the system because the I/O behavior of a compromised CSPRNG can be indistinguishable from a reliable one. But yes, if you're approaching this level of paranoia then switching to an open-source OS is probably more bang for the buck. But even there, are you sure that the code for /dev/urandom has been properly audited?
- tptacek 10y agoYes.
- lisper 10y agoDo I really need to explain why that's not a constructive answer?
- tptacek 10y agoYou asked a question I have a very straightforward answer for, and so I gave it to you.
- lisper 10y agoOK, but the way you interpreted my question was not the way I meant it. You had already made it clear that you trust vendors. And that's fine. It's not unreasonable to trust a vendor. You have to trust someone. When I asked, "Are you sure..." I did not mean "you, Thomas Ptacek." I didn't even mean, "You, Hanno Böck" even though he is the one I was actually responding to. I meant, "You, some hypothetical person in a hypothetical scenario", specifically, a scenario where you (the hypothetical person, not you, Thomas Ptacek) are "approaching this level of paranoia", i.e. where (hypothetical) you believe that a compromised CSPRNG is a possibility you need to seriously consider for whatever reason. How can that person be confident that they can trust OpenBSD? In case you are tempted to take another whack at an answer, let me stipulate that I am assuming that this hypothetical person to whom the question is being addressed is reasonably technically competent but not a crypto expert. In particular, my hypothetical person does not know who Thomas Ptacek is, and so has no reason to lend any particular credence to his assessment of the situation in the absence of other evidence or arguments.