Introduction

AlphaRNG is a hardware true random number generator that communicates with the host over a secure USB channel. The full documentation is available on the AlphaRNG documentation page.

Hardware requirements

The AlphaRNG device is compatible with the USB 2.0 high-speed and USB 1.1 full-speed interface specifications and can be plugged into any available USB 2.0, USB 1.1 or USB 3.0/3.1 port.

OS requirements

  • Linux (x86, x64, ARM)
  • FreeBSD 12/13/14
  • macOS (Intel and Apple Silicon)
  • Windows 10/11 (64-bit) or Windows Server 2016/2019 (64-bit)

Windows

Device driver installation on 64-bit Windows 10/11

When an AlphaRNG device is plugged into a USB port, Windows installs the appropriate driver automatically.

Once the driver is installed, a USB Serial Device entry appears under the Ports (COM & LPT) group in Device Manager, as shown in the following screenshot:

Windows Device Manager

Using pre-built Windows utilities and components

The AlphaRNG software kit contains pre-built utilities and components for Windows. Download the latest alrng-windows-binaries.zip from the latest release on GitHub.

The pre-built utilities require OpenSSL-Win64 version 1.1.1j or newer. It can be downloaded from the Win32/Win64 OpenSSL page, in the Download Win32/Win64 OpenSSL section.

alrng-windows-binaries.zip contains the windows-x64-vs-2019 folder with executables and dependencies for 64-bit Windows, built with Visual Studio 2019.

To verify that the AlphaRNG device is installed, open a command prompt in that folder and run the following command:

alrng.exe -l

If the device is installed and ready, the output may look like this:

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

You can also run alrngdiag.exe to run the device diagnostics. It should not report any failures or warnings.

Linux

Downloading the software kit

The AlphaRNG software kit does not include binaries for Linux. Download the source code and build the utilities and components for your system. The software kit can be downloaded from the latest release on GitHub, or cloned with git using the following command:

git clone https://github.com/tectrolabs/alpharng.git

Change to the source code directory:

cd alpharng/linux-and-macOS/alrng/

Prerequisites

Make sure make, OpenSSL 1.1 or newer, libssl and a C++11 compiler are installed before running the build.

Ubuntu

On Ubuntu, use the following commands to install the required dependencies:

sudo apt install make
sudo apt install g++
sudo apt install openssl
sudo apt install libssl-dev

CentOS and Red Hat

On CentOS or Red Hat, use the following commands to install the required dependencies:

sudo yum install make
sudo yum install gcc-c++
sudo yum install openssl
sudo yum install openssl-devel

Building utilities and components

To build and install the utilities, run the following commands:

make
sudo make install

Alternatively, build with CMake 3.10 or newer (install it with sudo apt install cmake on Ubuntu or sudo yum install cmake on CentOS and Red Hat):

cmake -S . -B build
cmake --build build -j4
sudo cmake --install build

The utilities are created in the build folder. See Building utilities for more details.

The build may fail with older versions of OpenSSL. Check the installed version with openssl version and make sure it is 1.1.0 or newer.

To verify that the AlphaRNG device is installed, run the following command:

sudo alrng -l

If the device is installed and ready, the output may look like this:

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

You can also run alrngdiag to run the device diagnostics. It should not report any failures or warnings.

Retrieving random data with alrng

To retrieve 12,000 bytes of entropy (true random numbers) from the AlphaRNG device to a file over a secure connection, run the following command:

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

The alrandom kernel module

See the alrandom kernel module page for details on distributing random bytes to user space through /dev/alrandom.

Non-root access

To enable a non-root user to access the AlphaRNG device without sudo, copy the supplied 85-alpharng-usb-access.rules file to /etc/udev/rules.d/ location with the following command:

sudo cp 85-alpharng-usb-access.rules /etc/udev/rules.d/

You may need to reboot the system for the changes to take effect.

macOS

Downloading the software kit

The AlphaRNG software kit does not include binaries for macOS. Download the source code and build the utilities and components on your Mac. The software kit can be downloaded from the latest release on GitHub, or cloned with git using the following command:

git clone https://github.com/tectrolabs/alpharng.git

Change to the source code directory:

cd alpharng/linux-and-macOS/alrng/

Prerequisites

On macOS, install OpenSSL 1.1 or newer with Homebrew:

brew install openssl

Building utilities and components

To build and install the utilities, run the following commands:

make
sudo make install

Alternatively, build with CMake 3.10 or newer (install it with brew install cmake):

cmake -S . -B build
cmake --build build -j4
sudo cmake --install build

The utilities are created in the build folder. See Building utilities for more details.

To verify that the AlphaRNG device is installed, run the following command:

alrng -l

If the device is installed and ready, the output may look like this:

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

You can also run alrngdiag to run the device diagnostics. It should not report any failures or warnings.

Retrieving random data with alrng

To retrieve 12,000 bytes of entropy directly from the AlphaRNG device to a file over a secure connection, run the following command:

alrng -e -o rnd.bin -n 12000

Alternatively, you can use the SHA-256 and SHA-512 entropy extractors provided by the software kit. They generate entropy bytes by applying SHA-256 (or SHA-512) to the concatenated raw random bytes produced by both noise sources. They are implemented according to NIST SP 800-90B section 3.1.5.1, using SHA-256 and SHA-512 as specified in FIPS 180-4. The extraction input/output ratio is 2:1, so two input bits are used for every output bit.

To retrieve 12,000 bytes of entropy to a file over a secure connection using the SHA-256 entropy extractor:

alrng -x -o rnd.bin -n 12000

To retrieve 12,000 bytes of entropy to a file over a secure connection using the SHA-512 entropy extractor:

alrng -X -o rnd.bin -n 12000

FreeBSD

Downloading the software kit

The software kit can be downloaded from the latest release on GitHub, or cloned with git using the following command:

git clone https://github.com/tectrolabs/alpharng.git

Change to the source code directory:

cd alpharng/linux-and-macOS/alrng/

Prerequisites

On FreeBSD, install the gcc dependency with the following command:

sudo pkg install lang/gcc

Building utilities and components

To build and install the utilities, run the following commands:

make -f Makefile.bsd
sudo make -f Makefile.bsd install

Alternatively, build with CMake 3.10 or newer (install it with sudo pkg install cmake):

cmake -S . -B build
cmake --build build -j4
sudo cmake --install build

The utilities are created in the build folder. See Building utilities for more details.

To verify that the AlphaRNG device is installed, run the following command:

sudo alrng -l

If the device is installed and ready, the output may look like this:

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

Retrieving random data with alrng

To retrieve 12,000 bytes of entropy directly from the AlphaRNG device to a file over a secure connection, run the following command:

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

Alternatively, you can use the SHA-256 and SHA-512 entropy extractors provided by the software kit. They generate entropy bytes by applying SHA-256 (or SHA-512) to the concatenated raw random bytes produced by both noise sources. They are implemented according to NIST SP 800-90B section 3.1.5.1, using SHA-256 and SHA-512 as specified in FIPS 180-4. The extraction input/output ratio is 2:1, so two input bits are used for every output bit.

To retrieve 12,000 bytes of entropy to a file over a secure connection using the SHA-256 entropy extractor:

sudo alrng -x -o rnd.bin -n 12000

To retrieve 12,000 bytes of entropy to a file over a secure connection using the SHA-512 entropy extractor:

sudo alrng -X -o rnd.bin -n 12000

Using a supplied unique public key

The AlphaRNG software kit comes with hard-coded public keys: one RSA 2048-bit key, one RSA 1024-bit key, and for AlphaRNG V1.2 and later devices one RSA 3072-bit key and one RSA 4096-bit key. These keys are used to establish secure connections with any AlphaRNG device. In addition, each AlphaRNG is shipped with a unique public RSA 2048-bit key for exclusive use with that device. AlphaRNG V1.2 and later devices are shipped with an additional unique public RSA 3072-bit key and a unique public RSA 4096-bit key.

To retrieve 12,000 random bytes from the AlphaRNG device to a file over a secure connection using a supplied unique public RSA key (use sudo on Linux and FreeBSD), run the following command:

alrng -e -o rnd.bin -n 12000 -k public_key-XYZ.pem

AlphaRNG PQ devices establish the secure connection with post-quantum ML-KEM-1024 (FIPS 203) instead of RSA, using a public key built into the software kit; no option is needed. In addition, each AlphaRNG PQ is shipped with a unique ML-KEM-1024 public key file for exclusive use with that device; pass it the same way with -k. See the alrng documentation for details.

Using AlphaRNG devices in a virtual machine

AlphaRNG devices work with Linux, macOS, FreeBSD and Windows, and run in virtual machines under software such as VMware Workstation Player, VMware ESXi, Oracle VirtualBox, and Parallels Desktop. Throughput is usually lower in a virtual machine. For best results, connect the AlphaRNG device to a USB 3.0 or later port, or configure the USB port as a pass-through device.