Quantum Random Number Generator

On traditional computing systems, random numbers are often generated with pseudo random number generators (PRNGs). Quantum random numbers generators use properties of quantum physics to generate a random source of high entropy. Our laboratory offers access to a QRNG source via a simple HTTP-API. The QRNG service is backed by a ID Quantique QRNG PCIe.

Random numbers can be retrieved interactively on this site or by sending a request to the API.

Generate Quantum Random Numbers

Documentation QRNG REST API

Server URL + port

The QRNG backend listens on standard port for http or https and is reachable at lfdr.de/qrng_api

/qrng "Get random numbers"

This endpoint provides an abstraction for the access to the hardware driver of the Quantis PCI chip. After requesting quantum random numbers, the server reads the specified amount of quantum random numbers (QRN) generated from the QRNG and return it to the request originator.

HTTP - method type

GET

URL

/qrng?length&format

URL parameters

Required:

  • length=[integer] Specifies the amount of QRN-bytes the server should return. Accepted minimal value is 1 and accepted maximal value is 2147483647.

Optional:

  • format=["HEX"|"BINARY"|"HEXDUMP"] Specifies the formatting of the string representation of the returned QRN. With "HEX" format each random byte is represented by a 2-digit hexadecimal number. The resulting string is a concatenation of each hex pairs. The "HEXDUMP" format organizes the QRNs in 3 column wide rows. The first column contains a address number, the second column contains 16 2-digit hexadecimal encoded random numbers and the third row is a ASCII translation of the second row. If no value is set, the server will default to "HEX"-format.
Success response:

Returns a JSON formatted string representation of the quantum generated random number and length (amount) of returned qrns.

  • code: 200
    content: { qrn :[string], length: [integer] }
Error response:
  • code: 400 BAD REQUEST
    content: { error : "Failed to convert length param to string" }

OR

  • code: 400 BAD REQUEST
    content: { error : "length param out of bounds" }

OR

  • code: 500 INTERNAL SERVER ERROR
    content: { error : "Failed to open device" }

OR

  • code: 500 INTERNAL SERVER ERROR
    content: { error : "Failed to read device" }
Sample call:

< GET https://lfdr.de/qrng_api/qrng?length=100&format=HEX >