Skip to content
Kevin Fasusi edited this page Oct 30, 2024 · 1 revision

A command line interface is available for the QRNG. The utility provides several features to assist in the use of the generator and monitor raw output and statistics.

Commands

The commmands below are documented in the doc strings of the utility and are accessible by running:

$ qrng --help

This wiki elaborates on the detail for some of the flags.

Stream

stream - monior the raw binary output of the QRNG:

$ qrng stream --device "path-to-usb-device"

Statistics

stat - display summary statistics of the output:

$ qrng stat --device "path-to-usb-device"

The stat command output some summary statistics for the generator. The summary includes the sum total number of $0$ and $1$ generated, their respective individual count, a ratio for the binary output and the time taken by the microcontroller to generate 128-bit intialisation vectors.

Total: 57394  0: 38009 1: 19385 0/1: 0.6622469248/0.3377530752  128-bits per: 580.690917ms

Private keys

generate privateKey - generate private keys of any size (size = speed penalty depending on the number requested)

$  qrng generate privateKey --device "path-to-usb-device" --size 256 --number 2  
0000000100010001000001000100000001000100000100000001000000010100000000010100000000010100000101000000010101000000000101010000000001010100000000010100000001010000010101000000010101000000010101000000010001000100010000010100010000000100010000000101000100000001
0001000001000000010101000000010101000000010100000101000001000100010000010100010000010000010100010000000100010000000100010100000001000101000000010000000001000100000100000001010100000001010100000001010100000001000000010101000000000101000000000101010000000101

The genrated keys can also use XOR:

$ qrng generate privateKey --device "path-to-usb-device" --size 128 --number 2 --xor 
0000010100000000010000010101010101000001000100000100000001010100010101010000010101010101000100000000010100000100010000000100000101000001000001000100010100010000010101000001000101010101000001010100010000000001000100010100000101010001010101000000010000010000
0000010101000101010000010100000101010001000000000000000000010001000101010000010001000101010000010001000101010000000100010000010001000000010000010000000101000000000100000100010001010000010000000000000100010000000001000001010000010100010101000000010100000000

SHA256

$ qrng generate sha256 --device "path-to-usb-device" --size 128 --number 10 
65cd82639c3c428fa6c308a8699c3f846fc59e27491dfa89a40cf78173c8612c
5d543e028189bf8a65e48697127a4e25f40f91c4b267a67d6e4462ea34dd72c6
ae9634b0ce14bda703ca0c37687f41508ef40e9b39753ab5815af2bbaf58dae6
44c5d9e14e5ed228297c0839ef9cf4be8ba43018fe424b1a4c82ce346d1b5f1a
d57a73037f97719cdbaffafc06d6b433d5bdab5cf29f3affcac396afd0a42f6f
9c97cb38fd75f12d7c61aaf3476530990955e58b751117e7102a59e54d6148b2
495e62d1b5ae721850f8c6e767ba055003ab60fdfb7ac0084f56957b9fe15f2f
3b8533a3dc3e16e2d4b768942a76da09482323b7b704e2534f2e6c41a5c4d79e
7816b401869d87f26bc870e2144f81fd93273936be04b00250e7af07f7ebef10
e45ed63643525f475cb72a7fae848d125cf076992c34c159bcf250f2e2769ada

Clone this wiki locally