random numbers

Raspberry Pi & Random Number Generation


You cannot have good encryption without random numbers, but few people realize the Raspberry Pi (all versions) have a random number generator right on their silicon.

Unfortunately, the Raspberry Pi OS’s do not utilize it without a set of tools not installed by default. As a result, you end up with a much smaller pool of random numbers (Entropy) to generate encryption for PGP, SSL Keys and the like.

To activate the (Pseudo) Random Number Generator on the silicon ARM chip, we only need to install rng-tools

Install rng-tools

Older versions of the PI OS do not have the tool installed. However, if you have the current Raspberry PI OS’s since the name change from Raspbain, it is installed already.

sudo apt-get install rng-tools 

Edit rng-tools config file

Now you’ll need to open /etc/default/rng-tools in nano and edit a line to add the hardware device to the pool of random numbers Linux draws from.

sudo nano /etc/default/rng-tools

Next uncomment (remove the #) from the following line: #HRNGDEVICE=/dev/hwrng

Now hit CTRL+X to close nano and type Y to save the edit.

Now restart rng-tools with sudo service rng-tools restart


Posted

in

,

by

Tags: