3 ms·
Can Linux use Hardware RNG devices? Are these devices able to generate enough bits of randomness to work for boot?
by Dork1234 5y ago
Can Linux use Hardware RNG devices? Are these devices able to generate enough bits of randomness to work for boot?
- leeter 5y agoAppears so? https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/char/hw_random/ 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.
- goalieca 5y agoI do wonder if _fast_ quantum rng sources will become ubiquitous outside mobile applications.
- adgjlsfhk1 5y agoI 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.
- Someone 5y agoFTA: 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.
- neatze 5y agoYou can run rng-tools to feed randomness from dedicated hardware like OneRNG or TrueRNG, it is substantially slower then /dev/urandom.
- zx2c4 5y agoYes. This happens via random.c's add_hwgenerator_randomness() hook, which the hwrng framework calls from a kthread.