Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/337253275

CHAOSA: Chaotic map based random number generator on Arduino platform

Conference Paper  in  AIP Conference Proceedings · November 2019


DOI: 10.1063/1.5133578

CITATIONS READS

0 15

2 authors:

Borislav Stoyanov Tsvetelina Rosenova Ivanova


Konstantin Preslavsky University of Shumen Konstantin Preslavsky University of Shumen
61 PUBLICATIONS   254 CITATIONS    2 PUBLICATIONS   0 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Chaos based hash functions View project

All content following this page was uploaded by Borislav Stoyanov on 16 November 2019.

The user has requested enhancement of the downloaded file.


CHAOSA: Chaotic map based random
number generator on Arduino platform
Cite as: AIP Conference Proceedings 2172, 090001 (2019); https://doi.org/10.1063/1.5133578
Published Online: 13 November 2019

Borislav Stoyanov, and Tsvetelina Ivanova

ARTICLES YOU MAY BE INTERESTED IN

Two Zaslavsky maps in pseudorandom byte generation


AIP Conference Proceedings 2164, 120013 (2019); https://doi.org/10.1063/1.5130873

Development of FEM programs for assessing the risk of electrical breakdown of devices
operating in high humidity conditions
AIP Conference Proceedings 2172, 080013 (2019); https://doi.org/10.1063/1.5133571

AIP Conference Proceedings 2172, 090001 (2019); https://doi.org/10.1063/1.5133578 2172, 090001

© 2019 Author(s).
CHAOSA: Chaotic Map based Random Number Generator
on Arduino Platform
Borislav Stoyanova) and Tsvetelina Ivanovab)

University of Shumen, Bulgaria


a)
Corresponding author: borislav.stoyanov@shu.bg
b)
ts.r.ivanova@shu.bg

Abstract. This article presents a novel random number generation algorithm, called CHAOSA, which is based on Ikeda maps and
XOR function. The novel system is realized by the Arduino microcontroller. The quality of output sequence is evaluated by key
space analysis and ENT, DIEHARD, and NIST test packages. The results show excellent performance of the proposed generator.

INTRODUCTION

One of the main building blocks in cryptography are random number generators. They are important part in data
transmission, video encryption, and digital signatures. Chaotic maps are in the ground of many contemporary security
algorithms. In Reference [1], a byte-oriented random generator, based on linear feedback shift register, non-linear com-
pression function, and byte-oriented S-box filter with memory, is presented. Random bit extraction from the analog
chaotic signal produced by the superlattice can be found in [2]. In [3], by using the data of the angular displacements
of chaotic motion, random binary stream is produced. Modified binary generation scheme based on Chebyshev poly-
nomial map is presented in [4]. In [5], new encryption algorithm based on the Lorenz attractor and 32-bit bent Boolean
function is designed. In Reference [6], a randon number generator based on a dynamical Tinkerbell map is designed
and cryptographic analysed. A new chaotic system is proposed and tested for possible use in secure transmission
in [7]. The performance of the proposed technique is tested using NIST suite tests [8]. Symmetric modifications of
Chirikov and Henon maps are suggested in [9].
The famous Ikeda map [10, 11] is widely used as a base element in cryptographic designs. In [12], modified Ikeda
function is presented and image encryption algorithm is constructed. Novel S-box schemes from the Ikeda function
are presented in [13] and [14]. Image and video encryptions based on Ikeda attractor are designed in [15] and [16].
In [17], an image encryption using linear canonical transforms and chaotic maps (the tent map, the Kaplan-Yorke
map, and the Ikeda map) is proposed. An algorithm for chaotic encryption, which is used Ikeda and Henon chaotic
functions, is presented in [18]. Modified image encryption scheme using Logistic map for permutation and Ikeda map
for masking is proposed in [19]. Stream cipher algorithm with Ikeda map trajectories is designed in [20].
In this article we present a digital chaos function based random byte generation scheme, which is performed
by Arduino, an open-source computing platform. The microcontroller runs side-by-side Ikeda maps filtered with
Exclusive-OR logical function. Numerous papers can be found in the literature that use these platform. In References
[21], [22], and [23] chaotic random bit generation schemes, which are based on the logistic function and implemented
by Arduino UNO, are presented. Reference [24] designs novel discrete chaotic system based on modified logistic map.
The proposed scheme is programmed in Arduino Uno. Novel transmission scheme based on modified hyperchaotic
Henon system with high level of security and Arduino implementation, is constructed in [25].
Inspired of [15] and [21], we design CHAOSA, a novel random byte generation scheme based of Ikeda maps and
XOR function. The proposed algorithm is implemented on Arduino open-source platform. Extended security analysis
shows that CHAOSA has truly random output byte generation.

Proceedings of the 45th International Conference on Application of Mathematics in Engineering and Economics (AMEE’19)
AIP Conf. Proc. 2172, 090001-1–090001-7; https://doi.org/10.1063/1.5133578
Published by AIP Publishing. 978-0-7354-1919-3/$30.00

090001-1















      

FIGURE 1. 2-Dimensional plot of Ikeda map with u = 0.701

CHAOSA: CHAOTIC MAP BASED RANDOM NUMBER GENERATOR


Here we describe the Ikeda map and the random number generator CHAOSA. We also provide Arduino implementa-
tion and security analysis of the proposed algorithm.

Description of the Ikeda Map


The 2D real example of the Ikeda attractor [10, 11] is defined by the following equations:

xn+1 = 1 + u(xn cos tn − yn sin tn ), (1)


yn+1 = u(xn sin tn + yn cos tn ), (2)
where u is a parameter and
6
tn = 0.4 − . (3)
1 + x2n + y2n
The Ikeda attractor exists when u ≥ 0.6. The 2D Ikeda attractor is plotted in Figure 1.

The Proposed Random Number Generator


In this section, the scheme of Exclusive-OR logical function and side-by-side Ikeda attractors was used to propose
random number byte generation algorithm named CHAOSA. The novel algorithm CHAOSA consists of the next
steps:
1. The initial values x1,0 , y1,0 , x2,0 , zy,0 and the parameters u1 , u2 of two Ikeda maps are determined.
2. The two chaotic functions are iterated for I times.
3. The iteration of the Ikeda maps continues, and four floating-point numbers x1,i , y1,i , x2,i , y2,i , are computed and
post-processed as follows: a = mod(abs(integer(x1,i × 1010 ))), 256), b = mod(abs(integer(y1,i × 1010 ))), 256),
c = mod(abs(integer(x2,i × 1010 ))), 256), and d = mod(abs(integer(y2,i × 1010 ))), 256), where integer(z) returns
the integer part of z, truncating the value at the decimal point, abs(z) returns the absolute value of z, and
mod(z, w) returns the reminder after division.
4. Perform XOR operations: between a, b, c, and d, si = a ⊕ b ⊕ c ⊕ d. Output byte si is generated.
5. Return to Step 3 until the byte stream length is reached.

090001-2
FIGURE 2. Arduino Uno micronontroller

FIGURE 3. The setup of the Arduino Uno

Arduino Realization
We use the microcontroller board Arduino Uno, Figure 2, which is based on the ATmega328P. It has 6 analog inputs,
16 MHz quartz crystal, 14 digital input/output pins, power jack, USB connection, n-circuit serial programming header
and reset button. The Arduino is connected with the computer trough USB cable. The programming language in
Arduino is a set of C/C++ functions. There are many different libraries. That make programming the microcontroller
easier. The program is uploaded to the platform via an integrated development environment (IDE). Further information
can be found at http://arduino.cc/.
The proposed generator CHAOSA is implemented with Arduino Uno, Figure 3. It use the following initial values:
x1,0 = −0.19234589676, y1,0 = 0.212944478569, x2,0 = −0.23873247817, y2,0 = 0.189800800800, u1 = 0.7941, u2 =
0.694, and I = 300.
The terminal output bytes by the Arduino UNO were saved to a file.

Key Space Analysis


The proposed scheme CHAOSA has six initial variable x1,0 , y1,0 , x2,0 , y2,0 , u1 , and u2 . As pointed in the [26], the
computational precision of the 64-bit double-precision value is about 10−15 . Then the key space is more than 2198
bits, which is sufficient enough against brute force analysis [27]. It is bigger than other similar chaos based random
schemes [28], [29], and [30]. The initial iteration number I can be part of the key space.

090001-3
Statistical Package Analysis
In order to evaluate randomness of the byte output three statistical security test packeges are used NIST [8], DIEHARD
[31], and ENT [32].

NIST Software Analysis

The NIST package includes 15 statistical tests: monobit, block-frequency, cumulative sums, runs, longest run of ones,
rank, Fast Fourier Transform (spectral), non-overlapping templates, overlapping templates, universal, approximate
entropy, serial, linear complexity, random excursions, and random-excursion variant. 2000 × 125000 bytes were pro-
cessed using the novel scheme. The output results of the first 13 test are in Table 1. The minimum pass rate for each
statistical test with the exception of the random excursion (variant) test is approximately = 1966 for a sample size =
2000 binary sequences. The minimum pass rate for the random excursion (variant) test is approximately = 1221 for a
sample size = 1240 binary sequences. The random excursion (variant) test outputs 18 randomness probability values:
P-values and they are in Table 2. The random excursion test outputs 8 P-values which are tabulated in Table 3.
The random byte generator CHAOSA passed successfully NIST tests.

TABLE 1. NIST test suite results.


NIST test P-value Pass rate
Monobit 0.958917 1981/2000
Block-frequency 0.338479 1976/2000
Cumulative sums (Forward) 0.783973 1978/2000
Cumulative sums (Reverse) 0.938463 1977/2000
Runs 0.981151 1985/2000
Longest run of Ones 0.032167 1988/2000
Rank 0.546283 1983/2000
FFT 0.01042 1979/2000
Non-overlapping templates 0.467322 1980/2000
Overlapping templates 0.234981 1972/2000
Universal 0.562591 1982/2000
Approximate entropy 0.045675 1978/2000
Serial 1 0.527108 1978/2000
Serial 2 0.694171 1982/2000
Linear complexity 0.103753 1979/2000

ENT Software Analysis

The ENT application includes 6 tests to byte sequences. We tested stream of 250000000 bytes of the proposed gener-
ator:

• Entropy is 7.999999 bits per byte.


• Optimum compression would reduce the size of this 250000000 byte file by 0 %.
• χ2 square distribution for 250000000 samples is 281.88, and randomly would exceed this value 11.90 percent
of the times.
• Arithmetic mean value of data bytes is 127.4965 (127.5 = random).
• Monte Carlo value for π is 3.141758066 (error 0.01 percent).
• Serial correlation coefficient is -0.000060 (totally uncorrelated = 0.0).

The novel generator CHAOSA passed successfully ENT statistical tests.

090001-4
TABLE 2. NIST Random excursion
variant test results.
State P-value Pass rate
-9 0.689019 1240/1240
-8 0.942839 1225/1240
-7 0.542293 1226/1240
-6 0.864079 1223/1240
-5 0.948552 1228/1240
-4 0.343996 1229/1240
-3 0.803839 1227/1240
-2 0.958959 1227/1240
-1 0.8705 1224/1240
+1 0.398084 1227/1240
+2 0.705598 1223/1240
+3 0.534146 1226/1240
+4 0.182518 1227/1240
+5 0.228252 1221/1240
+6 0.228252 1226/1240
+7 0.059225 1226/1240
+8 0.031441 1225/1240
+9 0.613623 1221/1240

TABLE 3. NIST Random excursion test


results.
State P-value Pass rate
-4 0.987039 1229/1240
-3 0.116153 1227/1240
-2 0.869227 1229/1240
-1 0.821475 1234/1240
+1 0.623687 1220/1240
+2 0.048971 1223/1240
+3 0.122325 1223/1240
+4 0.542293 1227/1240

DIEHARD Software Analysis


The DIEHARD application [31] is a set of 19 random tests: birthday spacings, overlapping 5-permutations, binary
rank (31 x 31), binary rank (32 x 32), binary rank (6 x 8), bitstream, overlapping-pairs-sparse-occupancy, overlapping-
quadruples-sparse-occupancy, DNA, stream count-the-ones, byte-count-the-ones, parking lot, minimum distance, 3D
spheres, squeeze, overlapping sums, runs (up and down), and craps. The tests return P − values, which should be
uniform in [0,1), if the input bytes contains random numbers. The P − values are obtained by p = F(y), where F is
the assumed distribution of the sample random variable y, often the normal distribution.
The novel CHAOSA passed successfully all DIEHARD tests, Table 4.
Based on the obtained statistical software results we can conclude that the output bytes from the algorithm
CHAOSA possess excellent random-like behaviour.

CONCLUSIONS AND FUTURE WORK


We have presented the novel random number generation scheme based on Exclusive-OR logical function and Ikeda
attractor, called CHAOSA. Experimental realization on Arduino microcontroler is presented. The extended crypto-
graphic analysis shows that the CHAOSA has truly random characteristics. We intent to use the proposed random
number output scheme in steganographic algorithms [33] and chaos based secure communication.

090001-5
TABLE 4. DIEHARD statistical test results
DH TEST P-value
Birthday spacings 0.321715
Overlapping 5-permutation 0.111570
Binary rank (31 x 31) 0.582293
Binary rank (32 x 32) 0.322435
Binary rank (6 x 8) 0.505181
Bitstream 0.509928
OPSO 0.457656
OQSO 0.539746
DNA 0.436635
Stream count-the-ones 0.538116
Byte count-the-ones 0.488897
Parking lot 0.383497
Minimum distance 0.524903
3D spheres 0.610375
Squeeze 0.160613
Overlapping sums 0.523786
Runs up 0.470237
Runs down 0.428715
Craps 0.834917

ACKNOWLEDGMENTS
The paper is partially supported of the National Scientific Program ”Information and Communication Technologies
for a Single Digital Market in Science, Education and Security (ICTinSES)”, financed by the Ministry of Education
and Science.

REFERENCES
[1] D. Feng, X. Feng, W. Zhang, X. Fan, and C. Wu, “Loiss: A byte-oriented stream cipher,” in Coding and
Cryptology, edited by Y. M. Chee, Z. Guo, S. Ling, F. Shao, Y. Tang, H. Wang, and C. Xing (Springer Berlin
Heidelberg, Berlin, Heidelberg, 2011), pp. 109–125.
[2] L. L. Bonilla, M. Alvaro, and M. Carretero, Journal of Mathematics in Industry 7, 1–17 (2016).
[3] J. Zang, H. Hu, J. Zhong, D. Luo, and Y. Fang, Physics Education 53, p. 045013 (2018).
[4] B. Stoyanov, “Pseudo-random bit generator based on chebyshev map,” (2013), pp. 369–372.
[5] B. Stoyanov, “Chaotic cryptographic scheme and its randomness evaluation,” (2012), pp. 397–404.
[6] M. Todorova, B. Stoyanov, K. Szczypiorski, and K. Kordov, International Journal of Electronics and
Telecommunications 64, 457–465 (2018).
[7] H. Abdullah and H. Abdullah, Telkomnika (Telecommunication Computing Electronics and Control) 16,
1135–1142 (2018).
[8] A. Rukhin, J. Soto, J. Nechvatal, M. Smid, E. Barker, S. Leigh, M. Levenson, M. Vangel, D. Banks, A. Heck-
ert, J. Dray, and S. Vo, A statistical test suite for random and pseudorandom number generators for crypto-
graphic application, 2010, NIST Special Publication 800-22: Revision 1a, Lawrence E. Bassham III.
[9] D. Butusov, A. Karimov, N. Pyko, S. Pyko, and M. Bogachev, Physica A: Statistical Mechanics and its
Applications 509, 955–970 (2018).
[10] K. Ikeda, Optics Communications 30, 257 – 261 (1979).
[11] K. Ikeda, H. Daido, and O. Akimoto, Phys. Rev. Lett. 45, 709–712 (1980).
[12] Y. Cao, Mathematical Problems in Engineering 2013 (2013).
[13] F. Özkaynak and S. Yavuz, Nonlinear Dynamics 74, 551–557 (2013).
[14] M. Tayel, G. Dawood, and H. Shawky, “Block cipher s-box modification based on fisher-yates shuffle and
ikeda map,” in 2018 IEEE 18th International Conference on Communication Technology (ICCT) (2018), pp.
59–64.

090001-6
[15] X. Jia, “Image encryption using the ikeda map,” in 2010 International Conference on Intelligent Computing
and Cognitive Informatics (IEEE, 2010), pp. 455–458.
[16] D. Valli and K. Ganesan, The European Physical Journal Plus 132, p. 542 (2017).
[17] N. Singh and A. Sinha, Optics and Laser Technology 42, 724–731 (2010).
[18] Y. Şekertekin and Ö. Atan, “An image encryption algorithm using ikeda and henon chaotic maps,” in 2016
24th Telecommunications Forum (TELFOR) (IEEE, 2016), pp. 1–4.
[19] M. Y. M. Parvees, J. A. Samath, I. K. Raj, and B. P. Bose, “A colour byte scrambling technique for efficient
image encryption based on combined chaotic map: Image encryption using combined chaotic map,” in 2016
International Conference on Electrical, Electronics, and Optimization Techniques (ICEEOT) (2016), pp.
1067–1072.
[20] A. Susanto, “Scac-mat: Stream cipher algorithm with ikeda map trajectories,” in 2016 International Confer-
ence on Data and Software Engineering (ICoDSE) (2016), pp. 1–6.
[21] C. K. Volos, Journal of Computations & Modelling 3, 115–136 (2013).
[22] M. Z. De la Hoz, L. Acho, and Y. Vidal, “A secure communication design based on the chaotic logistic map:
An experimental realization using arduino microcontrollers,” in Computation, Cryptography, and Network
Security, edited by N. J. Daras and M. T. Rassias (Springer International Publishing, Cham, 2015), pp. 737–
756.
[23] M. Z. De la Hoz, L. Acho, and Y. Vidal, The Scientific World Journal 2015 (2015).
[24] L. Acho, Journal of the Franklin Institute 352, 3113 – 3121 (2015), special Issue on Advances in Nonlinear
Dynamics and Control.
[25] H. Hamiche, S. Guermah, R. Saddaoui, K. Hannoun, M. Laghrouche, and S. Djennoune, Nonlinear Dynam-
ics 81, 1921–1932 (2015).
[26] IEEE Std 754-2008 1–70 (2008).
[27] G. Alvarez and S. Li, International Journal of Bifurcation and Chaos 16, 2129–2151 (2006).
[28] S. Lian, J. Sun, J. Wang, and Z. Wang, Chaos, Solitons & Fractals 34, 851–859 (2007).
[29] B. Stoyanov, Applied Mathematical Sciences 8, 6205–6210 (2014).
[30] B. Stoyanov, “Using circle map in pseudorandom bit generation,” in Application of Mathematics in Technical
and Natural Sciences, AIP Conference Proceedings 1629, edited by M. D. Todorov (American Institute of
Physics, 2014), pp. 460–463.
[31] G. Marsaglia, http://www. stat. fsu. edu/pub/diehard/ (2008).
[32] J. Walker, ENT: A pseudorandom number sequence test program, 2008.
[33] H. Paraskevov and A. Stefanov, Mathematical and Software Engineering 4, 7–11 (2018).

090001-7
View publication stats

You might also like