Hacker News new | ask | show | jobs
by Dork1234 1589 days ago
Can Linux use Hardware RNG devices? Are these devices able to generate enough bits of randomness to work for boot?
5 comments

FTA: That entropy comes from sources like interrupt timing for various kinds of devices (e.g. disk, keyboard, network) and hardware RNGs if they are available.

So yes, Linux can use hardware RNGs. Your second question probably is better stated as whether those can generate random bits at a sufficient rate. I would expect hardware RNGs of being capable of that for typical use cases.

Yes. This happens via random.c's add_hwgenerator_randomness() hook, which the hwrng framework calls from a kthread.
Appears so?

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux...

not sure that's used for /dev/random/ but I thought it was, but the question is when because early in the boot process that may not be loaded. There was also a general distrust of vendor specific hardware randoms in the past IIRC.

You can run rng-tools to feed randomness from dedicated hardware like OneRNG or TrueRNG, it is substantially slower then /dev/urandom.
I do wonder if _fast_ quantum rng sources will become ubiquitous outside mobile applications.
I doubt it. even if algorithms like sha get almost totally broken, you could get away with injecting a tiny number of bits of true randomness (like 1 in 2^20) and the result will be uncrackable.