Quantum Random Number Generation

Classical deterministic computing machines can only generate random numbers through the use of a pseudo random number generator (PRNG), which rely on an initial input value (seed). True randomness can be harness via dedicated hardware, but this hardware is not owned by everybody. The LfD offers you to generate true random bytes using a quantum based random number generator (QRNG) and deliver them to you via the www.

The QRNs can be queried interactively using this site or by sending a request to the QRNG REST-server.

Generation in interactive mode

Here you can generate a QRN!




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

Endpoints

/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 will try to read a specified amount of quantum random numbers (QRN) generated by the Quantis chip 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 >