This repository implements a Quantum Entropy as a Service (QEaaS) server, providing access to quantum random numbers generated by Quantis QRNG devices (PCIe-240M and USB-4M) through HTTP and CoAP APIs. It includes a C++ HTTP API, an nginx reverse proxy with TLS support (including post-quantum algorithms), and a libcoap proxy for CoAP access with post-quantum cryptography support through wolfSSL integration. The system is containerized using Docker.
The QRNG API has two hardware paths: USB uses libusb through the Quantis
library; PCIe uses the host driver's /dev/qrandom0. PCIe RNG mode already
uses card hardware post-processing; the software matrix is for USB or PCIe
SAMPLE/raw mode. --source os reads the Linux CRNG with getrandom(), including
any QRNG entropy fed to the kernel by rngd. OS XOR and getrandom() fallback
are separate switches. See the
eaas-quantis-qrng-api README for the compact
mode table and flags.
After cloning, manually initialize and update the git submodules with the following command:
git submodule update --init --recursiveFirst, run the script to set up the environment by updating submodules and copying necessary configuration files
./setup-and-clean.shThen, build the API service, the nginx reverse proxy, and the libcoap proxy
docker-compose up --buildTest the nginx reverse proxy with
docker run --network host --rm -it openquantumsafe/curl curl -k https://127.0.0.1:4433/random_number/5
docker run --network host --rm -it openquantumsafe/curl curl -k --curves kyber512 https://127.0.0.1:4433/random_number/5 In these examples, /random_number/5 requests 5 random bytes from the API. You can adjust this number to request more or fewer random bytes as needed. Test the CoAP to HTTP proxy with
docker run --rm --network host my-coap2http-server ./libcoap/build/coap-client -P coaps://[::1]/ -m get http://127.0.0.1:6065/random_number/5Similarly, this CoAP request also asks for 5 random bytes. Modify the number at the end of the URL to request a different amount of random data.
The server architecture is illustrated in the following figure. While not explicitly shown in the diagram, the HTTP API, nginx reverse proxy (with OpenSSL), and CoAP proxy (with wolfSSL) are containerized for easier deployment:
