The alrng software utility can be used to verify the AlphaRNG installation status and to download true random bytes from a AlphaRNG.

Linux and macOS

The software kit contains C++ source files that can be included in other projects for communicating with the AlphaRNG device directly.

AlphaRNG devices are viewed by Linux as ttyACM device and by macOS as cu.usbmodem device.

After the AlphaRNG device is plugged into an available USB port, to verify that the device was successfully configured for Linux or macOS, run the following from the command line:

sudo alrng –l

When the SwiftRNG device is successfully installed and ready, the output from running the above command should look similar to this:

Device 0: 'Alpha True RNG ', S/N: F0383F99E34084B, version: 1.0

Where:

  • Device – logical device number starting with 0
  • ‘Alpha True RNG ‘ – RNG device model
  • S/N – Unique serial number assigned to a AlphaRNG device when manufactured
  • version – AlphaRNG device version

Downloading entropy bytes

Using a secure connection

By default, alrng utility uses AES-256 and HMAC-SHA256 to secure the data connection over the USB interface. This is also the slowest data transfer mode.

To download 120 KB of entropy from the AlphaRNG device to rnd.bin file using the highest level of security, enter the following command:

sudo alrng -e -o rnd.bin -n 120000

Using a non secure connection

You can disable the cipher and HMAC to achieve maximum data transfer rate over the USB interface.

To download 120 KB of entropy from the AlphaRNG device to rnd.bin with security disabled:

sudo alrng -e -o rnd.bin -n 120000 -c none

Continuous download

To continuously download entropy from the SwiftRNG device to rnd.bin file using the highest level of security:

sudo alrng -e -o rnd.bin

Other commands and options available

The complete list of commands and options available with alrng can be retrieved using the following command:

sudo alrng -h

Non-root access on Linux

To enable a non-root user to access the AlphaRNG device, simply copy the supplied 85-alpharng-usb-access.rules file to /etc/udev/rules.d/ location. You may need to reboot the system for the changes to take effect. The non-root user access can be verified using the following command:

alrng –l