Quantum Random Number Generators and Their Applications in Cryptography
Quantum Random Number Generators and Their Applications in Cryptography
ABSTRACT
Random number generators (RNG) are an important resource in many areas: cryptography (both quantum and classical),
probabilistic computation (Monte Carlo methods), numerical simulations, industrial testing and labeling, hazard games,
scientific research etc. Because today's computers are deterministic, they can not create random numbers unless
complemented with a physical RNG. Randomness of a RNG can be defined and scientifically characterized and
measured. Especially valuable is the information-theoretic provable RNG which, at state of the art, seem to be possible
only by harvest of randomness inherent to certain (simple) quantum systems and such a generator we call Quantum RNG
(QRNG). On the other hand, current industry standards dictate use of RNGs based on free running oscillators (FRO)
whose randomness is derived from electronics noise present in logic circuits and which, although quantum in nature,
cannot be strictly proven. This approach is currently used in FPGA and ASIC chips. We compare weak and strong
aspects of the two approaches for use in cryptography and in general. We also give an alternative definition of
randomness, discuss usage of single photon detectors in realization of QRNGs and give several examples where QRNG
can significantly improve security of a cryptographic system.
Keywords: random numbers, cryptography, randomness definition, quantum randomness, free running oscillator, noise
generator
1. INTRODUCTION
Random numbers and random number generators (RNGs), seem to be of an ever increasing importance. Random
numbers are essential in cryptography (mathematical, stochastic and quantum), Monte Carlo calculations and numerical
simulations [1], statistical research, randomized algorithms, industrial testing, lottery etc. Today, random numbers are
most critically required in cryptography and its numerous applications in our everyday life: mobile communications, e-
mail access, online payments, cashless payments, ATMs, e-banking (TAN numbers), internet trade, point of sale, PINs
for prepaid cards, wireless keys, general cyber-security, secure file erasing on the computer, industrial control of
distributed systems SCADA (power grid, …), etc. Since beginning of mankind until roughly the end of the Cold War,
cryptography was generally perceived as something interesting only to rulers, secret services and spies, however, with
proliferation of secure cashless payment smart-cards, cash dispensers, points of sale, the birth of computer age and
Internet in early 1990's and finally recent explosion of mobile communications, cryptography flourished as an
indispensable ingredient of modern life. Now, suddenly, everyone has willingly or unwillingly, knowingly or
unknowingly became a user of cryptographic products. This also boosted research of randomness and random number
generators.
There is a general tendency, in both research community and industry, to take random numbers for granted and give
them the least attention in proving or designing a system. However, generation of random numbers is extremely non-
trivial and so are assessment and proving of their randomness. The situation in the field is such that there is even no
widely accepted definition of random numbers, and there probably never will be one. The fundamental problem here is
that randomness itself is not compatible with deterministic concept of definition. Knuth [2] discusses 14 definitions of
randomness without definitive conclusion, but giving a recipe that useful definition should contain a short list of
properties desirable for random sequences. One of the 14 definitions claims that a sequence of random numbers is a set
of independent numbers obeying a specified probability density function, which actually exchanges the definition of
"randomness" for the definition of "probability". According to Schneier [3], sequence of random numbers is
unpredictable and cannot be reliably reproduced. Maurer demonstrates that randomness tests are equivalent of finding an
algorithm to compress a sequence [4], leading to the idea that if a given sequence can be compressed then it is not
Advanced Photon Counting Techniques VI, edited by Mark A. Itzler, Joe C. Campbell, Proc. of SPIE
Vol. 8375, 837504 · © 2012 SPIE · CCC code: 0277-786X/12/$18 · doi: 10.1117/12.919920
Output
TO DO Output
>cP >cP
V
(f)
I
0 0
VBIAS VBIAS
Request
-= -= Input
(a) (b)
Figure 2. (a) Basic noise based RNG principle. Analog noise is brought to a threshold comparator whose output is either 0
or 1 depending whether its input is below or above certain adjustable threshold, VBIAS.; (b) Improved version which
theoretically features zero bias. Upon Request, fresh new random bit will be generated on the Output.
Going from this basic circuit, researchers have proposed many circuits whose aim is to improve the randomness.
Probably the best one has been discovered by C. H. Vincent in 1970 [46], generalized by Chevalier & Menard in 1974
[47] and independently re-discovered much later by Bagini and Bucci [57] and Stipčević [44]. Fig. 2b shows a zero-bias
noise based RNG. The biased output produced by imperfect threshold principle is divided by 2 by a toggling T-type flip-
flop. The output of the T flip-flop spends exactly 50% of the time in either logic state and is sampled periodically by a
pulse generator. The idea is that when sampled (by the D flip-flop) it will yield either 0 or 1 with perfectly equal
probabilities. However, in practice non-negligible deviation from randomness will occur due to two effects: 1) too fast
sampling will produce positive autocorrelation; 2) uneven rise and fall times of the logic involved will produce bias. This
holds true even if T flip-flop is fed by perfectly random, mutually non correlated triggers. On top of that analog noise
usually contains correlations by itself which enhances errors. Indeed this method even in theory produces random
numbers only in the limit of slow sampling [40].
Following is the most popular way of realizing physical RNGs on a chip. When output of a logical inverter circuit is fed
to its input, the circuit turns to an oscillator, so called free running oscillator (FRO), Fig 3.
_-o-i 0 -[>0-.- 0
H H '2n-i-1
FROs
450-810MHz
A
DO Shift register
op Von Neumann
'orreeLor
FRO
XOR 'ilJ-uQIvI
tORAU-, .1
FIL.
V
Dr1J
I I
] 101. I
1 bit
discard
f FIFO
Figure 4. VIA C3 PadLock random number generator samples fast FRO (A) by slow FRO (D).
FROs are so popular only because they can be made using conventional digital logic chip infrastructure which is
otherwise unsuitable for realization of a quantum RNG (Sect. 2.4). However, caveat with FROs is that the semiconductor
industry is making a continuous effort to make the electronics noise as small as possible and it generally goes down with
newer generations of chips making such generators ever harder to make. The jitter can become very small and cause the
FRO based RNG to operate in nearly PRNG regime. Therefore implementation details of a FRO based RNG most often
have to be tailored for each specific type or generation and type chip and uniformity of operation cannot be guaranteed
from batch to batch but has to be tested. Unfortunately, due to the very nature of operation of a FRO based RNG, present
solutions described in the scientific journals and patents, not only lack proof of randomness but in most cases even an
attempt of proof of the theoretical framework within which they operate [61-62,64-67]. An excellent further reading on
FRO based RNGs is given in [68].
2.4 Quantum random number generators
Quantum random number generators typically utilize just one intrinsically random quantum effect realized as close as
possible to its theoretical idealization. We reserve this name, quantum random number generator, for a device operating
upon a “clean”, isolated, non-collective effect, a few examples of which we describe here. The beauty of a quantum
When the projection measurement is performed in orthogonal base (|0>, |1>) on a qubit it will "project" to either |0> or
|1> with probabilities α2 and β2 respectively. To illustrate this theoretical concept let us consider a circularly polarized
photon entering polarizing beam splitter Fig. 5. The beam splitter projects the photon into one of the basis states,
horizontal or vertical, following which photon exits the corresponding port and hit one of the detectors thus signifying
binary value "0" or "1" respectively.
ti t2
Figure 5. Spatial and temporal quantum random bit generating principles. Spatial prnciple (left): Circularly polarized photon splits onto a
linear horizontal/vertical analyzer with 50% chance to finish in either of the two output ports. Timing principle QRBG (right): photons from
a single photon Poissonian source fall onto a single photon detector. Time intervals t1 and t2 spanned by three subsequent photon detections
are compared: if t1>t2 then produce "0", if t2>t1 then produce "1", if t1=t2 then produce nothing (skip).
Let us imagine that a photon has been emitted from a single photon emitter, such as atom, that was previously in an
appropriate excited state. After the emission of the single photon atom is exhausted and there are no more emissions.
But, if we “recharge” it to the same excited state it will "fire" again. Since everything is (ideally) equal to the previous
case, the next photon will again randomly choose one of the two paths. "Randomly" here means that previous photon left
no trace in the setup.
We have noted earlier that it is very difficult, probably impossible, to define sequence of random bits. Instead it is better,
and possible, to define a random bit generator. A random bit generator, by the definition, is a physical device that
produces a sequence of classical bits in such a way that a bit does not contain any information on any other bit produced
by the same machine. It is really fascinating that quantum physics permits existence of such a device and we have just
discussed one: the beam splitter. There are two novelties in this definition: 1) instead of defining a mathematical
abstraction we define a physical object; and 2) instead of defining what randomness is (listing of infinite number of
properties) we defined what randomness isn't. To explain this let us imagine that we have a perfect generator of random
bits (we know that quantum physics allows it) and that we want to make them non-random by some kind of post
processing. The only way of doing that would be to flip values of certain bits under control of some function of values of
some other bits. No matter how complicated this procedure may be, the bottom line is that bit values must "interact". If
our generator does not allow them to interact (like in the above beam splitter device) bit values will be random. The
worst thing that can happen to the bit values is bias because for that bits do not need to communicate. Bias can be
property imprinted into the generator itself (for example in beamsplitter probabilities of H and V outcomes may differ).
But our intuition of randomness tolerates bias: an unfair coin is still random, except that its entropy is not maximal. This
definition is powerful because it allows us to actually check whether our generator (not bits!) complies with it. Once the
generator complies with the definition, we know that it will produce random sequence of bits and thus we do not have to
care anymore about the elusive definition of random numbers.
The biggest problem in realization of perfect quantum RNG is that it is hard to realize setups very close the theoretical
idealization. Beam splitter method is theoretically perfect but practically it is very sensitive to smallest imperfections.
First, detector dead times and afterpulsing will generate correlations while the beam splitter in conjunction with
Alice Bob
With time, QKD moved from scientific laboratories to the market. In 2004 Swiss spin-off company IdQuantique
presented world's first QKD system having a key rate of 1k bit/sec at distances up to 69km, while the newest model
Clavis2 has extended the range to 100km. Soon after that USA based company MagiQ Technologies presented its QPN
system followed latter by SmartQuantum (France) and Quintessence Labs (Australia). Several big companies such as
Toshiba, NEC, IBM and HP are experimenting with their own QKD systems. As a part of maturing of this technology,
in recent years researchers gave more effort to study of security proofs and attacks rather than to invention of new
protocols. While most of the proposed attacks had at best symbolic success in recovering the information about the
secret key, in 2010 Norwegian group led by V. Makarov conceived and demonstrated an attack having catastrophic
consequences. The attacker was able to recover 100% of the (not anymore) secret key generated between Alice and Bob
without being detected ! Better yet, the attack was experimentally tested not only on one scientific BB84-like setup [97]
but on two most trusted commercial systems: QPN 5505 of MagiQ and id3110 Clavis2 of IdQuantique [90].
But how is this possible when all these systems operate upon scientifically proven principle? Authors' explanation is that
they used technological weakness in single photon detectors, so called "blindability", that was not considered (nor
known) in the security proof, thus effectively realizing a setup that does not conform to the assumptions of the proof.
However our notion (that has eluded researchers so far) is that blindability is only a technological aspect while the
essence is attack to the random number generator (RNG).
In the following we assume reader's familiarity with BB84 protocol where Alice and Bob are linked by one quantum and
one public but authenticated classical channel. Over the quantum channel Alice sends to Bob qubits randomly chosen in
one of the four polarizations (0o, 45o, 90o, 135o). Eve cuts the quantum channel (usually a fiber) and measures qubits in a
randomly chosen base (0o, 90o) or (45o, 135o), just as Bob would. In order for her to be completely invisible and get the
same information as Bob she "only" has to make sure that Bob chooses the same base and gets the same measurement
result. But how can she do that when Bob's base is chosen randomly? There comes the trick.
I LI1%..A
u'J
a) b)
Fig. 8. a) Receiver with a passive random number generator: measurement basis is chosen randomly by means of a first,
polarization insensitive beamsplitter; b) receiver with active random number generator: basis is determined by the
random bit which controls the phase electro-modulator (ΦEM), for example a Pockels cell.
Bob's receiving station (un)fortunately utilizes passive RNG scheme shown in Fig. 8a. This part is the same in all QKD
systems that have been broken by the blinding attack. In order to manipulate Bobs choice of bases Eve blinds
simultaneously all four detectors by shining strong continuous (CW) circularly polarized light of a carefully chosen
Even though authors in [97] claim that Eve exploits technological weaknesses in detectors, that is their blindability, our
finding is that Eve's success relies entirely on the fact that she is able to manipulate Bob's local random number
generator which determines Bob's detection base. If she could get control over Bobs choosing of bases in any other way,
she could achieve the same result without blinding detectors. More importantly, should Bob replace his passive setting
with a setting where choice or receiving bases is under control of an electronic random number generator which cannot
be manipulated by Eve (as shown in Fig. 8b) blindability would not help Eve to achieve anything beyond the standard
(sterile) intercept-resend attack [93] and moreover she would be discovered by Alice and Bob.
Although passive (Fig. 8a) and active (Fig. 8b) receiving schemes are seemingly functionally equivalent, the scheme
with explicit, electronic random number generator is secure against random number attacks. Namely, even though an
information-theoretically perfect random number generator required in the active setup can be made in exactly the same
way as a part of the Bob's receiving station, namely using a photon source, a beam splitter and two detectors (Fig. 5 left),
a subtle difference between passive and active schemes is that electronic RNG internally collapses wave function and
outputs only classical information (random bits) in one (outward) direction. Such generator does not receive any
information from communication channels and consequently cannot be manipulated by Eve.
4. CONCLUSION
In this work, an overview of physical random number generators and their use in cryptography and other applications is
given. Our conclusion is that quantum random number generators (QRNG) possess the most plausible link between
randomness of numbers and laws of physics and therefore stand the best chance of strict scientific proof of randomness.
Accordingly we gave a new, physical definition of randomness, against which QRNGs can be easily tested. Furthermore,
vulnerabilities of key establishing cryptographic protocols that arise from bad random number generators have been
explored with conclusion that use of a QRNG in these protocols would maximize their resilience against random number
generator attacks. However, the quest for provable, fast and affordable random number generators will continue.
This work was supported by Ministry of science education and sports of Republic of Croatia, contract number 098-
0352851-2873.
REFERENCES
1. E. Gentle, "Random Number Generation and Monte Carlo Methods", Springer, 2002
2. D. E. Knuth, The art of computer programming, Vol. 2, Third edition, (Addison-Wesley, Reading, 1997)
3. T.A. Hall, "The NIST SP 800-90 Deterministic Random Bit Generator Validation System (DRBGVS)", Sept. 2011
4. U. M. Maurer, "A universal statistical test for random bit generators", J. Crypt. 5,89-105(1992)
5. A. Kerckhoffs, "La cryptographie militaire" Journal des sciences militaires, vol. IX, pp. 5–83, January 1883, pp.
161–191, February 1883, URL: http://www.petitcolas.net/fabien/kerckhoffs/
6. P. Jonsson, “Boom in Internet gambling ahead? US policy reversal clears the way”,
http://www.csmonitor.com/USA/2011/1226/Boom-in-Internet-gambling-ahead-US-policy-reversal-clears-the-way
7. Remote Gaming Regulations, Legal notice 176 of 2004, 110 of 2006, 2760& 426 of 2007 and 90 of 2011, Lotteries
and Gaming Authority, Malta
8. G. Parisi, F. Rapuano, "Effects of the random number generator on computer simulations", Physics Letters B 157
(1985) 301-302
9. A. Proykova, "How to improve a random number generator", Comp. Phys. Comm. 124 (2000) 125-131
10. T. Click, A. Liu, G. Kaminski, "Quality of Random Number Generators Significantly Affects Results of Monte
Carlo Simulations for Organic and Biological Systems", J. Comp. Chem. 32 (2011) 513-524