You are on page 1of 13

Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

Contents lists available at ScienceDirect

Journal of King Saud University –


Computer and Information Sciences
journal homepage: www.sciencedirect.com

Quantum true random number generation on IBM’s cloud platform


Vaishnavi Kumar, John Bosco Balaguru Rayappan, Rengarajan Amirtharajan,
Padmapriya Praveenkumar ⇑
School of Electrical & Electronics Engineering, SASTRA Deemed University, Thanjavur 613 401, India

a r t i c l e i n f o a b s t r a c t

Article history: Random numbers are the lifeline of any cryptographic operation in modern computing. Quantum True
Received 26 September 2021 Random Number Generator (QTRNG) can yield real random data to replace random-looking periodic
Revised 8 January 2022 sequences. Here, we present the fastest QTRNG on factual Quantum Computational Devices (QCD) locally
Accepted 22 January 2022
on our device to save time. To construct a random number generator, the IBM Q Experience called Qiskit
Available online 31 January 2022
is used. The ease of our source Hadamard gate pooled with its verifiably sole randomness is imperative
for attaining quantum random number generators at no cost. The inner matrix product of the square of
Keywords:
the Hadamard gate is proved to be identified in the quantum lab. Applying the H gate twice on the quan-
QTRNG
QCD
tum register cancelled out the H gate pair. It acted as a single Hadamard gate that was practically visu-
QISKIT alised using the IMB Q experience. The 24-qubit random number is experimented with and investigated
NIST in this work. The min-entropy of such generated random numbers is 0.0007244 with the worst-case
Hadamard gate entropy value of 0.999507. Besides, subsequent verification of genuine randomness was confirmed by
steering restart experimentation, & the statistical properties of TRNG were evaluated over autocorrela-
tion study, National Institute of Standards and Technology (NIST) SP 800-90B & 800-22 tests.
Ó 2022 The Authors. Published by Elsevier B.V. on behalf of King Saud University. This is an open access
article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).

1. Introduction (Ma et al., 2016). In cyber security, cryptography and scientific sim-
ulations, random numbers play a significant role. A crucial man-
Communication security has become even more critical, both in date for information security is a high-quality, high-speed
individual and international terms (Bennett and Brassard, 2020). random number. Even when the core algorithms are secure, in
The ever-increasing sizes of private documents exchanged the interim, randomness generation with poor implementations
between connected devices push the necessity for increasingly effi- would uncover severe security gaps for cryptosystem
cient, secure communication. Forthcoming information technolo- Random number series consists of liberated numbers with no
gies such as Edge computing, Blockchain, and big data depicts a correlation to each other. It is challenging to generate something
massive quantity of confidential data associated with customer unpredictable in a computer (Huang et al., 2021). RNG outputs
privacy to the internet has been increased day by day (Kfoury are classifications that are created by using a virtual or physical
et al., 2019). Data security faces significant challenges through source. So, have to resort to the physical world to make measure-
increased computing power and enormous data in our ments on something that behaves randomly, and from there, ran-
technology-driven world. It is overwhelming to handle millions dom numbers can be extracted (Gennaro, 2006). With an image
and possibly even billions of data records. A random number of randomness outlook in the finger, consideration can swing to
required for the key generation process is vitally something a random number generators and the way they are generated. Many
device made a vital key and cannot know its value until generated random number generators are available, based on the generation
process classified as software random number generators (deter-
⇑ Corresponding author at: Department of Electronics & Communication ministic software) or hardware RNGs (physical phenomenon). True
Engineering, School of Electrical & Electronics Engineering, SASTRA Deemed random number generator and pseudorandom number generator
University, Thanjavur 613 401, India. (PRNG) are the two primary classifications of the random number
E-mail address: padmapriya@ece.sastra.edu (P. Praveenkumar). generators via computer.
Peer review under responsibility of King Saud University. As the name pseudo put headfirst, pseudorandom numbers are
not random in the fashion might assume (Uchida et al., 2008).
PRNGs produce a sequence of numbers using mathematical formu-
laries or just precalculated tables; hence they appear random but
Production and hosting by Elsevier are predetermined. Applications spanning statistical analysis to

https://doi.org/10.1016/j.jksuci.2022.01.015
1319-1578/Ó 2022 The Authors. Published by Elsevier B.V. on behalf of King Saud University.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

secure communications need genuinely random numbers (Bennett


and Brassard, 2020). True randomness is impossible using only Random Number Methodology Limitations
classical processes in a widespread application, and it plays an Generator from
important role. available literature
Quantum mechanics has offered fascinating new protocols to Leilei (Huang et al., Four different Platform run for
provide the juncture between computer science, communications, 2021; Zhang quantum devices more than a year
information theory, and physics has a credible claim to be one of et al., 2021) that produce continuously for
the best sources of randomness (Bennett et al., 1992). Moreover, random numbers the betterment of
it provides a loftier source of randomness because measurements are XORed, which the results.
of some quantum particles have fundamentally unpredictable enhance practical
results. So, quantum mechanics is great because it tells us that security.
when an object is taken and measured, the result obtained is Yanbao (Zhang Photonic time-bin 8192 blocks of
purely unpredictable, so one can use quantum mechanics to gener- et al., 2021) states random bits are
ate random numbers. (Gehring et al., measurements generated in every
Quantum mechanics offers interesting new protocols and 2021) certifiable real- 0.12 s.
becomes a revolutionary act in the intersection between computer time randomness
sciences and information theory. In the 1920s, it subsidised our is demonstrated
awareness that created technological advances in our understand- with low latency.
ing that completely changed our basis of the world. Quantum key Tobias (Gehring 2.9 Gbit/s real- Some variations
distribution and established technology are thought to be hard for et al., 2021; Li time generation become apparent
classical computers, showing that quantum mechanics profoundly et al., 2021) rate is over longer times
impact how we think about security, cryptography, and computa- demonstrated and leads to a result of
tion. Another significant well-established quantum technology aims to determine poorer min-
that robbed a century to master and started booming is quantum the proposed entropy at periods
random number generation. This quantum revolution could shape, system H-min than expected.
again, our society and economy. Randomness has many uses in value.
science, art, statistics, cryptography, and gaming. Today, the tech- Yuanhao (Li et al., QRNG is made of a A decrease of min-
nology offers security primitive in the long term is a viable propo- 2021; Jacak Super-luminescent entropy is
sition that is increasingly gaining traction. Apart from its technical et al., 2020) emitting diode resulting due to
merit, this quantum random number generator would have fasci- with an increase in the temperature
nated many researchers to bud into this technology (Cheng et al., temperature increase in SLED.
2019). effects that have The output fails in
In the past two decades, extensive welfares have been appealed been studied with the NIST statistical
over the quantum random number generators. Recent review arti- a numerical test.
cles and references are included for the subject review (Ma et al., method. Postprocessing
2016; Herrero-Collantes and Garcia-Escartin, 2016). Unpredictabil- cannot
ity is the vital variance among QRNGs and classical one. Through counterattack the
the assured principles of quantum mechanics, predictable loop- temperature
holes in classical random numbers are avoided by the QRNGs. increase.
Therefore, quantum devices show their dominance over classical Janusz E. (Jacak The proposed Conventionally
ones. They are well-thought-out as the unpredictable output pro- et al., 2020; protocol shifts used randomness
ducing the only device in a high information security level, such Herrero- randomness tests can’t detect
as authentication called quantum devices to show its dominance Collantes and testing to a trusted the long-range
as an effect of the principle mentioned earlier. Garcia-Escartin, third party classical
Several procedures have been applied for producing a different 2017) arbitrarily and correlations, may
variety of QRNG according to quantum randomness sources, till decides to make a overlay a trace for
now (Abbott et al., 2014; Stefanov et al., 2000; Dynes et al., randomness test the determinism.
2008) weak coherent state arrival time (Wayne and Kwiat, 2010; without violating
Wahl et al., 2011; Li et al., 2013; Nie, 2014), detecting the counts the publicly
of the photon or the vacuum fluctuations (Sanguinetti et al., performed analysis
2014; Gabriel et al., 2010; Symul et al., 2011; Steinlechner et al., on the generated
2011)in the field of optic and the phase fluctuations in sponta- bit secret.
neous emission (Shen et al., 2010). To the model assumed practical
devices may not be faithful. QRNGs protocols are in rotation when
the assumptions and characterisations on the devices are relaxed.
Till now, quantum random number generators were developed
At least eight existing commercial products have gone from the
based on radioactive decay, based on noise, optical quantum gener-
lab to the shelves using different QRNGs quantum phenomena
ators based on branching path generators, branching path genera-
(QRNG, 2021). All scientific arenas will be explored, from cryptog-
tors, time of arrival generators, photon counting generators,
raphy to machine learning, but the main hindrance is the reliability
attenuated pulse generators, vacuum fluctuations, the phase noise
of quantum systems (Stevanović et al., 2007). Measurement of a
of lasers, amplified spontaneous emission, Raman scattering, optical
quantum system is a simple task for the researchers, but the mea-
parametric oscillators. Non-optical quantum number generators,
surements being made of a quantum system and not in a classical
device-independent quantum random number generators
system in disguise is rigid to prove.
(Herrero-Collantes and Garcia-Escartin, 2017). With the numerous

6454
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

application programming interfaces of different devices, it is thought- Using a Bloch sphere, possible states for a qubit can be visu-
provoking to realise the underlying principles for end-users and alised. Only at the North Pole or the South Pole classical bit is pre-
choose from the available QTRNGs. However, users found it tough sent remaining surface is not accessible to a classical bit, while a
to estimate the quality and performance of QTRNGs since there are qubit is present at any point on the surface or inside it. A qubit
no officially released universal QTRNG standards so far. Moreover, can be represented in its pure state as
online security applications pleasing, sustainable random number ser-      
 
vices with high stability requests are not achieved due to the usual Wi ¼ cos h 0i þ eiW sin h j1i ð3Þ
 2  2
lack of real-time randomness in individual QTRNGs.
This proposed work comprehended the platform on the first
quantum computers, hand-me-down by anyone. Figured universal 2.2. Quantum register
quantum computers are the first industrial initiative handy to a
far-reaching onlooker through cloud access is the launched IBM Q In a Boolean computer, classically originated bits in the register
experience (Quantum Computing, 2021). The tool Qiskit has also do not interface, whereas this restriction is confined in a quantum
been launched to run experiments on those machines (Xu, 2019). register. A bit can be in a state of coherent superposition. The quan-
The IBM quantum device investigation was tested with a random tum register is a structure encompassing several qubits, and it is
number generator (Quantum Computing, 2021). The proposed quan- the tensor product of different qubits. By looking at the study of
tum true random number generator made out of universal quantum 2 pure qubits in superposition |a0 i = p1ffiffi2 (|0i + |1i) and |a1 i =
Hadamard gate provided random numbers are probably random. p1ffiffi
2
(|0i - |1i), using the quantum register definition |ai = |
Since quantum true random numbers are the major requirement of
quantum key distribution, the proposed work is focused on random a0 i|a1 i = p1ffiffi2 (|00i - |01i + (|10i - |11i) it tracks that it is skilful
number generation. The consecutive arrangement of the Hadamard of storing all the possible values spanned by two qubits at the same
gate structure is justified in the proposed work. Rather than individ- time.
ual device manufacturers, a universal cloud centre is more trustwor-
thy. The highlights of the proposed work are as follows: 2.3. Classical register

1. Very first work on QTRNG incorporating Hadamard gates on The classical register stores the spanned qubits values simulta-
IBM cloud platform. neously. Classical registers are typically used for capturing mea-
2. QTRNG comprises 24 qubits, quantum registers, classical regis- surement results.
ters and Hadamard gate.
3. Identical Hadamard structures have been investigated for yield- 2.4. Hadamard gate
ing better results.
4. This scheme offers a min-entropy of 0.0007244, thus resulting Very high-skilled physics need to be applied to bring a par-
in the worst-case entropy of 0.999507. ticle into a superposition state. By applying a specific gate to
5. Evidence of true randomness through restart experiment and the qubit, brings a qubit into superposition states. The gate that
autocorrelation analysis. acts on a single qubit is the Hadamard gate and can be repre-
6. Compliance to NIST test 80-90B and 800–22 batteries of test. sented by 2  2 matrices. A qubit in state |0itransports the
7. No postprocessing functions have been adopted. qubit to a superposition state once the Hadamard gate is
8. T-Tuple test estimate gives the lowest value of entropy, whose applied, anywhere the probability of measuring the value 0 is
worst-case entropy is 0.999930. similar to that of measuring 1. The matrix depiction of the
9. The proposed QTRNG is device-independent. Hadamard gate is expressed in Eq. (4), and Dirac notation is
given in Eq. (5) & (6).
2. Preliminaries  
1 1 1
H ¼ pffiffiffi ð4Þ
2 1 1
2.1. Quantum bits
j0i þ j1i
Quantum Bits, also known as qubits or qbits, are the basic units j0i ! pffiffiffi ð5Þ
of Quantum computing, just like binary bits for classical comput- 2
ing. A classical bit can be recognized in one of the two states,
j0  j1i
namely 0 or 1, where a qubit can be in both of these states while j1i ! pffiffiffi ð6Þ
settling on one or the other only when a measurement of the states 2
is made. We would use |0i to represent pure 0 quantum state, so a Matrix representation of H using the tensor product is depicted
qubit is a vector in the vector space spanned by |0i& |1i basis vec- as follows:
tors. Now a qubit is an element of this vector space, and a qubit    
1 1 1 1 1 1
function |Wi can be symbolised as H2 ¼ H  H ¼ pffiffiffi  pffiffiffi
  2 1 1 2 1 1
x 2     3 2 3
jWi ¼ xj0i þ yj1i ¼ ; j xj 2 þ j y j 2 ¼ 1 ð1Þ 1 1 1 1 1111
1 1
16 1 1 7 6 7
y
6 1 1 7 1 6 1  11  1 7
¼ 6    7 ¼ 6 7
Applying the Kronecker product on greater than one combina- 24 1 1 1 1 5 2 4 11  1  1 5
tion of a qubit, for example, two qubits, 4-dimensional space is 1 1
1 1 1 1 1  1  11
produced.
0  1 0 1 Two consecutive Hadamard gate applied on the single-qubit
0 0
    1  matrix representation is given below:
1 0 B C B C        
B 1 C B1C
j01i ¼  ¼ B  C ¼ B C ð2Þ ^  H ¼ p1ffiffiffi 1 1 p1ffiffiffi 1 1 ¼ 1 2 0 ¼ 1 0
0 1 @ 0 A @ 0A HA
0  2 1 1 2 1 1 2 0 2 0 1
1 0

6455
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

2.5. Qiskit Hadamard gate plays a significant role in the generation of ran-
dom numbers. Here an investigation is conducted on the H gates
Through Qiskit (Xu, 2019), an open-source programming frame- by its arrangement. Even-numbered Hadamard gates don’t repli-
work, IBM Quantum simulators and quantum devices can be easily cate randomness, so the odd number of gates is added in every
accessed over the cloud. The software offers tools for generating qubit row identically. Quantum true random numbers are received
and operating quantum programs stances amongst quantum algo- for all the odd-numbered identical arrangements with slight vari-
rithms from one side and running them on prototype quantum ations in their values briefly described in the result section. The fol-
devices from the other. It translates common programming lan- lowing algorithm portrays the working principle of the proposed
guages like python into quantum machine language. For quantum methodology architecture.
programming IBM device environments, we need support from a
python package called Qiskit. For applying all kinds of conversions Procedure: Quantum True Random Number Generation
over qubits, we found that Qiskit built-in functions are beneficial Input: No of qubits, shots;
for creating quantum registers and circuits. Run the kernel;
Output: random numbers;
3. Proposed methodology Begin
Step 1. Log in to the IBM quantum computer
The proposed framework targets to measure the unpredictable Step 2. Enter into the quantum launch lab
and challenges to reproducing the sequence of random numbers. Step 3. Launch server
The primary source of the quantum true random number genera- Step 4. Qiskit 0.29.0
tion is obtained from IBM’s quantum lab. This method employs Step 5. Import standard Qiskit libraries
the Hadamard gate for generating random numbers. The proposed Step 6. Set the number of quantum registers and classical
method is comprised of two sections. Section 1 explains the quan- registers
tum programming with Qiskit, while Section 2 deals with the con- Step 7. Apply Hadamard gate to all qubits
struction of the random number generation. Proposed modified Step 8. Apply measurement to all qubits
QTRNG comprises five sets of differently counted H gates wherein Step 9. Run cell by cell
each gate is made of an odd number of counts beginning from 1 to Step 10. Enter the number of qubits
9. The hypothesis of this work is to use the Hadamard gates with Step 11. Specified the number of qubits as 24
measurement by using 24 qubits and 65,536 shots in Step 12. Enter the number of shots
ibmq_qasm_simulator. Step 13. Specified the number of shots as 65,536
Step 12. Number of random numbers = No of qubits  No of shots
4. Section 1 End procedure

4.1. Quantum programming with Qiskit

IBM’s python package Qiskit supports both simulator and actual


device quantum programming. Quantum registers and circuits are The above Fig. 2(a). represents the graphical representation of how
created through the Qiskit built-in functions. By connecting to the one can access a quantum computer. Once the user enters the IBM
IBM devices in the real world, quantum programs are executed. Quantum Experience by signing in, it will allow us to enter the lab
Always quantum device mingles with a traditional computer. For where we can use the qubits by quantum register wires. The pro-
storing the states of the qubit, the equal number of bits are manda- posed QTRNG is designed on the IBM Quantum Lab. The user uses
tory in a quantum circuit execution as follows: the classical computer to enter into the IBM Quantum Experience
by the token provided by the IBM for the individual user. Once
the user logged in to the lab, IBM quantum composer and IBM quan-
from qiskit import*
tum lab will be available. Composer can be used for building the
QR = QuantumRegister(N)
quantum circuit. But there is some limitation in the accessing of
CR = ClassicalRegister(N)
qubits. The lab allows to execution of the quantum circuit by incor-
ckt = QuantumCircuit(QR,CR)
porating the backend providers offered by the Qiskit. The developed
cktmeasure(QR,CR)
circuits are sent to the IBM quantum computer as jobs and the
results are retrieved back from the quantum computer.
Role of Qiskit:
It offers tools for generating and manipulating quantum pro-
This work used Qiskit python package programming language with grams and translates common programming language into quan-
IBM platform and Jupyter notebook (Anaconda 3) for different ran- tum machine language. It integrates the quantum algorithms and
dom number generation. the physical quantum device for performing quantum computa-
tion. Quantum languages are referred to as open quantum assem-
5. Section 2 bly language (OpenQASM) in Qiskit, which provides instruction to
the actual quantum device. Slight syntactical changes with the new
5.1. Generation of quantum true random number version announcements do not significantly alter the software
functionality though the software varies.
Random numbers from the generation of keys to encryption Role of IBM:
systems play a vital role in cryptography and other applications. The same gate set from Fig. 2(b). is provided by all the quantum
Unfortunately, the random numbers produce only their pseudo- computers developed at IBM. Every probable quantum computa-
sequence. Because of the nature of quantum computing, a real ran- tion can be recognized using only the quantum from this set. Build
dom number generator is offered. A five qubit quantum register is quantum circuits with a drag and drop interface, run on simulators
needed if we wish to produce an order of random numbers bits of or real quantum hardware, and manage the files and jobs within
length 25 valued from 0 to 31, as in Fig. 1. the workspace. Dynamically simulate circuits while editing them,
6456
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

Fig. 1. Representation of 5 qubit Quantum circuit with a) single Hadamard gate b) Three consecutive Hadamard gate c) Five consecutive Hadamard gate d) Seven consecutive
Hadamard gate e) Nine consecutive Hadamard gate f) Snapshot of working environment.
6457
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

Fig. 1 (continued)

inspect circuit performance across various hardware.IBM offered a The bit distribution in all the sequences is different from each
service through 5 simulators and 24 systems as of now. other, which confirms the true randomness.
A random number has been generated by repeating the above For this experiment, there were five sets of 128 bits from five
steps repeatedly, and the order of entirely random numbers will different structures, single H gates, three H gates, five H gates,
appear. Similar to a hyper-positioned qubit where the likelihood seven H gates, and nine H gates. And it is evident from the figure
of zero or one is 50%, this method of generating a random number that it is entirely different from each other which indicates the
is also simple. All possible combinations could appear in the out- strong randomness of the proposed method. The results of the
put, and it differs every time to use either the highest or lowest restart test implemented ensured that there is no pattern or
probability. One of the possibilities is shown in the below Fig. 3. dependency between samples. Thus there is no chance for the
Qubits are converted from clustering state into the uniform observer about the knowledge of the obtained samples to guess
superposed state by using the Hadamard gate. Once the quantum the next sample.
program is typed in the lab, we can start running it once; enter
the required number of qubits when it asks for a qubit. The snap- 6.2. Autocorrelation test
shot of the working environment is given in Fig. 1(f).
Autocorrelation determines the dependence between numbers
6. Results in a sequence, and it is also a statistical test. Autocorrelations
should be near zero for any, and all shift-lag parameters to be ran-
The proposed random number generation was implemented dom. The output obtained is tested for its correlation analysis. The
using IBM lab. This effort implies that the QTRNG aided random autocorrelation function is computed by considering the mathe-
numbers cannot be reproduced, owning high randomness. The matical formula.
design was tested with five structures. True randomness was cer-
j AD j
tified over and done with the restart experiment, autocorrelation AC ¼ ð7Þ
analysis. The various statistical properties of QTRNG have been
N
scrutinized by conducting NIST 800-90B and 800–22 tests.

6.1. Restart experiment N – Size of the sequence


S’ – Shifted bits
Restart experiment is the ultimate analysis to evidence that the A – Number of identical bit positions between S & S0
bits generated are statistically independent. Furthermore, it helps D – Number of non-identical bit positions between S & S0
to discriminate the TRNG from the PRNG. This testing aims to
record the continuous series of random bits and scrutinize its reap- The above figure shows that both positive and negatively corre-
pearances. 128 bits of 5 different sequences of the QRNGs with the lated elements are independent of each other. The result analysis
aid of 1, 3, 5, 7 and 9 H gate structures were chosen to carry out shows no repeating patterns over different delay times from 1 to
this analysis. Fig. 4. shows the results of the restart experiment. 1024. The restart experiments demonstrate that the output of the
6458
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

Fig. 2. a) Graphical representation of accessing to quantum computer. b) Quantum gates available on IBM Quantum Compose

Fig. 3. Probability of 5 qubit true random number representation.

6459
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

Fig. 4. Restart experiment analysis of 24 qubit QTRNG: a) 1H gate b) 3H gate c) 5H gated) 7H gate e) 9H gate.

QTRNG acts genuinely random and not pseudorandom. Identifica- mash of independent noise sources. It describes how to validate
tion of single delta function on origin indicates the bits are physical hardware and non-physical software noise sources. The
aperiodic. random number obtained using 24 qubits with 65,536 shots is
2465,536 bits in a single execution. While converting the
6.3. NIST 800-90B statistical tests obtained text file into bin file (100 MB data of bin file), it is loaded
as 14 crore samples of 128 distinct 8-bit-wide symbols with the
Entropy ensures the concept of randomness. Shannon, Renyi, number of Binary symbols as 118 crores approximately on Ubuntu
and min-entropy are the promising types of entropy. Min- and carried out the test. This test gives assurance that a dataset is
entropy is the standardised means of estimating the quality of a IID or non-IID and offers an estimation for min-entropy for data
source of entropy and also the utmost pertinent measurement provided. Statistically, the min-entropy is defined as:
for cryptographic security links to the difficulty of guessing. The H ¼ min1ik ðlog 2 ðpi ÞÞ ð8Þ
entropy source needs to be an independent noise source or a mish-
6460
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

Table 1
NIST 800-90B Minimal Entropy Estimation Results (different number of H gate applied on every qubit).

1 Type of test Single H gate Three H gate Five H gate Seven H gate Nine H gate
1 Entropic statistic estimates: Most common value estimate 0.8319/1 bit 0.8308/1 bit 0.8264/1 bit 0.8275/1 bit 0.8284/1 bit
Collision test estimate 1.0000/1 bit 1.0000/1 bit 0.9214/1 bit 1.0000/1 bit 0.9128/1 bit
Markov test estimate 0.8485/1 bit 0.8516/1 bit 0.8406/1 bit 0.8449/1 bit 0.8492/1 bit
Compression test estimate 0.5676/1 bit 0.5695/1 bit 0.5639/1 bit 0.5723/1 bit 0.5644/1 bit
2 Tuple estimates: T-Tuple test estimate 0.0001/1 bit 0.0001/1 bit 0.0001/1 bit 0.0001/1 bit 0.0001/1 bit
LRS test estimate 0.0003/1 bit 0.0003/1 bit 0.0003/1 bit 0.0003/1 bit 0.0002/1 bit
3 Predictor estimates: Multi most common in window 0.8319/1 bit 0.8308/1 bit 0.8264/1 bit 0.8275/1 bit 0.8284/1 bit
prediction test estimate
Lag prediction test estimate 0.8213/1 bit 0.8213/1 bit 0.8227/1 bit 0.8219/1 bit 0.8251/1 bit
Multi markov model with counting 0.0391/1 bit 0.0710/1 bit 0.0772/1 bit 0.0859/1 bit 0.0696/1 bit
prediction test estimate
LZ78Y prediction test estimate 0.8319/1 bit 0.8308/1 bit 0.8264/1 bit 0.8275/1 bit 0.8284/1 bit
4 H_original: 0.0007 0.0008 0.0007 0.0006 0.0006
5 H-bitstring: 0.0001 0.0005 0.0005 0.0005 0.0001
6 Min (H-original, 8H_bitstring) 0.000749 0.000805 0.000734 0.000661 0.000673
7 Worst case entropy (2m ) 0.999480 0.999442 0.999491 0.999541 0.999533

Table 2
NIST 800–22 Statistical test Results for tests 14 and 15.

T14- Random Excursion Test


Single H gate Three H gate Five H gate Seven H gate Nine H gate Conclusion
S C P C P C P C P C P
4 3.6001 0.6082 5.4491 0.3635 4.5455 0.4738 4.7864 0.4424 6.5766 0.2540 Random
3 6.7269 0.2417 9.1033 0.1050 1.8361 0.8713 11.867 0.0366 2.9747 0.7038 Random
2 7.4797 0.1873 3.1997 0.6692 2.3691 0.7960 6.9593 0.2236 0.9003 0.9701 Random
1 5.0537 0.4093 3.3190 0.6509 5.6541 0.3413 4.4967 0.4803 8.4364 0.1337 Random
+1 1.2582 0.9391 1.8220 0.8731 2.9968 0.7004 2.9046 0.7146 6.5051 0.2601 Random
+2 4.3517 0.4999 4.0964 0.5356 3.3681 0.6434 0.4262 0.9945 5.7381 0.3325 Random
+3 3.7240 0.5897 1.5029 0.9127 1.6843 0.8908 1.3681 0.9277 5.2767 0.3830 Random
+4 1.6312 0.8974 4.5985 0.4668 1.7567 0.8816 3.6107 0.6066 1.5376 0.9086 Random
T15- Random Excursions Variance Test
S CT P CT P CT P CT P CT P Conclusion
9.0 1653 0.9331 401 0.4762 736 0.5104 769 0.2628 433 0.1534 Random
8.0 1627 0.8373 417 0.3574 716 0.5781 739 0.3320 430 0.1368 Random
7.0 1686 0.9502 450 0.1780 688 0.7038 752 0.2520 433 0.1025 Random
6.0 1758 0.6577 486 0.0588 647 0.9462 778 0.1415 450 0.0469 Random
5.0 1725 0.7644 458 0.0848 635 0.9702 745 0.1903 411 0.0973 Random
4.0 1637 0.8140 407 0.2305 633 0.9494 689 0.3799 366 0.2399 Random
3.0 1531 0.2722 362 0.5283 597 0.5992 684 0.3297 353 0.2504 Random
2.0 1506 0.0955 339 0.7688 588 0.4101 637 0.6311 306 0.7196 Random
1.0 1586 0.1325 338 0.6383 615 0.5020 597 0.7524 300 0.7091 Random
+1.0 1753 0.1666 332 0.8142 603 0.3139 576 0.3587 256 0.1468 Random
+2.0 1776 0.3039 331 0.9099 600 0.5287 552 0.3538 255 0.3889 Random
+3.0 1732 0.6482 305 0.7130 690 0.5234 529 0.3109 270 0.6970 Random
+4.0 1756 0.5875 299 0.6894 767 0.1759 491 0.2047 280 0.8631 Random
+5.0 1820 0.3969 288 0.6198 743 0.3321 478 0.2139 273 0.8035 Random
+6.0 1805 0.4914 264 0.4641 727 0.4579 462 0.2068 247 0.5823 Random
+7.0 1765 0.6591 257 0.4537 738 0.4424 435 0.1688 239 0.5499 Random
+8.0 1764 0.6846 254 0.4665 734 0.4926 402 0.1271 247 0.6376 Random
+9.0 1820 0.5376 243 0.4304 759 0.4155 335 0.0575 269 0.8249 Random

S – State, C – Chi-squared, P – p-value, CT – Counts.

For consecutive raw dataset Horiginal is estimated, which is the ness is achieved. Among the ten estimators, the T-Tuple test esti-
minutest entropy per sample. An additional estimation per bit mate gives the lowest value of entropy 0.0001/1 bit, whose
Hbitstring is also estimated for the case of a non-binary dataset. worst-case entropy is obtained as 0.999930.
Lastly, the min-entropy estimate is firmed as:
6.4. NIST 800-22 statistical tests
H ¼ minðHoriginal ; Hbitstring ð9Þ
This section evaluates the proposed random number generator
The test confirms the data is non-IID. In this work for the non- for cryptographic applications, and the produced random number
IID data, all the ten estimators are performed. From Table 1, we can from 19 sequences is investigated. The created sequence is in bin-
observe how the entropy for the majority of the test is over 0.8, and ary, suitable for the NIST test, especially for binary data. The NIST
the min-entropy is taken as the average from all the available five statistical test comprises of fifteen tests methods, out of which
sets of value achieved as 0.0007244 with worst-case entropy is also thirteen test results are presented in Fig. 6a) & b), and the remain-
calculated as 0.999507, which is closer to one indicates random- ing two test result is given in Table 2. The random bits were anal-
6461
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

Fig. 5. Autocorrelation analysis of 24 qubit QTRNG: a) 1H gate b) 3H gate c) 5H gate d) 7H gate e) 9H gate.

ysed with the NIST Test suite by considering 224 bits of data. Note above. The table gives out the statistical test results, and there is
that random numbers were generated numerous times, but only a clear tendency that as the number of Hadamard gates on every
five results were discussed. Each test’s emp-value falls between qubit increases, the p-value slightly increases. Each run is con-
0.055 and 0.98; the result is considered successfully passed since ducted with data collected on different days. The referred works
greater than 0.1. The proposed results show that most bitstreams of literature did not mention their full NISTtest results(Marangon
pass the test with a significance level closer to the value of 1. et al., 2017; Yang, 2020; Xu et al., 2021) and addressed only the
The above-presented NIST 22 test results from T1 to T13-b is entropy value. As described in Fig. 5 and Table 2, all 15 tests for
briefly described with the test names below. randomness are passed (see Table 3).
The proposed protocol is performed on the quantum computer
T1 –Frequency Test (Monobit) of the IBM cloud, and hence the operability of our protocol is
T2 – Frequency Test within a Block proved. The final random numbers could be reflected true random
T3 –Run Test numbers based on the results of the NIST statistical Test, restart
T4 – Longest Run of Ones in a Block test and autocorrelation tests. Using our novel quantum true ran-
T5 –Binary Matrix Rank Test dom number generator, it is possible to generate megabit rates
T6 –Discrete Fourier Transform (spectral) Test rather efficiently. The observed results of the proposed novel
T7 –Non-overlapping Template Matching Test QTRNG are getting better by using 9H gates on the quantum regis-
T8 –Overlapping Template Matching Test ter wires. The results of the QTRNG followed the properties of its
T9 - Maurer’s Universal Statistical Test quantum gates and produced the randomness visible through the
T10 –Linear Complexity Test obtained values. Practical justification for the 2  2 Hadamard gate
T11-a –Serial Test 1 of order 4 inner product in IBM’s quantum lab is provided. Hada-
T11-b –Serial Test 2 mard gate was admitted once, thrice, and applied nine times on
T12 –Approximate Entropy Test the quantum register. The results are getting better while applying
T13-a –Cumulative sums (forward) Test H gate applied more than once in a register. Identical arrangement
T13-b -Cumulative Sums (reverse) Test of the gate gives fruitful results in some of the tests from NIST 800-
22 (Frequency test within a block, Longest runs of ones in a block,
T1-T13 tests results are described in Fig. 6. The remaining two Binary matrix rank test, Discrete Fourier Transform spectral test,
tests are briefly described with their P-values in Table 2 given Non-overlapping template matching test, Overlapping template
matching test, Linear complexity test, Approximate entropy test),

6462
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

Fig. 6. NIST 800–22 Statistical Test Result a) Test 1–7b) Test 8–13.

6463
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

Table 3
performance comparison with available literature.

Test (Huang et al., 2021) (Bisadi et al.,) (Ferreira et al., 2021) (Smith et al., Jun. 2019) (Smith et al., 2019) Proposed method
T1 0.274 0.1520 0.2861 0.5261 0.156 0.7293*
T2 0.871 0.0025 0.2868 0.4597 0.567 0.4580
T3 0.990 0.8272 0.3298 0.3070 0.512 0.8478
T4 0.248 0.5181 0.4817 0.8446 0.668 0.2101
T5 0.720 0.9940 0.3611 0.5503 0.660 0.3308
T6 0.972 0.0297 0.0401 0.8201 0.445 0.1925
T7 0.501 0.0063 0.5666 0.0108 0.483 0.7209*
T8 0.679 0.8831 0.4064 0.0000 0.777 0.4053
T9 0.756 0.1388 0.1404 0.0474 0.101 0.8617*
T10 0.087 0.7212 0.2550 0.4011 0.714 0.1408
T11 0.722 0.8237 0.3376 0.0636 0.747 0.7206
T12 0.265 0.3252 0.2854 0.9216 0.145 0.2301
T13 0.210 0.0490 0.1657 0.1681 0.477 0.9453*
T14 0.100 0.3000 0.5310 0.0396 0.384 0.5465*
T15 0.532 0.0196 0.3127 0.0414 0.335 0.5518*

and in NIST 800-90B (Markov test estimate, Compression test esti- Acknowledgement
mate, Multi Markov Model with counting prediction test estimate).
The work was conducted as a part of the grant financed by
6.5. Performance comparison analysis Science and Engineering Research Board (SERB), Department of
Science & Technology (DST), India (EEQ/2019/000565). We want
The proposed quantum true random number generation is com- to thank SASTRA Deemed University, India, for its infrastructural
pared with the related quantum random number papers (Huang support. We are very much thankful and acknowledge the IBM
et al., 2021; Bisadi et al., 2018; Ferreira et al., 2021; Smith et al., Quantum Lab cloud platform for the results. We are grateful to
2019). acknowledge valuable discussions with R. Sivaraman, Research
The literature mentioned above is compared with the proposed Assistant, SASTRA Deemed University, India. Statistical evaluations
methodology column 1 result presented in Fig. 5(a) & (b). The were performed in the Intrusion Detection lab, SASTRA Deemed
obtained results are almost similar to the compared literature University, India.
papers result in some of them shows better result comparatively.
Referred works of literature presented only NIST 22 results rather References
proposed methodology presents the result of both NIST 90B & 22.
Abbott, A.A., Calude, C.S., Svozil, KARL, 2014. A quantum random number generator
certified by value indefiniteness. Math. Struct. Comp. Sci. 24 (3). https://doi.org/
7. Conclusion 10.1017/S0960129512000692.
Bennett, C.H., Bessette, F., Brassard, G., Salvail, L., Smolin, J., 1992. Experimental
A real random number produced through a real IBM quantum quantum cryptography. J. Cryptol. 5 (1), 3–28.
Bennett, C.H., Brassard, G., Mar. 2020. Quantum cryptography: Public key
platform was designed and tested in this work. In the proposed
distribution and coin tossing. Theor. Comput. Sci. 560 (P1), 7–11.
work, identical gates are assumed. The result is taken for the men- Z. Bisadi F. Acerbi G. Fontana N. Zorzi C. Piemonte G. Pucker L. Pavesi Compact
tioned arrangement; non-identical gates will be considered for the Quantum Random Number Generator with Silicon Nanocrystals Light Emitting
Device Coupled to a Silicon Photomultiplier Front. Phys. 6 10.3389/
random number generation for future work. To the best of our
fphy.2018.00009
knowledge, this is the first effort on the IBM platform to produce C. Cheng et al., ‘‘Parallel real-time quantum random number generator,” Opt. Lett.
more than 20 million random bits on the cloud. The exploring Vol. 44, Issue 22, pp. 5566-5569, vol. 44, no. 22, pp. 5566–5569, Nov. 2019.
raw data passes all NIST 800-90B and 22 test suite substances Dynes, J.F., Yuan, Z.L., Sharpe, A.W., Shields, A.J., Jul. 2008. A high speed,
postprocessing free, quantum random number generator. Appl. Phys. Lett. 93,
without any postprocessing application. The output bit strings of (3) 031109.
the system have outstanding quality in randomness, which can M. J. Ferreira, N. A. Silva, A. N. Pinto, and N. J. Muga, ‘‘Characterization of a Quantum
be seen from our results. Our real-time generation system is cur- Random Number Generator Based on Vacuum Fluctuations,” Appl. Sci. 2021, Vol.
11, Page 7413, vol. 11, no. 16, p. 7413, Aug. 2021.
rently available for public use. The min-entropy value obtained Gabriel, C., Wittmann, C., Sych, D., Dong, R., Mauerer, W., Andersen, U.L., Marquardt,
through NIST-800 90B Min (H-original, 8H_bitstring) is C., Leuchs, G., 2010. A generator for unique quantum random numbers based on
0.0007244. Our system is more practical and easier to implement vacuum states. Nature Photon 4 (10), 711–715.
T. Gehring et al., ‘‘Homodyne-based quantum random number generator at 2.9 Gbps
than the physical device-independent RNG. The proposed QTRNG secure against quantum side-information,” Nat. Commun. 2021 121, vol. 12, no.
can be used in end-to-end secure communications through quan- 1, pp. 1–11, Jan. 2021.
tum key distribution. The novel way of security can be provided Gennaro, R., Mar. 2006. Randomness in Cryptography. IEEE Secur. Priv. 4 (02), 64–
67.
with the random numbers generated, and it can be offered as a ser-
Herrero-Collantes, M., Garcia-Escartin, J.C., 2016. Quantum Random Number
vice by combining with IBM. For future work, we intend to stan- Generators. Rev. Mod. Phys. 89 (1), Apr.
dardise this system of QTRNG as an Entropy as a Service (EaaS). Herrero-Collantes, M., Garcia-Escartin, J.C., 2017. Quantum random number
generators. Reviews of Modern Physics 89, (1) 015004.
It can be provided to the cloud service providers, to the third party
L. Huang, H. Zhou, K. Feng, and C. Xie, ‘‘Quantum random number cloud platform,”
who can access IBM as an authorised user. Since the proposed npj Quantum Inf. 2021 71, vol. 7, no. 1, pp. 1–7, Jul. 2021.
QTRNG is device independent, it can produce session keys on Jacak, J.E., Jacak, W.A., Donderowicz, W.A., Jacak, L., 2020. Quantum random number
demand one-time passwords (OTPs). It produces (Nonce) numbers generators with entanglement for public randomness testing. Sci. Rep. 10 (1),
Dec.
only used once to ensure authenticity and confidentiality. Kfoury, E.F., Gomez, J., Crichigno, J., Bou-Harb, E., Khoury, D., 2019. Decentralized
Distribution of PCP Mappings over Blockchain for End-to-End Secure Direct
Conflict of interest Communications. IEEE Access 7, 110159–110173.
Li, Y., Fei, Y., Wang, W., Meng, X., Wang, H., Duan, Q., Ma, Z., 2021. Analysis of the
effects of temperature increase on quantum random number generator. Eur.
The Author(s) declare(s) that there is no conflict of interest. Phys. J. D 75 (2). https://doi.org/10.1140/epjd/s10053-021-00087-7.

6464
V. Kumar, John Bosco Balaguru Rayappan, R. Amirtharajan et al. Journal of King Saud University – Computer and Information Sciences 34 (2022) 6453–6465

Li, S., Wang, L., Wu, L.-A., Ma, H.-Q., Zhai, G.-J., 2013. True random number generator R. Stevanović, G. Topić, K. Skala, M. Stipčević, and B. M. Rogina, ‘‘Quantum Random
based on discretized encoding of the time interval between photons. J. Opt. Soc. Bit Generator Service for Monte Carlo and Other Stochastic Simulations,” In
Am. A 30 (1), 124. https://doi.org/10.1364/JOSAA.30.000124. International Conference on Large-Scale Scientific Computing 2007 Jun 5 (pp.
X. Ma, X. Yuan, Z. Cao, B. Qi, and Z. Zhang, ‘‘Quantum random number generation,” 508-515). Springer, Berlin, Heidelberg.
npj Quantum Inf. 2016 21, vol. 2, no. 1, pp. 1–9, Jun. 2016. Symul, T., Assad, S.M., Lam, P.K., 2011. Real time demonstration of high bitrate
Marangon, D.G., Vallone, G., Villoresi, P., Feb. 2017. Source-Device-Independent quantum random number generation with coherent laser light. Appl. Phys. Lett.
Ultrafast Quantum Random Number Generation. Phys. Rev. Lett. 118, (6) 98 (23), 231103. https://doi.org/10.1063/1.3597793.
060503. Uchida, A., Amano, K., Inoue, M., Hirano, K., Naito, S., Someya, H., Oowada, I.,
Nie, Y.-Q. et al., Feb. 2014. Practical and fast quantum random number generation Kurashige, T., Shiki, M., Yoshimori, S., Yoshimura, K., Davis, P., 2008. Fast
based on photon arrival time relative to external reference. Appl. Phys. Lett. physical random bit generation with chaotic semiconductor lasers. Nature
104, (5) 051110. Photon 2 (12), 728–732.
‘‘Qiskit.” [Online]. Available: https://qiskit.org/. [Accessed: 01-Sep-2021]. Wahl, M., Leifgen, M., Berlin, M., Röhlicke, T., Rahn, H.-J., Benson, O., 2011. An
‘‘Quantum Random Number Generation (QRNG) - ID Quantique.” [Online]. ultrafast quantum random number generator with provably bounded output
Available: https://www.idquantique.com/random-number-generation/ bias based on photon arrival time measurements. Appl. Phys. Lett. 98, (17)
overview/. [Accessed: 27-Aug-2021]. 171105.
‘‘Quantum Computing | IBM.” [Online]. Available: https://www.ibm.com/quantum- M. A. Wayne and P. G. Kwiat, ‘‘Low-bias high-speed quantum random number
computing/. [Accessed: 01-Sep-2021]. generator via shaped optical pulses,” Opt. Express, Vol. 18, Issue 9, pp. 9351-9357,
Sanguinetti, B., Martin, A., Zbinden, H., Gisin, N., 2014. Quantum Random Number vol. 18, no. 9, pp. 9351–9357, Apr. 2010.
Generation on a Mobile Phone. Phys. Rev. X 4 (3). https://doi.org/10.1103/ Xu, B. et al., 2019. High speed continuous variable source-independent quantum
PhysRevX.4.031056. random number generation. Quantum Sci. Technol. 4, (2) 025013.
Shen, Y., Tian, L., Zou, H., Jun. 2010. Practical quantum random number generator B.-J. Xu et al., ‘‘Compact quantum random number generation using a linear
based on measuring the shot noise of vacuum states. Phys. Rev. A 81, (6) optocoupler,” Opt. Lett. Vol. 46, Issue 13, pp. 3175-3178, vol. 46, no. 13, pp. 3175–
063814. 3178, Jul. 2021.
Smith, P.R., Marangon, D.G., Lucamarini, M., Yuan, Z.L., Shields, A.J., Jun. 2019. Yang, J. et al., Nov. 2020. Randomness quantification for quantum random number
Simple source device-independent continuous-variable quantum random generation based on detection of amplified spontaneous emission noise.
number generator. Phys. Rev. A 99, (6) 062326. Quantum Sci. Technol. 6, (1) 015002.
Stefanov, A., Gisin, N., Guinnard, O., Guinnard, L., Zbinden, H., 2000. Optical Y. Zhang et al., ‘‘A simple low-latency real-time certifiable quantum random
Quantum Random Number Generator. J. Mod. Opt. 47 (4), 595–598. number generator,” Nat. Commun. 2021 121, vol. 12, no. 1, pp. 1–8, Feb. 2021.
F. Steinlechner et al., ‘‘True random numbers from amplified quantum vacuum,”
Opt. Express, Vol. 19, Issue 21, pp. 20665-20672, vol. 19, no. 21, pp. 20665–20672,
Oct. 2011.

6465

You might also like