Overview

The run-swrng-pserver.sh shell script can be used on Linux and macOS to distribute random bytes downloaded from a cluster of one or more SwiftRNG devices through a named pipe.

This is probably the simplest way to give a range of user-space applications concurrent access to true random bytes.

Starting the pipe server

Make sure the software kit has been built and installed successfully, and that one or more SwiftRNG devices are plugged into available USB ports.

Open a command line window and run the following command:

sudo run-swrng-pserver.sh

If successful, the script creates the named pipe /tmp/swiftrng and makes it available for read access.

Verifying the pipe server

In a new command line session, verify that random bytes are available with the following command:

dd if=/tmp/swiftrng of=/dev/null iflag=fullblock bs=12000000 count=1

You can now access random bytes by reading from /tmp/swiftrng as you would a regular binary file.

Starting the pipe server at boot time

To run the run-swrng-pserver.sh pipe server script as a background process at boot time, edit the crontab configuration with the following command:

sudo crontab -e

Then add the following line to the existing crontab configuration:

@reboot /usr/local/bin/run-swrng-pserver.sh >> /var/log/run-swrng-pserver.log 2>&1