You are on page 1of 89

Instituto Tecnológico y de Estudios Superiores de Monterrey

Campus Monterrey

School of Engineering and Sciences

A High Baud-Rate Method for Producing Pseudo-Random Bit Sequences


Passing Standardized FIPS Test with Applications to Cryptography
A thesis presented by

B.Eng. Carlos Alberto Carrillo Cortez


Submitted to the
School of Engineering and Sciences
in partial fulfillment of the requirements for the degree of

Master of Science

In

Electronic Engineering

Monterrey Nuevo León May 2017


Instituto Tecnológico y de Estudios Superiores de Monterrey
Campus Monterrey

School of Engineering and Sciences

The committee members, hereby, certify that have read the thesis presented by Carlos
Alberto Carrillo Cortez and that it is fully adequate in scope and quality as a partial
requirement for the degree of Master of Science in Electronic Engineer,

_______________________
Dr. Sergio Camacho León
Tecnológico de Monterrey
School of Engineering and Sciences
Principal Advisor

_______________________
Dr. Alfonso Ávila Ortega
Tecnológico de Monterrey
Committee Member

_______________________
Dr. Juan Arturo Nolazco Flores
Tecnológico de Monterrey
Committee Member

_______________________
Dr. Rubén Morales Menéndez
Dean of Graduate Studies
School of Engineering and Sciences

Monterrey Nuevo León May 2017

ii
Declaration of Authorship

I, Carlos Alberto Carrillo Cortez, declare that this thesis titled, A High Baud-Rate Method
for Producing Pseudo-Random Bit Sequences Passing Standardized FIPS Test with
Applications to Cryptography and the work presented in it are my own. I confirm that:

 This work was done wholly or mainly while in candidature for a research degree at
this University.
 Where any part of this thesis has previously been submitted for a degree or any
other qualification at this University or any other institution, this has been clearly
stated.
 Where I have consulted the published work of others, this is always clearly
attributed.
 Where I have quoted from the work of others, the source is always given. Except
for such quotations, this thesis is entirely my own work.
 I have acknowledged all main sources of help.
 Where the thesis is based on work done by myself jointly with others, I have made
clear exactly what was done by others and what I have contributed myself.

___________________________
Carlos Alberto Carrillo Cortez
Monterrey, Nuevo León, May, 2017

@2017 by Carlos Alberto Carrillo Cortez


All rights reserved

iii
Dedication

This work is dedicated to a special person in my life; Lucero, her unconditional


confidence, support, patience, and encouragement. You were my main motivation for
pushing through this work.

Also, is dedicated to all my family, represented by my father and mother, Juan Carlos
and Norma Alicia, and my brothers, Oscar and Frida, who during all this time were
keeping me on motivation to reach this goal. You are my motivation to continue with my
projects and my objectives.

iv
Acknowledgements

I would like to express my deepest gratitude to my family for their support, my


father Juan Carlos Carrillo García, my mother Norma Alicia Cortez Ceja, my brother
Oscar Carrillo Cortez and my sister Frida Monserrat Carrillo Cortez, their support kept me
going forward this long road.

Special thanks to Lucero Obdulia González Romero and her family for all their
support and motivation to reach this goal.

Also, would like to give my thanks to my thesis committee, advisor Dr. Sergio
Camacho León, for his help in this research work and guidance, Dr. Juan Arturo Nolazco
Flores and Dr. Alfonso Ávila Ortega for being part of this committee and their comments
to improve this work.

Thanks to my friends at Tecnológico de Monterrey Javier Meléndez Campos,


Diego Ríos Aguirre, Marco García Vera and Isaac de la Cruz, our Dream Team was
determinant in this road.

And thanks to Tecnológico de Monterrey for their support on tuition and CONACyT
with the economic support.

v
A High Baud-Rate Method for Producing Pseudo-Random Bit Sequences Passing
Standardized FIPS Test with Applications to Cryptography

by

Carlos Alberto Carrillo Cortez

Abstract
A technique for producing Pseudo-Random Bit Sequences (PRBS) is presented in this
work, the technique is based on the mix of two chaotic maps using mathematical
operators such as addition and exclusive-OR to create the Pseudo-Random Bit Generator
(PRBG). It satisfies the requirements of the Federal Information Processing Standard
(FIPS) 140-1 for cryptographic applications and produces PRBS at 8.66 Mbits/s in an
Intel® Core™ i7-3632QM processor (2.20 GHz, 7.88 GB RAM) running MS® Windows™
10 Home. Also, its computational complexity is lower compared with state-of-the-art
algorithms. An encryption application is shown by implementing this technique in a
LabVIEW-based system altogether with the prototype of a wearable key generator based
on the Intel® Edison™ processor.

vi
List of Figures

Figure 1.1. The structure of the first algorithm (left) and the second algorithm (right) proposed by
Ons, Mohammed, and Safwan. ................................................................................................................3
Figure 1.2. The Block diagram of data hiding in Sengul research. .....................................................3
Figure 1.3 Structure of the CCS. ..............................................................................................................4
Figure 1.4. The algorithms proposed by Kanso and Smaoui in their research. ................................4
Figure 2.1. Logistic Map. ...........................................................................................................................9
Figure 2.2. Logistic Map from r = 2.8 to r = 4. ......................................................................................10
Figure 2.3. Logistic Map from 3.5 to 4. ..................................................................................................11
Figure 2.4. Tent map, "r" parameter in the horizontal axis and its output in the vertical axis. ......12
Figure 2.5. Tent map from r = 1 to r = 2. ...............................................................................................13
Figure 3.1. Matlab programming environment. ....................................................................................19
Figure 3.2. LabVIEW programming environment. ...............................................................................20
Figure 3.3. The algorithm used for log PRBG. .....................................................................................21
Figure 3.4.The algorithm used for log + log PRBG. ............................................................................22
Figure 3.5. The algorithm used for log ⊕ log PRBG. .........................................................................23
Figure 3.6. The algorithm used for tent PRBG.....................................................................................24
Figure 3.7. The algorithm used for tent + tent PRBG. ........................................................................26
Figure 3.8.The algorithm used for tent ⊕ tent PRBG. ........................................................................27
Figure 3.9. The algorithm used for log + tent PRBG. ..........................................................................28
Figure 3.10. The algorithm used for log ⊕ tent PRBG. ......................................................................29
Figure 3.11. (A) The algorithm to improve production rate depending on the iteration. (B) The
algorithm to improve production rate depending on a random function. (C) The algorithm to
improve the complexity of the random sequence concatenating two chaotic maps. .....................30
Figure 3.12. Logistic Map chaos zones.................................................................................................33
Figure 3.13. Tent Map chaos zones. .....................................................................................................34
Figure 3.14. The user interface of FIPS 140-1 in LabVIEW. .............................................................37
Figure 3.15. Main "G" program of FIPS 140-1 suit in LabVIEW........................................................38
Figure 3.16. "G" program of mono bit test. ...........................................................................................38
Figure 3.17. "G" program of poker test. ................................................................................................38
Figure 3.18. "G" program of runs and long runs tests. .......................................................................39
Figure 5.1. Left, Arduino programming environment. Right, Intel Edison Board. ...........................45
Figure 5.2. The result of the FIPS 140-1 suit for the PRBG implemented on hardware. ..............46
Figure 5.3. State Machine diagram for the encryption algorithm. .....................................................47
Figure B.1. Detailed results for Experiment ID 01, log PRBG. ..........................................................57
Figure B.2. Detailed results for Experiment ID 02, log PRBG. ..........................................................57
Figure B.3. Detailed results for Experiment ID 03, log + log PRBG. ................................................58
Figure B.4. Detailed results for Experiment ID 04, log + log PRBG. ................................................58
Figure B.5. Detailed results for Experiment ID 05, log ⊕ log PRBG................................................59
Figure B.6. Detailed results for Experiment ID 06, log ⊕ log PRBG................................................59
Figure B.7. Detailed results for Experiment ID 07, tent PRBG. .........................................................60
Figure B.8. Detailed results for Experiment ID 08, tent PRBG. .........................................................60
Figure B.9. Detailed results for Experiment ID 09, tent + tent PRBG...............................................61

vii
Figure B.10. Detailed results for Experiment ID 10, tent + tent PRBG. ...........................................61
Figure B.11. Detailed results for Experiment ID 11, tent ⊕ tent PRBG. ..........................................62
Figure B.12. Detailed results for Experiment ID 12, tent ⊕ tent PRBG. ..........................................62
Figure B.13. Detailed results for Experiment ID 13, log + tent PRBG. .............................................63
Figure B.14. Detailed results for Experiment ID 14, log + tent PRBG. .............................................63
Figure B.15. Detailed results for Experiment ID 15, log + tent PRBG. .............................................64
Figure B.16. Detailed results for Experiment ID 16, log + tent PRBG. .............................................64
Figure B.17. Detailed results for Experiment ID 17, log ⊕ tent PRBG. ...........................................65
Figure B.18. Detailed results for Experiment ID 18, log ⊕ tent PRBG. ...........................................65
Figure B.19. Detailed results for Experiment ID 19, log ⊕ tent PRBG. ...........................................66
Figure B.20. Detailed results for Experiment ID 20, log ⊕ tent PRBG. ...........................................66
Figure B.21. Detailed results of the first experiment with the Matlab PRBG. ..................................67
Figure B.22. Detailed results of the second experiment with the Matlab PRBG. ...........................67
Figure B.23. Detailed results of the third experiment with the Matlab PRBG. ................................68
Figure B.24. Detailed results of the added(A) PRBG. ........................................................................68
Figure B.25. Detailed results of the added(B) PRBG. ........................................................................69
Figure B.26. Detailed results of the added(C) PRBG. ........................................................................69
Figure D.1. The first state of the encryption algorithm implemented in LabVIEW..........................73
Figure D.2. The second state of the encryption algorithm implemented in LabVIEW. ..................73
Figure D.3. The third state of the encryption algorithm implemented in LabVIEW. .......................74
Figure D.4. The fourth state of the encryption algorithm implemented in LabVIEW. .....................74
Figure D.5.The fifth state of the encryption algorithm implemented in LabVIEW. ..........................75

List of Tables

Table 2.1. Percentiles for Normal Distribution N (0, 1). ............................................................. 16


Table 2.2. Percentiles for Chi-Square Distribution. ................................................................... 17
Table 3.1. Parameter setting for Logistic Map based PRBG ..................................................... 32
Table 3.2. Parameter setting for Tent Map based PRBG.......................................................... 34
Table 3.3. Parameters using in the experiments. ..................................................................... 35
Table 3.4. Required lengths for the runs test in FIPS 140-1. .................................................... 36
Table 4.1. Comparison table of the precision factor in the production of PRBS. ....................... 41
Table 4.2. FIPS 140-1 results. .................................................................................................. 42
Table 4.3. Average baud-rate of the PRBG algorithms. ............................................................ 43
Table 4.4. Algorithm Complexity Analysis Results. ................................................................... 44

viii
Contents
Abstract vi
List of Figures vii
List of Tables viii
Chapter 1. Introduction ..............................................................................................................................1
1.1. Problem Statement .........................................................................................................................2
1.2. State of the Art.................................................................................................................................2
1.3. Hypothesis .......................................................................................................................................5
1.3.1. Research questions .................................................................................................................5
Chapter 2. Theoretical Framework ..........................................................................................................7
2.1. Randomness....................................................................................................................................7
2.2. Chaotic Maps ...................................................................................................................................8
2.2.1. Logistic Map .............................................................................................................................8
2.2.2. Tent Map .................................................................................................................................12
2.3. Statistical Test ...............................................................................................................................13
2.3.1. Mono-Bit Test .........................................................................................................................13
2.3.2. Serial Test ...............................................................................................................................14
2.3.3. Poker Test...............................................................................................................................14
2.3.4. Runs Test................................................................................................................................15
2.3.5. Autocorrelation Test ..............................................................................................................15
2.4. NIST and FIPS ..............................................................................................................................17
Chapter 3. Methodology ..........................................................................................................................19
3.1. Software .........................................................................................................................................19
3.1.1. Matlab ......................................................................................................................................19
3.2. PRBG Algorithms ..........................................................................................................................20
3.2.1. log PRBG ................................................................................................................................21
3.2.2. log + log PRBG (Logmap 2) .................................................................................................22
3.2.3. log ⊕ log PRBG.....................................................................................................................23
3.2.4 tent PRBG ................................................................................................................................24
3.2.5. tent + tent PRBG....................................................................................................................25
3.2.6. tent ⊕ tent PRBG ..................................................................................................................25
3.2.7. log + tent PRBG .....................................................................................................................25
3.2.8. log ⊕ tent PRBG ...................................................................................................................28
3.2.9. Other Algorithms ....................................................................................................................30
3.3. Parameter Setting .........................................................................................................................31

ix
3.3.1. Parameter setting for the Logistic Map based PRBG ......................................................31
3.3.2. Parameter setting for the Tent Map based PRBG ............................................................34
3.4. Evaluation of the PRB sequences ..............................................................................................36
3.4.1. FIPS 140-1 implemented in LabVIEW ................................................................................37
Chapter 4. Results ....................................................................................................................................41
4.1. Importance of the precision factor in the randomness of the PRBS .....................................41
4.2. Results of the FIPS 140-1 ...........................................................................................................41
4.3. Baud-Rate ......................................................................................................................................43
4.4. Algorithm Complexity Analysis ...................................................................................................44
Chapter 5. Applications............................................................................................................................45
5.1. Hardware Implementation ...........................................................................................................45
5.1.2. Results of the hardware implementation ............................................................................46
5.2. Encryption Application ..................................................................................................................46
Chapter 6. Analysis and Conclusions ....................................................................................................49
6.1. Application Analysis ......................................................................................................................49
6.2. Conclusions ...................................................................................................................................49
Appendix A ................................................................................................................................................51
Appendix B ................................................................................................................................................57
Appendix C ................................................................................................................................................71
Appendix D ................................................................................................................................................73
Bibliography ...............................................................................................................................................77
Resume ......................................................................................................................................................79

x
1. Chapter 1. Introduction
Random numbers are being studied in recent years because of the wide range of
applications development where it can be used, applications such as cryptology, genetic
algorithms, optimization algorithms, control, etc. [1]. One of the applications, that use
random numbers, with a continuously growing interest in recent years is the cryptography,
many methods and algorithms have been proposed and analyzed by some researchers
[2], [3], [4], [5] and [6]. Cryptography addresses a wide range of problems such as
confidentially, data integrity, entity authentication, and data origin authentication [7]. A
cryptosystem is an algorithm that transforms an original message, known as a plaintext,
into a scrambled (non-readable) message, known as a ciphertext, and recovers the
message back in its original form. The transformation process from plaintext to the
ciphertext is controlled by a key and is known as the encryption process, while the
transformation process from ciphertext to the plaintext is also controlled by a key, and is
known as the decryption process [8]. That processes are based on an encryption
algorithm that combines the plaintext with a part of the key through mathematical
operators (e.g. addition, multiplication and XOR function) in various cycles to make un-
readable the initial information. Many of these algorithms are well known by most the
scientific community or people related to the topic, therefore, the way of how the keys are
generated and distributed are indispensables topics in the security of the cryptographic
systems.

Typically, these keys are strings of ones and zeros produced in a random way by the key
generator. This key generator uses the theory of the pseudo-random number generator
(PRNG), numbers that seem to have a random behavior, to produce the needed keys.
These processes are based on computationally algorithms such as Linear feedback shift
register (LFSR), Linear congruential generator (LCG).

Recently researchers from the nonlinear dynamics community have noticed an interesting
relationship between chaos and cryptography [9]. Per that, many properties of chaotic
systems such as easily reproducibility, mixing properties, deterministic dynamic,
structural complexity and sensitivity to initial conditions system parameters can be

1
considered analogous in the production of the necessary keys in the cryptographic
processes [10].

In the present investigation, a technique to produce cryptographic keys for a mobile


system is presented, the technique is based on the mix of two chaotic maps using
mathematical operators such as addition and exclusive OR.

1.1. Problem Statement


Methodologies to create keys for cryptographic systems based on the generation of
pseudo-random numbers using the standard Linear Congruential Generators is not
recommended because of its limited statistical properties [11]; on the other hand, more
sophisticated PRNG frequently have a high computational demand [12]. Therefore, an
open research problem in this field relates to the development of low computational
demand PRNG with the necessary random behavior for cryptographic systems; i.e., prior
to its application, theses must produce sequences of numbers that pass a set of reliable
statistical tests [7].

1.2. State of the Art


Today many research in PRNG has studied chaotic systems to use as key generators for
cryptosystems under the framework of the Internet of Things (IoT).

In 2016, Ons Jallouli, Mohammed Abutaha and Safwan EL Assad, designed two
algorithms for producing crypto-keys of the IoT environment [13]. The first algorithm
consists in the use of two nonlinear recursive filters of order one using a Skew Tent map
(STmap) and a Piece-Wise Linear Chaotic map, the second algorithm is based on four
coupled chaotic maps, namely; PWLCmaps, STmap, Logistic map by means a binary
diffusion matrix. They measure their results in terms of computation time (e.g. generation
time, bit rate).

2
Figure 1.1. The structure of the first algorithm (left) and the second algorithm (right) proposed by
Ons, Mohammed, and Safwan.

The same year, Sengül Dogan used chaotic maps to improve a data hiding technique
based on a genetic algorithm [14]. Different sized secret data are embedded into the
cover object using the random function of MATLAB and chaotic maps. The randomness
of genetic is performed by using different chaotic maps. The success of the proposed
method is presented with comparative results. It is observed that gauss, logistic and tent
maps are faster than random function for proposed data hiding method.

Figure 1.2. The Block diagram of data hiding in Sengul research.

In 2015, Yicong Zhou, Zhongyun Hua, Chi-Man Pun and Philip Chen, designed a method
to join chaotic maps to create cryptokeys [15]. They use the cascade chaotic system
(CCS) with the logistic map, tent map, and the sine map. They used the NIST SP800-22
to check the statistical properties of their methods. Simulation and analysis demonstrate
that the proposed PRNG has a high quality of randomness and that the data encryption
system can protect different types of data with a high-security level.

3
Figure 1.3 Structure of the CCS.

In 2014 René Lozi introduced the paradigm of chaotic mathematical circuitry which shows
some similarity to the paradigm of electronic circuitry [1]. He developed a chaos based
pseudo-random number generator (CPRNG) and chaotic multi-stream PRNG that can be
used in applications (e.g. cryptography, generic algorithms in optimization, control, etc.).

In 2007, Ali Kanso and Nejib Smaoui proposed two methods to generate PRBS based on
the logistic map for cryptography [8]. The first is based on a single one-dimensional
logistic map and the second is based on a combination of two logistic maps. A threshold
function is applied to convert the floating-point iterates into binary form. Experimental
results show that the produced sequences possess high linear complexity and very good
statistical properties. The systems are put forward for security evaluation by the
cryptographic committees.

Figure 1.4. The algorithms proposed by Kanso and Smaoui in their research.

1.3. Objectives

The general objective of this work is to evaluate the performance of several PRNGs based
on the combination of two chaotic maps by using mathematical operators such as addition
and exclusive-OR to design a PRBG with a high baud-rate with a low complex algorithm.

4
The general objective can be divided into the following specific objectives:

 Analyze the impact of the addition and exclusive-OR operations in the behavior of
the PRBS generated by the combination of two chaotic maps.
 Assure that the PRBG passes all the necessary test that allow it to be used in
cryptography applications.
 Validate the use of the PRBG in a wearable crypto-key generator based on the
Intel® Edison™ processor.

1.3. Hypothesis
The use of mixed chaotic maps by arithmetic operations in the algorithm of a PRBG, i.e.
addition and exclusive-OR function, produces a PRBS that fits all the statistical properties
to be used in cryptography with a high baud-rate and also have a low complexity
algorithm.

1.3.1. Research questions


 Is possible to design a low complex PRBG based on the used of two chaotic maps
that its output fits all statistical properties for cryptography?
 Based on the low complexity of the PRBG, is possible that it has a better
performance than the state-of-the-art PRBG?
 Is possible to implement this PRBG on an Intel® Edison™ processor to create a
wearable crypto-key generator?

5
6
2. Chapter 2. Theoretical Framework
To fundament the work done on this document, the follow chapter covers the concepts
that are of interest to understand the methodologies used in the experiments of the next
chapter.

2.1. Randomness
A Random bit sequence could be interpreted as the result of flips of an unbiased, fair,
coin with sides labeled “0” and “1”, with each flip having a probability of exactly 0.5 of
producing a “0” or “1”. Furthermore, the flips are independent of each other: the result of
any previous coin flip does not affect future coin flips. The unbiased coin is thus the perfect
random bit stream generator. All elements of the sequence are generated independently
of each other, and the value of the next element in the sequence cannot be predicted,
regardless of how many elements have already been produced [16]. Obviously, the use
of unbiased coins for applications that needs random sequences is impractical. There are
two basic types of generating a random sequence: true random and pseudorandom.

The first type of sequence is produced using a non-deterministic, such as electric noise,
keystrokes, mouse movements or a combination of different sources. The use of dates
and time vector are not recommended to use alone because are quite predictable. The
production of high-quality random numbers may be too time-consuming, making such
production undesirable when a lot of random numbers is needed [17].

To produce large quantities of random numbers a pseudorandom number generator


(PRBG) is needed, this type of sequence uses one or more inputs “seeds” and generate
multiple pseudo random numbers. To make a more random sequence unpredictability is
needed in the seeds, hence, by default, a PRBG may obtain its seed from the output of a
true random number generator (TRNG). The best PRBG requires a TRNG as a
companion [17].

The output of a PRBG are typically deterministic functions of the seeds, this nature of the
process leads to the term pseudorandom. Since each element of a pseudorandom

7
sequence is reproducible from its seed, only the seed needs to be saved if reproduction
or validation of this sequence is required.

Ironically, pseudorandom sequences often appear to be more random than true random
numbers obtained from physical sources. If a pseudorandom sequence is properly
constructed, each value in the sequence is produced from the previous value via
transformations that appear to introduce additional randomness [17]. A series of such
transformations can eliminate statistical autocorrelations between input and output. Thus,
the output of a PRBG may have better statistical properties than the output from TRNG.

2.2. Chaotic Maps


In mathematics, a chaotic map is a map that exhibits some sort of chaotic behavior. This
maps usually take the form of iterated functions and often occur in the study of dynamical
systems.

2.2.1. Logistic Map


The logistic map is a polynomial function of degree 2, first created by Pierre Francois
Verhulst and popularized by the biologist Robert May in 1976 [18]. First introduced as a
demographic model with the intention of simulate two effects: reproduction and starvation
of a population. Mathematically, the logistic map is written,

𝑥𝑛+1 = 𝑟𝑥𝑛 (1 − 𝑥𝑛 ) (2.1)


Where 𝑥𝑛 ∈ (0, 1) and represent the initial condition of a phenomenon and 𝑟 is the system
parameter who’s in this case in the range of (0, 4].

This map is fascinating to mathematicians because of its astonishing complexity behavior


regardless of the simplicity of its math. If plug an initial number, it will generate another
number but if a change in the initial number occurs by a very tiny bit, the expected number
it supposes to be slightly and predictably different, but that does not occur [19].

By varying the parameter 𝑟, the following behaviour is observed:

 From 0 to 1, the output converges to zero, independent of the initial condition.


𝑟−1
 From 1 to 2, the output converges to the value , independent of the initial
𝑟

condition.

8
𝑟−1
 From 2 to 3, the output converges to the same value , but first will fluctuate
𝑟

around that value, independent of the initial condition.

Figure 2.1. Logistic Map.

 From 3 to 3.45 the output oscillates between two values dependent of 𝑟, for almost
all initial conditions.
 From 3.45 to 3.5441, the output will permanent oscillates among four values, for
almost all initial conditions.
 For little increases of 3.5441, the output will oscillate among eight values first, then
16, 32, etc. for almost all initial condition.

9
Figure 2.2. Logistic Map from r = 2.8 to r = 4.

 For values beyond 3.56995, a chaotic behavior is observed in the output but there
still some isolated ranges with a deterministic oscillation up to the value of 3.82843
where is located the last oscillation range, independent of the initial condition [20].
 For values, beyond of 3.87 up to 3.99, chaotic behavior is observed.
 From 3.99996 to 4, the chaotic behavior takes the full range [0, 1] in its output.
 For values beyond 4, the iteration leaves the interval of [0, 1] in its output and
diverges.

10
Figure 2.3. Logistic Map from 3.5 to 4.

This behavior of the logistic map can be applied successfully to ecology, the branch of
biology that deals with the relations of organism to one another and their environments,
such the spawning of salmon stocks, the number of ants crawling around their hill, etc.
[19].

The logistic map is not limited just to biology and demographic purposes. In 1947, Ulam
and von Neumann studied the logistic map as pseudorandom number generator (PRBG)
[21]. To reach that the parameter 𝑟 must be set the nearest to 4, usually 𝑟 ∈ (3.99996, 4],
under this conditions is supposed that the map has good qualities as a pseudorandom
number generator [2], [22] and [23].

A simple threshold function, with a properly 𝑐 limit value, can turn the output of the logistic
map into a sequence of bits [2], that can be used for desires applications, such as
cryptography, genetic algorithms for optimization, development of control systems, etc.
[1].

0, 𝑖𝑓 𝑥𝑛 < 𝑐
𝐹(𝑥𝑛 ) = { (2.2)
1, 𝑜𝑡ℎ𝑒𝑟 𝑤ℎ𝑖𝑠𝑒

11
Although the logistic map, under the conditions of PRBG, has a long-term unpredictability
and do no converge after any value of iterations, these values are highly deterministic, as
the can be noted in Figure 2.3. In the other hand, a fascinating aspect of the logistic map
as PRBG is its very sensitive dependence upon its initial condition that results in a
completely different sequence for a change as small as 10−30 in its initial condition [8] and
[24].

2.2.2. Tent Map


Like the logistic map, the tent map is a chaotic map with one dimension in the discrete
time domain and in the real space domain [15]. And is described by,

1
𝑟𝑥𝑛 𝑓𝑜𝑟 𝑥𝑛 <
𝑥𝑛+1 ={ 2 (2.3)
1
𝑟(1 − 𝑟𝑛 ) 𝑓𝑜𝑟 ≤ 𝑥𝑛
2
where, 𝑟 ∈ (0, 2] and 𝑥𝑛 ∈ (0, 1) is the initial condition of the system.

When 𝑟 = 2 is topologically conjugate with the logistic map when its parameter is set at 4
[25], and thus behaviors of the two maps are in this sense identical under iteration.

Figure 2.4. Tent map, "r" parameter in the horizontal axis and its output in the vertical axis.

As it shows in Figure 2.4 the tent map has the following behavior.

 When 𝑟 is less than 1, the output is an attractive fixed point with value zero.
 When 𝑟 is 1, the output is an attractive fixed point with value 0.5.

12
 When 𝑟 is between 1 and the square root of 2, the output start to splitter into four
regions and them two regions, chaotic behavior starts.
 When 𝑟 is closed to 2, the output is chaotic and has the full range of 𝑥𝑛+1 ∈ (0, 1).

Figure 2.5. Tent map from r = 1 to r = 2.

2.3. Statistical Test


Exist different statistical tests that can be applied to a sequence to attempt to compare
and evaluate the sequence to a truly random sequence. Randomness is a probabilistic
property; that is, the properties of a random sequence can be characterized and
described in terms of probability [17].

There is five basic statistical test (mono bit test, serial test, poker test, runs test and
autocorrelation test) that can be applied to a random sequence to assure that fits with the
requirements of a truly random sequence [26]. These tests measure the relative
frequencies of certain patterns of “0” and “1” in a section of the sequence and give a value
to compare against a pass mark given by statistical distributions such as normal and chi-
square.

2.3.1. Mono-Bit Test


The mono bit test focus on the proportion of zeros and ones for the entire sequence (𝑆).
The purpose of this test is to determine whether the number of ones and zeros in a
sequence are approximately the same as would be expected for a truly random
sequence. The test assesses the closeness of the fraction of ones to half, that is, the

13
number of ones and zeros in a sequence be about the same. All subsequent test depends
on the passing of this test [7]. The static used is,

(𝑛0 − 𝑛1 )2
𝑋= (2.4)
𝑛
where 𝑛0 is the number of zeros, 𝑛1 is the number of ones in 𝑆 and 𝑛 is the length of 𝑆.
Which approximately follows a 𝜒 2 distribution with 1 degree of freedom if 𝑛 ≥ 10.

2.3.2. Serial Test


The serial test purpose is to determine whether the number of occurrences of “00”, “01”,
“10”, “11” as a subsequence of 𝑆 are approximately the same, as would be expected for
a random sequence. That occurrences are represented by 𝑛00 , 𝑛01 , 𝑛10 , 𝑛11 , respectively.
Since this subsequence can overlap the follow equivalency occurs 𝑛00 + 𝑛01 + 𝑛10 +
𝑛11 = (𝑛 − 1) [27]. The statistic used is,

4 2 2 2 2 )
2
𝑋= (𝑛00 + 𝑛01 + 𝑛10 + 𝑛11 − (𝑛02 + 𝑛12 ) + 1 (2.5)
𝑛−1 𝑛
which approximately follows a 𝜒 2 distribution with 2 degrees of freedom if 𝑛 ≥ 21.

2.3.3. Poker Test


The poker test determines whether all kinds of a subsequence of length 𝑚 and non-
overlapping appear approximately the same number of times in 𝑆, as would be expected
for a random sequence. This test divides 𝑆 into 𝑘 non-overlapping parts each of length 𝑚
with 𝑛𝑖 as the number of occurrences of the 𝑖 𝑡ℎ type of subsequence of length 𝑚. Let 𝑘 =
𝑛 𝑛
⌊(𝑚)⌋ with 𝑚 as a positive integer such that ⌊𝑚⌋ ≥ 5 ∗ (2𝑚 ) and 1 ≤ 𝑖 ≤ 2𝑚 [7]. The statistic

used is,

2𝑚
2𝑚
𝑋= (∑ 𝑛𝑖2 ) − 𝑘 (2.6)
𝑘
𝑖=1

which approximately follows a 𝜒 2 distribution with 2𝑚 − 1 degrees of freedom. The use of


𝑚 = 1 degrade the test to mono-bit test.

14
2.3.4. Runs Test
The runs test purpose is to determine whether the number of consecutive chains of zeros
or ones of various lengths in 𝑆 is as expected for a random sequence. A chain of zeros
or ones of determinate length can’t be neither preceded nor succeeded by the same
character, a chain of zeros is called gap and a chain of ones is called block. The expected
𝑛−𝑖+3
number of gaps or blocks of length 𝑖 in 𝑆 is 𝑒𝑖 = . Letting 𝑘 be equal to the largest
2𝑖+2

integer 𝑖 for which 𝑒𝑖 ≥ 5. Let 𝐵𝑖 , 𝐺𝑖 be the number of block and gaps, respectively, of
length 𝑖 in 𝑆 for each 𝑖, 1 ≤ 𝑖 ≤ 𝑘 [28]. The statistic used is,

𝑘 𝑘
(𝐵𝑖 − 𝑒𝑖 )2 (𝐺𝑖 − 𝑒𝑖 )2
𝑋=∑ +∑ (2.7)
𝑒𝑖 𝑒𝑖
𝑖=1 𝑖=1

which approximately follows a 𝜒 2 distribution with 2𝑘 − 1 degrees of freedom.

2.3.5. Autocorrelation Test


The autocorrelation test checks for correlations between 𝑆 and (non-cyclic) shifted
𝑛
versions of it. Letting 𝑑 be a fixed integer, 1 ≤ 𝑑 ≤ ⌊ 2⌋. The number of bits in 𝑆 not equal

to their 𝑑-shifts is 𝐴(𝑑) = ∑𝑛−𝑑−1


𝑖=0 𝑠𝑖 ⊕ 𝑠𝑖+𝑑 , where ⊕ denotes the XOR operator [29]. The
statistic used is,

𝑛−𝑑
2 (𝐴(𝑑) −
𝑋= 2 ) (2.8)
√𝑛 − 𝑑
which approximately follows an 𝑁(0, 1) distribution if 𝑛 − 𝑑 ≥ 10.

To determine if an algorithm is rejected or not by the previous tests a significance level,


which is the probability of rejecting the algorithm when the algorithm must be not rejected,
must be proposed. If the significance level of a test is too high, the test may reject
sequences that were, in fact, produced by a random bit generator (such an error is called
a Type I error). On the other hand, if the significance level of a test is too low, then there
is the danger that the test may accept sequences even though they were not produced
by a random bit generator (such an error is called a Type II error). It is, therefore, important
that the test is carefully designed to have a significance level that is appropriate for the

15
purpose at hand; a significance level between 0.001 and 0.05 might be employed in
practice [7].

In Table 2.1 is presented the selected percentiles for a Normal Distribution N (0, 1).

Table 2.1. Percentiles for Normal Distribution N (0, 1).

For the tests that follow this distribution is considered that an algorithm is not rejected
by the test if the result of the test is below of 𝑥 for a certain significance level 𝛼.

In Table 2.2 is presented the selected percentiles for a Chi-Square Distribution with
different degrees of freedom 𝑣.

To know is an algorithm is not rejected by a test that follows this distribution, the same
methodology of Normal Distribution is applied.

16
Table 2.2. Percentiles for Chi-Square Distribution.

2.4. NIST and FIPS


The National Institute of Standards and Technology (NIST) is a measurement standards
laboratory and a non-regulatory agency of the United States Department of Commerce.
Its mission is to promote innovation and industrial competitiveness.

NIST's activities are organized into laboratory programs that include Nanoscale Science
and Technology, Engineering, Information Technology, Neutron Research, Material
Measurement, and Physical Measurement.

Under the Information Technology Management Reform Act (Public Law 104-106), the
Secretary of Commerce approves standards and guidelines that are developed by the
NIST for Federal computer systems. These standards and guidelines are issued by
NIST as Federal Information Processing Standards (FIPS) for use government-wide.
NIST develops FIPS when there are compelling Federal government requirements such

17
as for security and interoperability and there are no acceptable industry standards or
solutions [30].

FIPS standards are issued to establish requirements for various purposes such as
ensuring computer security and interoperability and are intended for cases in which
suitable industry standards do not already exist [31]. Many FIPS specifications are
modified versions of standards used in the technical communities, such as the
American National Standards Institute (ANSI), the Institute of Electrical and Electronics
Engineers (IEEE), and the International Organization for Standardization (ISO).

18
3. Chapter 3. Methodology
This section describes the methodology uses to design and execute the experiments
necessaries to corroborate the hypothesis of this work, as well the necessary equipment
and materials.

3.1. Software
To generate PRBGs and evaluated its randomness behavior some computational
resources were used. These resources were running in a Dell Laptop on Windows 10 64-
bits Home edition with a processor Intel i7-3632QM at 2.20 GHz and 8.00 GB of RAM.

3.1.1. Matlab
Matlab stands for Matrix Laboratory and the software is built up around vectors and
matrices. This makes the software particularly useful for linear algebra. It is also a
programming language, as it can see in Figure 3.1, and is one of the easiest programming
languages for writing mathematical programs [32]. Eight algorithms were designed on
Matlab, one of them was already reported in the literature [8], two more were based on
single logistic and tent map, the rest are totally new and were created based on a mix of
the two past chaotic maps. The sequences were generated and saved as a vector of ones
and zeros, then they were saved in a text file to apply the necessary tests to measure its
randomness and determined if they were rejected or not.

Figure 3.1. Matlab programming environment.

19
3.1.2. LabVIEW

Laboratory Virtual Instrument Engineering Workbench (LabVIEW) is a system design


platform and development environment for a visual programming language, Figure 3.2,
from National Instruments. The graphical language is named "G". The statistical tests
were automatized on this environment in order report the results in a visual way. The
algorithm of each test is fed by the text file, of the generated sequences in Matlab, once.
Then the test is executed and the results are displayed on the monitor showing the
random behavior of the sequence, on each test, rejected or not.

Figure 3.2. LabVIEW programming environment.

3.2. PRBG Algorithms


Based in the literature [1], [8], [15], and previous experiment results of this work, eight
new algorithms were developed using the logistic map and tent map, mathematical
operations such as addition, XOR and sort methods were implemented to mix these two
maps to try to improve its complexity [17].

To know the relevance in any output parameter (e.g. randomness, production rate, the
difference between sequences with same parameter and algorithm) related to the
precision used in the operations, the algorithms described in 3.2.1. and 3.2.2. were
simulated with the standard precision of Matlab and the higher precision using the

20
variable precision arithmetic (VPA) function of Matlab that coerce the algorithm to use 32
significance ciphers after the dot in all arithmetic operations.

3.2.1. log PRBG


This PRBG was designed based on a single logistic map with a threshold function to turn
its decimal real output into bits. The inputs for this algorithm should in the range described
by the Theoretical Framework chapter. Figure 3.3 shows the algorithm used.

Figure 3.3. The algorithm used for log PRBG.

21
3.2.2. log + log PRBG (Logmap 2)
This algorithm was already presented in the literature; it uses two single 1-dimensional
logistic maps, the output of the two maps is summed before the threshold function. The
parameters may be the same on both maps but different parameters could add more
complexity to decode the algorithm. The inputs for this algorithm should in the range
described by the Theoretical Framework chapter. Figure 3.4 shows the algorithm used.

Figure 3.4.The algorithm used for log + log PRBG.

22
3.2.3. log ⊕ log PRBG
This algorithm uses two single 1-dimensional logistic maps, the output of the two maps
after the threshold function on the maps both outputs are processed by a XOR operation.
The parameters may be the same on both maps but different parameters could add more
complexity to decode the algorithm. Figure 3.5 shows the algorithm used.

Figure 3.5. The algorithm used for log ⊕ log PRBG.

23
3.2.4 tent PRBG
This PRBG was designed based on a single logistic map with a threshold function to turn
its decimal real output into bits. The inputs for this algorithm should in the range described
by the Theoretical Framework chapter. Figure 3.6 shows the algorithm used.

Figure 3.6. The algorithm used for tent PRBG.

24
3.2.5. tent + tent PRBG
This algorithm uses two single 1-dimensional tent maps, the output of the two maps is
summed before the threshold function. The parameters may be the same on both maps
but different parameters could add more complexity to decode the algorithm. The inputs
for this algorithm should in the range described by the Theoretical Framework chapter.
Figure 3.7 shows the algorithm used.

3.2.6. tent ⊕ tent PRBG


This algorithm uses two single 1-dimensional tent maps, the output of the two maps after
the threshold function on the maps both outputs are processed by a XOR operation. The
parameters may be the same on both maps but different parameters could add more
complexity to decode the algorithm. The inputs for this algorithm should in the range
described by the Theoretical Framework chapter. Figure 3.8 shows the algorithm used.

3.2.7. log + tent PRBG


This algorithm uses a single 1-dimensional logistic map and a single 1-dimensional tent
map, the output of the two maps is summed before the threshold function. The parameters
should not be the same on both maps. The inputs for this algorithm should in the ranges
described by the Theoretical Framework chapter. Figure 3.9 shows the algorithm used.

25
Figure 3.7. The algorithm used for tent + tent PRBG.

26
Figure 3.8.The algorithm used for tent ⊕ tent PRBG.

27
Figure 3.9. The algorithm used for log + tent PRBG.

3.2.8. log ⊕ tent PRBG


This algorithm uses a single 1-dimensional logistic map and a single 1-dimensional tent
map, the output of the two maps after the threshold function on the maps both outputs
are processed by a XOR operation. The parameters should not be the same on both

28
maps. The inputs for this algorithm should in the ranges described by the Theoretical
Framework chapter. Figure 3.10 shows the algorithm used.

Figure 3.10. The algorithm used for log ⊕ tent PRBG.

29
3.2.9. Other Algorithms
In addition to the described algorithms, 3 more techniques with chaotic maps were
implemented. In 2 of them a single chaotic map, logistic or tent, was used during each
iteration to try to improve the production rate of the bit sequences. The choice of what
chaotic map is going to be used in the current iteration is made by the number of the
iteration, odd or even, in one of these two algorithms and by random in the other
algorithm.

Figure 3.11. (A) The algorithm to improve production rate depending on the iteration. (B) The
algorithm to improve production rate depending on a random function. (C) The algorithm to
improve the complexity of the random sequence concatenating two chaotic maps.

The last algorithm uses both chaotic maps, like the previous described, with the difference
that there is not an operation, addition or XOR, to join them. This algorithm concatenates
the output of one chaotic map and uses it as an input for the second chaotic map, to try

30
to increase the statistical properties of the output sequence, then a threshold function is
used. Figure 3.11 shows a single iteration of the 3 added algorithms.

The code of the algorithms implemented in Matlab is presented in the appendant’s


section.

3.3. Parameter Setting


To achieve a randomness behavior in the PRBG a good parameter 𝑟 must be chosen for
the chaotic maps used in the PRBG algorithms, these parameters can be obtained by the
theoretical background of these maps.

3.3.1. Parameter setting for the Logistic Map based PRBG


The logistic map has a complex behavior in the way it generates a number from an input
[8], [19], but this behavior can be only obtained in some zones of the logistic map, that’s
why a good parameter is needed to be used to generate a pseudo-random number (PRN).
Figure 3.12 shows a diagram of the behavior of the logistic map when the parameter is
between 3.5 and 4.0, where is possible to see some zones with chaos behavior and
others with a deterministic oscillation.

To obtained PRN, the parameter 𝑟 should be in between a zone where a chaotic behavior
is observed, next a threshold function with a 𝑐 limit value is used transform this PRN into
pseudo-random bits (PRB). This 𝑐 limit value should be chosen according to the chaotic
zone where the parameter 𝑟 is located, for example, if the parameter is set to 3.7 the
range of the output is 𝑥𝑛+1 ∈ [0.2568, 0.9248] to ensure a behavior like an unbiased coin
the limit value should be in the center of this output range so the limit value must be set
in 𝑐 = 0.5908, this value can be modified if another behavior is needed for the PRBG.

Choose a chaotic zone in the logistic map to set a parameter 𝑟 is a good idea to create a
PRBG, but we must need to know the entire output range of the chaotic zone chosen to
choose the limit value for the threshold function, if a little mistake happens in this step the
PRBG will not generate a completely random sequence of bits like an unbiased coin. A
good idea to prevent any mistake and to simplify this step, is to set the parameter 𝑟 ∈
(3.99996, 4] inside of this zone is know that the output takes the full range (0, 1) so the

31
limit value for the threshold function can be set in 𝑐 = 0.5, for the experiments of this work
the parameters used for the logistic map based PRBG are listed in Table 3.1.

Table 3.1. Parameter setting for Logistic Map based PRBG

Variable Value
𝒓 (3.99996, 4]
𝒄 0.5
𝒙𝒏 (0, 1)

32
Figure 3.12. Logistic Map chaos zones.

33
3.3.2. Parameter setting for the Tent Map based PRBG
The Tent Map also has a complex behavior, but it does not present intervals with
deterministic and chaos zones intercalated. The chaotic behavior in the tent map start
when 𝑟 ≥ 1, but begins with to separated chaotic zones this makes complicated to set a
limit value 𝑐 for the threshold function to obtain PRB, a single chaotic zone is observed
when 𝑟 ≥ 1.415, then the parameter 𝑟 should be set in [1.415, 2]. Figure 3.13 shows the
chaotic zones of the tent map.

Figure 3.13. Tent Map chaos zones.

In the same way, like logistic map, to simplify and ensure a randomness behavior the
parameter 𝑟 should be set the nearest possible of 2, where is the zone in which the output
takes the full range (0, 1) and the limit value 𝑐 can be 0.5, for the experiments of this work
the parameters used for the tent map based PRBG are listed in Table 3.2.

Table 3.2. Parameter setting for Tent Map based PRBG.

Variable Value
𝒓 [1.99999132, 2)
𝒄 0.5
𝒙𝒏 (0, 1)

34
3.3.3. Parameters for Experiments

A total of 20 experiments were processed using the algorithms of the previous chapters
the parameter using for each of them are listed in Table 3.3.

Table 3.3. Parameters using in the experiments.

Experiment ID Algorithm 𝒙𝟏𝒏 𝒓𝟏 𝒙𝟐𝒏 𝒓𝟐


01 log 0.242571 4 N/A N/A
02 log 0.786 3.999999301 N/A N/A
03 logPlog 0.242571 4 0.786 3.999999301
04 logPlog 0.242571 3.999999301 0.786 4
05 logXlog 0.242571 4 0.786 3.999999301
06 logXlog 0.242571 3.999999301 0.786 4
07 tent 0.32151 1.99999132 N/A N/A
08 tent 0.67934 1.9999998 N/A N/A
09 tentPtent 0.32151 1.99999132 0.67934 1.9999998
10 tentPtent 0.32151 1.9999998 0.67934 1.99999132
11 tentXtent 0.32151 1.99999132 0.67934 1.9999998
12 tentXtent 0.32151 1.9999998 0.67934 1.99999132
13 logPtent 0.242571 4 0.32151 1.99999132
14 logPtent 0.786 3.999999301 0.67934 1.9999998
15 logPtent 0.786 3.999999301 0.32151 1.99999132
16 logPtent 0.242571 4 0.67934 1.9999998
17 logXtent 0.242571 4 0.32151 1.99999132
18 logXtent 0.786 3.999999301 0.67934 1.9999998
19 logXtent 0.786 3.999999301 0.32151 1.99999132
20 logXtent 0.242571 4 0.67934 1.9999998
21 Added (A) 0.786 3.999999301 N/A 1.9999998
22 Added (B) 0.242571 4 N/A 1.99999132
23 Added (C) N/A 3.999999301 0.67934 1.99999132

The parameters denoted with the postfix “1” are used for logistic maps and “2” for Tent
maps when the algorithm used both maps. To compare the results of this experiments 3

35
more PRBS were generated using the 𝑟𝑛𝑑 function of Matlab that uses the Mersenne
Twister algorithm to generate its random numbers.

3.4. Evaluation of the PRB sequences


To determine if the sequence is random a series of statistical test can be applied to the
sequence, the level of the randomness can be determined by using a significance level
in the test like was mentioned in the subsection of Statistical Test. The FIPS make a suite
for randomness test, FIPS 140-1 specifies four statistical test for randomness, instead of
making the user of a test select an appropriate significance level for that test, explicit
bounds are determined by this suit then the computed values of a statistic must satisfy.
A single sequence of length 20,000 bits, is subjected to each of the following tests, if any
of these tests fail, then the PRBG fails the test and is rejected for the FIPS.

1) Mono-bit test: The number of ones in the sequence should satisfy 9,654 < 𝑜𝑛𝑒𝑠 <
10,346.
2) Poker test: The statistic of this test defined by equation 2.6 is computed for 𝑚 = 4.
The test should satisfy 1.03 < 𝑋𝑝𝑜𝑘𝑒𝑟 < 57.4.
3) Runs test: The number of Blocks and Gaps, of different length, are counted, runs
of length greater than 6 are considered of length 6. The runs test satisfies if the 12
counts of Blocks and Gaps are each within the corresponding interval specified in
Table 3.4.

Table 3.4. Required lengths for the runs test in FIPS 140-1.

Length of the run Required interval


1 2267 – 2733
2 1079 – 1421
3 502 – 748
4 223 – 402
5 90 – 223
6 90 – 223
4) Long Runs test: The long runs test satisfies if there are no runs of length 34 or
more.

36
3.4.1. FIPS 140-1 implemented in LabVIEW
The suit FIPS 140-1 was implemented in “G” to evaluate the sequences generated by the
previous algorithms. LabVIEW gives the capability to show the results of the test in a
visual way to ease the understanding of the output results of each test. The suit
implemented in LabVIEW give to the user the entire information of each of the four test
and a result that indicate if the sequence is rejected or not. Figure 3.14 shows the user
interface of the suit.

Figure 3.14. The user interface of FIPS 140-1 in LabVIEW.

The generated sequences are loaded in the suit on the left side of Figure 3.14, then when
the start button has pressed the test FIPS 140-1 processes each sequence loaded one
by one. The results are displayed on the right side of Figure 3.14, in this part, the name
of the sequence and its overall result are presented on the top part of the section, the
detailed results are displayed below this result each identified by its name.

37
Figure 3.15. Main "G" program of FIPS 140-1 suit in LabVIEW.

The “G” program of the suit was implemented in a structured way, following the
programming guidelines of LabVIEW, to ease the understanding of the functionality of the
suit. Figure 3.15, Figure 3.16, Figure 3.17 and Figure 3.18 show the “G” program of the
implemented suit.

Figure 3.16. "G" program of mono bit test.

Figure 3.17. "G" program of poker test.

38
Figure 3.18. "G" program of runs and long runs tests.

39
40
4. Chapter 4. Results
This section presents all the results for the experiments done in this work. In the same
way, a brief analysis is presented for each result obtained.

4.1. Importance of the precision factor in the randomness of the PRBS


A PRBS generated using the standard precision of Matlab is not the same compared with
a PRBS using the same algorithm with the same parameters but a higher precision. To
determine if the precision is relevant in the randomness of a PRBS, an analysis of this
factor had t implemented. The algorithms “log” and “log + log” were executed using the
standard precision of Matlab and a higher precision using 32 significance ciphers after
dot with the VPA function. Table 4.1 shows the results of this analysis in FIPS 140-1.

Table 4.1. Comparison table of the precision factor in the production of PRBS.

Algorithm Baud-Rate Mono-Bit Test Poker Test Runs Test Long Runs Test
log 13.33 Mbit/s Not Rejected Not Rejected Not Rejected Not Rejected
log VPA 97 bit/s Not Rejected Not Rejected Not Rejected Not Rejected
log + log 6.98 Mbit/s Not Rejected Not Rejected Not Rejected Not Rejected
log + log VPA 58 bit/s Not Rejected Not Rejected Not Rejected Not Rejected

The results show that the precision is not a factor when PRBS are produced, however,
the baud-rate using high precision decrease considerably.

4.2. Results of the FIPS 140-1


The FIPS 140-1 suit was the instrument to measurement the randomness in all the
experiments, this gives information about what kind of operations and processes give to
the algorithm good statistical properties of randomness. Table 4.2 shows the result of this
analysis.

41
Table 4.2. FIPS 140-1 results.

ID Algorithm Mono-Bit Test Poker Test Runs Test Long Runs Test
01 log Not Rejected Not Rejected Not Rejected Not Rejected
02 log Not Rejected Not Rejected Not Rejected Not Rejected
03 log + log Not Rejected Not Rejected Not Rejected Not Rejected
04 log + log Not Rejected Not Rejected Not Rejected Not Rejected
05 log ⊕ log Not Rejected Not Rejected Not Rejected Not Rejected
06 log ⊕ log Not Rejected Not Rejected Not Rejected Not Rejected
07 tent Not Rejected Not Rejected Not Rejected Not Rejected
08 tent Not Rejected Not Rejected Not Rejected Not Rejected
09 tent + tent Not Rejected Not Rejected Not Rejected Not Rejected
10 tent + tent Not Rejected Not Rejected Not Rejected Not Rejected
11 tent ⊕ tent Not Rejected Not Rejected Not Rejected Not Rejected
12 tent ⊕ tent Not Rejected Not Rejected Not Rejected Not Rejected
13 log + tent Not Rejected Not Rejected Not Rejected Not Rejected
14 log + tent Not Rejected Not Rejected Not Rejected Not Rejected
15 log + tent Not Rejected Not Rejected Not Rejected Not Rejected
16 log + tent Not Rejected Not Rejected Not Rejected Not Rejected
17 log ⊕ tent Not Rejected Not Rejected Not Rejected Not Rejected
18 log ⊕ tent Not Rejected Not Rejected Not Rejected Not Rejected
19 log ⊕ tent Not Rejected Not Rejected Not Rejected Not Rejected
20 log ⊕ tent Not Rejected Not Rejected Not Rejected Not Rejected
21 Added (A) Rejected Rejected Rejected Not Rejected
22 Added (B) Rejected Rejected Rejected Not Rejected
23 Added (C) Rejected Rejected Rejected Not Rejected
24 Matlab 1 Not Rejected Not Rejected Not Rejected Not Rejected
25 Matlab 2 Not Rejected Not Rejected Not Rejected Not Rejected
26 Matlab 3 Not Rejected Not Rejected Not Rejected Not Rejected

The use of arithmetic operations such as addition and XOR function to join to chaotic
maps results in PRBS that are acceptable applications that require it. In the other hand
processes, such as concatenate or intercalate two chaotic maps results in a not

42
acceptable PRBS for applications. Matlab based PRBG also has an acceptable
randomness properties per FIPS 140-1 suite. The detailed results of this analysis are
shown in appendant’s section.

4.3. Baud-Rate
The speed of the PRBS generation is another important point to evaluate when various
PRGN are tested, is useless to have the best statistical properties of randomness when
the production is a lack of speed. To obtain this aspect the time of each algorithm execute
was measured, Table 4.3 shows the average Baud-Rate of each algorithm used.

Table 4.3. Average baud-rate of the PRBG algorithms.

Algorithm Baud-Rate

log 13.33 Mbit/s

log + log 6.98 Mbit/s

log ⊕ log 8.66 Mbit/s

tent 13.79 Mbit/s

tent + tent 7.14 Mbit/s

tent ⊕ tent 8.62 Mbit/s

log + tent 7.01 Mbit/s

log ⊕ tent 8.47 Mbit/s

Matlab 9.30 Mbit/s

The results show that single chaotic maps based PRBG (1-dimension) has the better
baud-rate. Double chaotic maps based PRBG (2-dimension) joined with and XOR
function has a better performance than the joined with and addition. Per random function
of Matlab generates its random numbers when Matlab starts, do not generate random
numbers each iteration, Matlab-based PRBG has a better result than 2-dimension chaotic
map PRBG.

43
4.4. Algorithm Complexity Analysis
To obtain a second metric of the performance of the algorithms, an analysis of its
complexity was realized on the proposed PRGB that use two chaotic maps and achieved
the higher baud-rate, i.e. log⊕log and tent⊕tent, as well as the algorithm already
reported in the literature, i.e. logmap2.

The complexity analysis assesses the consumption of computational resources for one
complete evaluation of an algorithm input. In this analysis, basic operations such as
addition, subtraction, multiplication, division, comparison, and assignation are considered
to consume the same amount of computational resources; more complex operations are
considered to be a combination of these basic operations. The total number of operations
indicates the complexity of the algorithm; if a loop structure is implemented in the
algorithm, operations inside of this loop are represented by the number of iterations to be
realized according to the input. Table 2.1The results of this analysis are shown in Table
4.4.

Table 4.4. Algorithm Complexity Analysis Results.

Algorithm Complexity
logmap2 6 + 20𝑛
log⊕log 6 + 18𝑛
tent⊕tent 6 + 16𝑛 𝑡𝑜 6 + 18𝑛

In this table, 𝑛 represents the number of iterations, i.e. the number of bits to be produced.
The results show that the proposed algorithms are less complex than the previously
reported in literature. In the case of the tent⊕tent algorithm, its complexity varies acording
to the output in each iteration; from 6 + 16𝑛 to 6 + 18𝑛.

44
5. Chapter 5. Applications
This section presents the results of the implementation of the log ⊕ tent algorithm in an
Intel Edison device to compare the performance of software and hardware
implementation. In the same way, an encryption application was implemented on
LabVIEW to demonstrate the utility of the PRBS.

5.1. Hardware Implementation


The Intel Edison is a configurable dual-core processor with 1 GB of RAM, 4 GB of flash
memory, 40 multiplexed GPIO, BLE, and Wi-Fi [33]. This hardware can be programmed
with open-source language Arduino. Figure 5.1 shows the Intel Edison board and the
Arduino programming environment.

Figure 5.1. Left, Arduino programming environment. Right, Intel Edison Board.

To generated the PRBS the algorithm in Arduino needs a single seed and the number of
bits to produce, these parameters are introduced by the serial terminal port of the board.
Internally the algorithm transforms the single seed into two seeds, one for each chaotic
map, and produce the PRBS. When the PRBS is already complete Arduino print the
complete sequence in the Serial Terminal. Then there are three processes to identify: set
the parameters, the produce of the PRBS and print the PRBS in the terminal. To compare
the performance between the implementation of the PRBG in software and hardware the
total time elapsed in the producing process was a measurement in Arduino to compare
the baud-rate production.

45
The code of the Arduino algorithm of this implementation is present in the appendant’s
section.

5.1.2. Results of the hardware implementation


The results obtained by hardware were calculated with the following parameters. The
seed was 0.456 and the number of bits to produce was 20,000 to maintain similarity with
the production of the software implementation and use the FIPS 140-1 suit.

The PRBS obtained was saved in TXT format. The results obtained by the FIPS 140-1
suit were satisfactory in term of statistical random properties Figure 5.2 shows this results.

Figure 5.2. The result of the FIPS 140-1 suit for the PRBG implemented on hardware.

This experiment was executed 10 times to obtain a mean of the time of production to get
the baud-rate performance of the hardware implementation. The mean time of production
of 20,000 bits was 1.87 milliseconds. Then the baud-rate increase from 8.47 𝑀𝑏𝑖𝑡/𝑠 to
10.70 𝑀𝑏𝑖𝑡/𝑠.

5.2. Encryption Application


To demonstrate the use of the PRBS in the cryptology area, an encryption system was
implemented of LabVIEW using as a key the PRBG implemented on hardware previously.
This application open the file to be encrypted (e.g. audio, image, video, text, etc.) in form
of text, this text is known as plain-text, then the number of bits necessary to encrypted it
46
is calculated and send to the Intel Edison device by the serial port, the seed is calculated
using different variables present in the moment of the request for the encryption process.
The Intel Edison device generates the PRBS specific for the current plaintext and sends
the PRBS to LabVIEW by the serial port to start the cipher process and generates the
ciphertext.

The cipher process creates a non-file-extension file of the ciphertext to make harder the
decipher process for third persons. The cipher process also hides in the cipher-text the
codes to produce the file-extension and the seed to decipher the ciphertext, this can only
be possible with the use of the algorithm implemented on LabVIEW and in the Intel Edison
device. The deciphering process just needs a ciphertext and be executed to regenerate
the plaintext.

The cipher process was implemented using the state machine methodology to maintain
an order of each sub-process. The application generated the ciphertext from plaintext
using LabVIEW and the Intel Edison device key. In the same form, the information of the
original plain text was recover by using the inverter process of the encryption algorithm.
The application can cipher any kind of file and recovery after that. Figure 5.3 shows the
state machine diagram implemented on LabVIEW for this application, the detailed “G”
program is shown in the appendant’s section.

Figure 5.3. State Machine diagram for the encryption algorithm.

47
48
6. Chapter 6. Analysis and Conclusions
This section analyzes results related to the implementation of the PRBS. It also presents
the conclusions of the hypothesis questions and outlines the possible future researcher
related to this work.

6.1. Application Analysis


It was possible to generate ciphertext from a plaintext and encrypt any kind of file using
the development application in LabVIEW and in an independent way the key generator in
the Intel Edison device. This scenario can be implemented in mobile situations where
data security is needed, for example, the medical records that contain personal
information about the patients, bank transaction reports, and confidential business files
document whit a potential to be stolen and used for not legal situations. Often this kind of
documents have a small group of individuals with the permissions to access them, so the
use of encryption protocol with the possibility to separate and integrate the key generator
in a small and portable device could be the solution to control the access to that kind of
digital application or documents.

6.2. Conclusions
A High Baud-Rate PRBG was implemented using the combination of logistic and tent
maps. The proposed PRBG satisfies the requirements of the FIPS 140-1 for cryptographic
applications and had a higher Baud-Rate and lower complexity compared with others
already implemented in literature. To use these maps as PRBG is necessary to configure
the mathematical parameters of each map in a region where the outputs have a chaotic
behavior.

In the same way, the nature of their combination is a crucial factor to generated PRBS
with the necessary statistical properties of randomness. It was shown that sequential and
intercalated order are methods that not generated PRBS with that properties, on the other
hand, addition and XOR operations resulted in the generation of PRBS with that
necessary property. Also, it was found that precision used in operations change the PRBS
produced by the generator but this not affects the statistical properties of the resulting
PRBS. Finally, the implementation of the PRBG in hardware was possible, the statistical
properties of the PBRS remain the same while the baud-rate production increase.

49
50
A Appendix A
The following section shows the codes of the PRBG implemented in Matlab.

51
52
53
54
55
56
B Appendix B
The next section shows the detailed results of the PRBS in the FIPS 140-1 suit.

Figure B.1. Detailed results for Experiment ID 01, log PRBG.

Figure B.2. Detailed results for Experiment ID 02, log PRBG.

57
Figure B.3. Detailed results for Experiment ID 03, log + log PRBG.

Figure B.4. Detailed results for Experiment ID 04, log + log PRBG.

58
Figure B.5. Detailed results for Experiment ID 05, log ⊕ log PRBG.

Figure B.6. Detailed results for Experiment ID 06, log ⊕ log PRBG.

59
Figure B.7. Detailed results for Experiment ID 07, tent PRBG.

Figure B.8. Detailed results for Experiment ID 08, tent PRBG.

60
Figure B.9. Detailed results for Experiment ID 09, tent + tent PRBG.

Figure B.10. Detailed results for Experiment ID 10, tent + tent PRBG.

61
Figure B.11. Detailed results for Experiment ID 11, tent ⊕ tent PRBG.

Figure B.12. Detailed results for Experiment ID 12, tent ⊕ tent PRBG.

62
Figure B.13. Detailed results for Experiment ID 13, log + tent PRBG.

Figure B.14. Detailed results for Experiment ID 14, log + tent PRBG.

63
Figure B.15. Detailed results for Experiment ID 15, log + tent PRBG.

Figure B.16. Detailed results for Experiment ID 16, log + tent PRBG.

64
Figure B.17. Detailed results for Experiment ID 17, log ⊕ tent PRBG.

Figure B.18. Detailed results for Experiment ID 18, log ⊕ tent PRBG.

65
Figure B.19. Detailed results for Experiment ID 19, log ⊕ tent PRBG.

Figure B.20. Detailed results for Experiment ID 20, log ⊕ tent PRBG.

66
Figure B.21. Detailed results of the first experiment with the Matlab PRBG.

Figure B.22. Detailed results of the second experiment with the Matlab PRBG.

67
Figure B.23. Detailed results of the third experiment with the Matlab PRBG.

Figure B.24. Detailed results of the added(A) PRBG.

68
Figure B.25. Detailed results of the added(B) PRBG.

Figure B.26. Detailed results of the added(C) PRBG.

69
70
C Appendix C
The next section shows Arduino code of the PRBG implemented in the Intel Edison board.

String seed = ""; // a string to hold incoming data for the seed
boolean stringComplete1 = false; // whether the string for seed is complete
String bits = ""; // a string to hold incoming data for the required PRB
boolean stringComplete2 = false; // whether the string for required bits is complete
boolean flag1 = false; // flag to enter to the next while cycle
double ds = 0.00; // double representation of seed char variable
unsigned long t1, t2, dt; // marks to mesuare the time elapsed in the produce process in us

void setup() {
// initialize serial:
Serial.begin(115200);
// reserve 200 bytes for the inputs:
seed.reserve(200);
bits.reserve(200);
}

void loop() {

while (Serial.available() && !flag1)


{
// get the new seed by serial port:
char inChar = (char)Serial.read();
// add it to the the seed variable:
seed += inChar;
// if the incoming character is a newline, set a flag
// so the main loop can do something about it:
if (inChar == '\n') {
stringComplete1 = true;
flag1 = true;
}
}

// set the seed into double format for the operations


if (stringComplete1)
{
int is = seed.toInt();
ds = is/pow(10,(seed.length())-1);
//Serial.println(ds);
// clear the seed for new operation:
seed = "";
stringComplete1 = false;
}

while (Serial.available() && flag1)


{
// get the required PRB to produce:
char inChar2 = (char)Serial.read();
// add it to the bits variableg:
bits += inChar2;
// if the incoming character is a newline, set a flag

71
// so the main loop can do something about it:
if (inChar2 == '\n') {
stringComplete2 = true;
flag1 = false;
}
}

// set the number of PRB to produce as an integer and produce the PRBS by log XOR tent algorithm:
if (stringComplete2)
{
int ib = bits.toInt();
int PRBS[ib];
double xi = ds;
double xip = ds/1.78;
int b1;
int b2;
int rb;
// code of PRBG algorithm
t1 = micros(); // start time measurement
for (int i = 0; i < ib; i++){
double xi1 = 4*xi*(1-xi);
xi = xi1;
if (xi < 0.50){
b1 = 0;
}
else{
b1 = 1;
}
double xip1 = 1.999999618*min(xip, 1-xip);
xip = xip1;
if (xip < 0.50){
b2 = 0;
}
else{
b2 = 1;
}
rb = b1^b2;
PRBS[i] = rb;
}
t2 = micros(); // end time measurement
// end of code of PRBG algorithm
//print the PRBS in Serial Port
for (int i = 0; i < ib; i++){
Serial.println(PRBS[i]);
}
// clear the variables for new operation:
bits = "";
ds = 0.00;
stringComplete2 = false;
// calculate and print time elapsed
dt = t2-t1;
Serial.println(dt);
}
}

72
D Appendix D
The next section shows the “G” program of the encryption process implemented in
LabVIEW.

Figure D.1. The first state of the encryption algorithm implemented in LabVIEW.

Figure D.2. The second state of the encryption algorithm implemented in LabVIEW.

73
Figure D.3. The third state of the encryption algorithm implemented in LabVIEW.

Figure D.4. The fourth state of the encryption algorithm implemented in LabVIEW.

74
Figure D.5.The fifth state of the encryption algorithm implemented in LabVIEW.

75
76
Bibliography
[1] R. Lozi, “Designing chaotic mathematical circuits for solving practical problems,”
Int. J. Autom. Comput., vol. 11, no. 6, pp. 588–597, 2014.
[2] Li Shujun, M. Xuanqin, and C. Yuanlong, “Pseudo-Random Bit Generator Based
on Couple Chaotic Systems and its Application in Stream-Ciphers Cryptography,”
Prog. Cryptol. - {INDOCRYPT} 2001, vol. 2247, pp. 316–329, 2001.
[3] G. Alvarez, G. Pastor, F. Montoya, and M. Romera, “Chaotic Cryptosystems,” Proc.
IEEE Int Carnahan Conf. Secur. Technol., pp. 332–338, 1998.
[4] L. Kocarev, G. Jakimoski, T. Stojanovski, and U. Parlitz, “From chaotic maps to
encryption schemes,” Circuits Syst. 1998. ISCAS ’98. Proc. 1998 IEEE Int. Symp.,
vol. 4, pp. 514–517, 1998.
[5] G. M. Bernstein and M. A. Lieberman, “Secure Random Number Generation Using
Chaotic Circuits,” IEEE trans. Circuit Syst., vol. 37, no. 8, pp. 1157–1164, 1990.
[6] Z. Kotulski, J. Szczepanski, K. Gorski, A. Paszkiewicz, and A. Zugaj, “Application
of discrete chaotic dynamical systems in cryptography - DCC method,” Int. J. Bifurc.
Chaos, vol. 9, no. 6, pp. 1121–1135, 1999.
[7] A. J. Menezes, P. C. Van Oorschot, and S. a. Vanstone, Handbook of Applied
Cryptography, vol. 106. 1997.
[8] A. Kanso and N. Smaoui, “Logistic chaotic maps for binary numbers generations,”
Chaos, Solitons and Fractals, vol. 40, no. 5, pp. 2557–2568, 2009.
[9] V. Patidar, K. Sud, and N. Pareek, “A pseudo random bit generator based on
chaotic logistic map and its statistical testing,” J. Informatical, vol. 33, no. October
2015, pp. 441–452, 2009.
[10] G. ALVAREZ and S. LI, “Some Basic Cryptographic Requirements for Chaos-
Based Cryptosystems,” Int. J. Bifurc. Chaos, vol. 16, no. 8, pp. 2129–2151, 2006.
[11] D. E. Knuth 1938, “The art of computer programming,” Addison-Wesley Prof., vol.
2, p. 4, 2005.
[12] H. Chan, A. Perrig, and D. Song, “Random key predistribution schemes for sensor
networks,” Proc. - IEEE Symp. Secur. Priv., vol. 2003–Janua, pp. 197–213, 2003.
[13] O. Jallouli, M. Abutaha, S. El Assad, M. Chetto, A. Queudet, and O. Deforges,
“Comparative Study of two Pseudo Chaotic Number Generators for Securing the
IoT,” Intl. Conf. Adv. Comput. Commun. Informatics, pp. 1340–1344, 2016.

[14] S. Dogan, “A new data hiding method based on chaos embedded genetic algorithm
for color image,” Artif. Intell. Rev., vol. 46, no. 1, pp. 129–143, 2016.
[15] Y. Zhou, Z. Hua, C. M. Pun, and C. L. Philip Chen, “Cascade Chaotic System with
Applications,” IEEE Trans. Cybern., vol. 45, no. 9, pp. 2001–2012, 2015.

77
[16] H. P. Y. Xu and J. H. Cho, “Discussion on Randomness and the Linear Congruential
Generator,” pp. 1–6, 1951.
[17] A. Rukhin, J. Soto, J. Nechvatal, S. Miles, E. Barker, S. Leigh, M. Levenson, M.
Vangel, D. Banks, A. Heckert, J. Dray, and S. Vo, “A statistical test suite for random
and pseudorandom number generators for cryptographic applications,” Natl. Inst.
Stand. Technol., vol. 800, no. April, p. 131, 2010.
[18] R. M. May, “Simple mathematical models with very complicated dynamics,” Nature,
vol. 261, no. 261, pp. 459–467, 1976.
[19] A. Kasman, It Must Be Beautiful: Great Equations of Modern Science, vol. 110, no.
8. 2003.
[20] C. Zhang, “Period three begins,” Math. Mag., vol. 83, pp. 295–297, 2010.
[21] S. M. Ulam and J. von Neumann, “On combinations of stochastic and deterministic
processes,” j-BULL-AMS, vol. 53, p. 1120, 1947.
[22] Z. Kotulski and J. Szczepanski, “Discrete chaotic cryptography,” Ann. Phys., vol. 6,
no. 5, pp. 381–394, 1997.
[23] L. Kocarev and G. Jakimoski, “Logistic map as a block encryption algorithm,” Phys.
Lett. Sect. A Gen. At. Solid State Phys., vol. 289, no. 4–5, pp. 199–206, 2001.
[24] A. C. Yao, “Theory and application of trapdoor functions,” 23rd Annu. Symp. Found.
Comput. Sci. (sfcs 1982), pp. 80–91, 1982.
[25] J. Rauch, “Conjugating the Tent and Logistic Maps,” University of Michigan, pp. 4–
6.
[26] H. Beker and F. Piper, “Cipher systems: the protection of communications,” New
York van Nostrand Reinhold, p. 212, 1982.
[27] D. Gordon, “Discrete Logarithms in GF(P) Using the Number Field Sieve,” SIAM J.
Discret. Math., vol. 6, no. 1, pp. 1–19, 1993.
[28] A. M. Mood, “the Distribution Theory of Runs,” Source Ann. Math. Stat., vol. 11, no.
4, pp. 367–392, 1940.
[29] H. Gustafson, “Statistical Analysis of Symmetric Ciphers,” 1996.
[30] NIST, “Security Requirements for Cryptographic Modules,” Fips Pub 140-2, vol.
FIPS PUB 1, p. 1, 2001.
[31] National Institute of Standards and Technology, “FIPS General Information,” 2016.
[Online]. Available: http://www.nist.gov/itl/fipsinfo.cfm.
[32] L. K. Cormack, “MATLAB Intro Web Page.”.
[33] W. Guide, “Intel ® Edison,” 2015.

78
Resume
Carlos Alberto Carrillo Cortez was born in Tepic, Nayarit, México, on June 13th, 1991. He
earned the Bachelors Engineering degree in Mechatronics from the Instituto Tecnológico
y de Estudios Superiores de Monterrey, Monterrey Campus in December 2014 with
mention of academic excellence at EGEL CENEVAL. He was accepted into the Master
of Science in Electronic Engineering program in August 2015. During the Master program,
he participated in the MIT Enterprise Forum México and the INTEL Innovation Week on
November 2016, in the same month he got the award to the entrepreneur in health 2016
by TecSalud in the INC Monterrey, he belongs to the IoT to the Cloud Lab where he leads
workshops about the environment of the IoT for the Congress of Automation and
Technology 2017 “AT17” in April 2017 and the Congress Connect by SISTI in October
2016. He earned the Master of Science degree in Electronic Engineering from the Instituto
Tecnológico y de Estudios Superiores de Monterrey, Monterrey Campus in May 2017.

LinkedIn Profile

79

You might also like