by binarycrusader · 11y ago · 0 comments
However, on systems such as Solaris, the cryptography group (whom I know personally) specifically recommends the use of /dev/random in some cases. Those cases are largely limited to specific cryptography requirements such as a hard requirement for high entropy sources.
Regardless, all of this is largely moot at this point, as all *NIX-like systems (including Solaris) seem to be standardising on the getrandom() (in Linux first) and getentropy() (in OpenBSD first) which sidestep many of the more subtle, potential issues.
In particular: the Solaris documentation suggests that urandom is fine for nonces, and /dev/random for long-term keys. But that's the opposite of the normal threat model for randomness! You care most about high-quality continuous-availability randomness for the nonces, where biases can be devastating to security, and attackers get repeated continual bites at the apple.
If someone can explain the logic here, I'll update the page that AGL linked to in this article to account for that.
I think the Solaris people are wrong. I'm not sure, but I'd be willing to bet a small amount of money on it.
I have, and again, most of the reasoning is Solaris-specific.
The primary difference between urandom and random is currently higher quality re-keying for /dev/random, but there are a few internal implementation differences as well.
Fundamentally, it's about constraints placed on the implementation that currently make /dev/random more "secure". In addition, for Solaris /dev/random (and getrandom(GRND_RANDOM)) when the administrator explicitly configures a specific validation mode then the bits you get come from a validated DRBG (Deterministic Random Bit Generator). /dev/urandom is not affected by that validation mode.
I think the Solaris people are wrong. I'm not sure, but I'd be willing to bet a small amount of money on it.
They're really not in this case, but in fairness, you'd have no way of knowing about this without source code access and a few decades of knowledge about Solaris crypto.
You can find a summary from two years ago written by one of the primary Solaris cryptography engineers and architects here:
https://blogs.oracle.com/darren/en_GB/entry/solaris_random_n...
...they intend to update it soon for the next Solaris release.
From what I can tell, the situation on Solaris is very similar to that on Linux:
* there are two separate pools that service random and urandom,
* but both use very similar generators (in particular, both use CSPRNG DRBG constructions);
* some additional care is taken in random's case to ensure initialization (a good thing)
* but that care doesn't matter once this system is fully booted,
* and random is more aggressive about reseeding,
* but that only matters for post-compromise forward-secrecy, the need for which in this case implies you are completely boned anyways.
I'm standing by what I said before: use urandom, to the exclusion of all other generators, very much including Solaris.
Except /dev/random, which can use a different generator when the administrator configures a specific validation mode. Again, specific cryptographic requirements.
that only matters for post-compromise forward-secrecy
Not all cryptographic requirements are purely technical or even "ideal"; some reflect specific policy and/or customer requirements based on their specific cryptographic needs.
I'm standing by what I said before: use urandom, to the exclusion of all other generators, very much including Solaris.
To you, this advice is based on "authority"; to me, it's based on my long-term friendship and working relationship I've established with them over the years and my respect for them as engineers/developers/crypto experts. These are people that would run circles around most "geeks" and have been doing crypto for a decade or more and they have both the pedigree and track record to show for it.
So in the end, you're of course free to believe what you'd like, and while I agree that your advice is generally reasonable, I continue to assert that it is wrong in specific cases for Solaris. As I already pointed out, and you seem to have ignored, the results you get from /dev/urandom are not the same as /dev/random in certain configurations.
As I said before, the Solaris crypto team intends to update the blog post I linked before with more details at a later date. Perhaps that will have the elusive information you're looking for.
I'd also like to know what their specific arguments are on Solaris and for what use cases.
I like how you put that. Best way to because infrastructure reliability is way too important to sacrifice over questionable security gains. Puts a QED on the whole discussion.
[1] That is, before enough external entropy has been gathered.
In practice, that's rare, but some consumers have strict, hard requirements that can't be ignored.
Retrieving output bytes doesn't change anything.
The view "take three bytes output, lose three bytes entropy" is simply not correct.
All of crypto relies on being able to generate an arbitrary amount of good random bytes from a single 256-or-whatever-byte seed. Otherwise it wouldn't be safe to encrypt a long message with a short key.