10

I came across a blog concerning entropy pool problem and learn that there are a special hardware called RNG. I have read this kernel RNG page but I still wonder whether there is a way to find out if my server support hardware RNG or not.

7

There are two likely types of "real" hardware RNG: a CPU based one, and a chipset or PCI based one. (There are also a few USB hardware RNGs, but I suspect you'd have noticed one of those ;-)

The following is Linux specific.

For CPU based ones, you can check /proc/cpuinfo for clues, assuming your kernel is new enough to detect them. For Intel CPUs the flag is rdrand, more info here: https://unix.stackexchange.com/questions/43539/what-do-the-flags-in-proc-cpuinfo-mean

For chipset ones, if you have CONFIG_HW_RANDOM enabled in your kernel and the per-vendor support CONFIG_HW_RANDOM_INTEL ..._AMD etc. then your boot messages should indicate if any were found (e.g. "Intel 82802 RNG detected"). If they are present as modules you can try (modprobe intel-rng) to see if it loads, "No such device" indicates no detected hardware. Not all drivers consistently print "RNG detected" or "not detected", so you may end up reading the sources (/drivers/char/hw_random/ directory of the kernel source).

For others, you can check lspci -v to see what's recognised.

1

To find out you have RNG do the following:

1) List all modules having "rng" in its name:

cat /proc/modules | grep -i rng

2) If you have any you will get a result like this

tpm_rng 16384 0 - Live 0xffffff......

3) Make sure to enable or load it using modprobe at this time:

modprobe tpm_rng

UPDATE: Regarding step (1), for me modprobe -l was not working in ubuntu 16 that's why I tried to look for inside "/proc/modules" but if it works with you then it's fine .. Recently I've searched and get to know all modules are resident inside /lib/modules/$(uname -r) so you could also use the following which is better:

cat /lib/modules/$(uname -r)/modules.dep | grep -i rng.*.ko

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.