Yikes! 35 seconds! Even with hwrng!
This could have easily been much worse!
So what did we learn from this?
It can take up to 1h40m before your linux-server in a virtual machine comes up. It can take tens of minutes before your non-virtual linux server boots up.
If you want a quick and permanent, but flawed fix, you have to enable RDRAND (of which we can reasonably assume that it has been compromised).
If this happens to you on server machines, spend the 50$ for a chaoskey (or some other similar entropy source) for every server to be done with this failure mode once and for all (If the number of servers you run is small enough for this to be feasible, that is).
Forward the host entropy pool to the guests and/or any containers.
If you’re in a pinch and find yourself in front of a machine that doesn’t come up:
If you can afford it: just stoically wait it out for at most 2 hours.
If you need the machine to boot up quickly, connect a mouse or keyboard and make some random moves or hit some random keys.
If you want a quick and permanent, but flawed fix, you have to enable RDRAND (of which we can reasonably assume that it has been compromised).
If you don’t trust the random number generator in your CPU, what is the basis upon which you decide to trust the rest of the CPU?
If this happens to you on server machines, spend the 50$ for a chaoskey
What makes the STM32F042 microcontroller more trustworthy as a source of entropy than the CPU? Is it open hardware? With a third-party auditable manufacturing process?
If you don’t trust the random number generator in your CPU, what is the basis upon which you decide to trust the rest of the CPU?
It’s not about trust in the CPU. It’s about having trust in what has been used to encrypt data that leaves the CPU.
What makes the STM32F042 microcontroller more trustworthy as a source of entropy than the CPU? Is it open hardware? With a third-party auditable manufacturing process?
The fact that the attached circuit is a sensible source for thermal noise and the fact that I can verify that.
Lets see how this can turn out on a raspberry pi (version: 1, model: B, Raspbian Buster):
Yikes! 35 seconds! Even with hwrng! This could have easily been much worse!
So what did we learn from this?
This is a fine mess….
If you don’t trust the random number generator in your CPU, what is the basis upon which you decide to trust the rest of the CPU?
What makes the STM32F042 microcontroller more trustworthy as a source of entropy than the CPU? Is it open hardware? With a third-party auditable manufacturing process?
It’s not about trust in the CPU. It’s about having trust in what has been used to encrypt data that leaves the CPU.
The fact that the attached circuit is a sensible source for thermal noise and the fact that I can verify that.
On a v4.19 or newer kernel, make sure you either built with CONFIG_RANDOM_TRUST_CPU=y or booted with “random.trust_cpu=on” to jump-start the pRNG.
And if you want even more entropy, get one of these: https://altusmetrum.org/ChaosKey/