Mouse Movement with 3D Chaotic Logistic Maps to Generate Random Numbers

Since last three decades there are close relationships between chaotic theory and cryptographic theory. Chaotic system behaviors like; highly sensitive to initial states, mix up attribute, deterministic nature and also cannot predict the long term returns, these characteristics help the researchers to enhance security of a cryptography systems, therefore growing number of random numbers generators based on chaotic have been proposed. These proposed generators suffer from limited key space and those based on 1D chaotic map have limited entropy generation capability due to their finite number of Lyapunov exponent(s). In this paper, we propose a random binary sequences generator that produces sequence of bits. General structure of proposed model consists of two parts, first part is mouse device as the nondeterministic source and second part is 3D chaotic system with the coordinates of mouse cursor when movement as the initial seeds, and combines the produced values in algorithmic process. The coordinates of mouse cursor are treated as initial random number with post processing with 3D chaotic maps to increase the randomness and security of the keys. The proposed work has high key space and very long period. Also make obvious that the generated keys possess successful statistical characteristics which is expected of true random binary sequences that are suitable to use in critical cryptography systems, these made by evaluating the results by hardness of 16 tests of NIST(National Institute of Standards and Technology).


Introduction
Random Numbers Generators (RNGs) are beneficial for a large number of systems including cryptography applications, stochastic modeling, simulation, and online gaming and lotteries [1]. To propose a successful RNG, we should keep in mind it possesses successful characteristics of randomness, it should be reliable, have minimum cost, unpredictable, complexity of the system, fast produced and so on. Usually, two techniques are available to generate random numbers: first technique depends on deterministic method processed using specific programs, the random numbers being generated from a specific singular input number, such generator called PRNG, commonly they have higher speed and are better to produce large quantities of numbers. Second generator counts on high entropy source, with specific post-processing processes to these counted sources to generate random numbers, these can be from nondeterministic and stochastic physical events [2], or from deterministic but chaotic [3]. TRNG is commonly based on all types of physical events, these can be thermal noise [4], atmospheric noise [5], radioactive decay [6] and flip a coin. They are considered to generate random sequence with higher security. However, when running on PC platforms which are most popular with common consumers, these TRNGs demands specific expensive equipments which in return be unprofitable for computers users.Since last three decades, researchers have shown that an interesting relationship between cryptography and chaos exists [7]. The chaotic system behaviors like; highly sensitive to initial states, mix up attribute, deterministic nature and also cannot predict the long term returns, these characteristics help the researchers to enhance security of a cryptography systems. So diversities in the initial condition for chaotic system are important for performance of the system to produce highly randomize numbers that have very long period and key space.In this paper, we develop a web application to do an alternate method of seeding chaotic maps, generally consist of two components, the coordinates of mouse device and 3D chaotic maps to produce multiple pseudo-random sequences. The coordinates of mouse cursor are collected while the user moves his/her mouse over the screen for a while to produce a predefined number of values. Repetition of same values has the disadvantage that the same sequences will always be generated from the same seed [8]. To increase the security, manipulation is done for these coordinates, repeating same coordinate is not allowed and neglected. And when these numbers are enough to seed the 3D chaotic maps system then generator will be ready to generate random sequences of binary bits which can be used in the cryptography application. The proposed work has high key space and very max period. We make obvious that the generated keys possess efficient statistical characteristics which is expected of true random binary sequences that are suitable to use in critical cryptography systems. These made

Random Number Generator Using Chaos Theory
Chaos theory is an area of mathematical science that studies the dynamic systems behavior, as we state earlier it is a good choice to use in designing of random number generator [9]. In fact, chaotic system behaviors like; highly sensitive to initial states, mix up attribute, deterministic nature and also cannot predict the long term returns [10], so these properties are valuable in cryptography.Logistic equation of chaos which is explained below can be used to generate large pseudo random numbers. To increase the randomness of produced keys and make the keys more secure it is preferable to use several logistic equations during the generator design stage.

Chaos Logistic Equation
It is a dynamic system second order deference equation; the standard from of the logistic equation is given by: Where Yi is called the iteration of Y0 (or population) and should by in subinterval [0, 1], and R is the growth rate of a population that takes any values between [1,4].  Figure 2(b), shows that how the system is sensitive to initial conditions for R = 4.0. It illustrates how tow trajectories as the initial conditions to the system have began at almost same values and eventually take different paths with respect to the time.
Obviously seems that they have no relation between them. Figure 2(c), we used the bifurcation diagram to show how the dynamic system behaves. It obvious that the states of the mapping is bounded in the region between (0, 1) at R=4.0.This plot illustrates the dynamic changes in the logistic equation with respect to growth rate R (from 2.6 to 4.0 only). From this plot, if R is almost in the range between (2, 3) the system will have one period of behavior (steady state) at different points. If R is almost in the region between (3, 3.5) the system will have two periods of behaviors at different points. If R is almost in the range of (3.5, 3.7) the system will have 4 periods of behaviors, and so on. Increasing the periodicity of the system when the R is close to 4 and the system behavior will be unpredictable and looks random [11]. The negative value of Lyapunov exponent refers to non chaotic system(almost when R < 3.6). (2)

3D Logistic Map
The logistic map which is given by equation (1) is one dimension 1D, which depends only on one state variable (Y). The 2D extension of logistic map has been proposed by Hongjuan Liu.
et al, which is given by the following two equations: These two equations depend on two states variables (Y) and (Z). The equations increase the complexity of the system and hence increase the security level. The parameters of these equations control the system behaviors.

Mouse Movement
As we stated earlier, a true random number can be generated by various methods of nondeterministic source, for example mechanical and electronic noise. In most cases, those methods require additional devices, which make their applications not universal. On the other hand a mouse device is used for pointing an object over the computer screen and controlled by user hand. Any motion of a mouse device on the screen has two dimensions, X-axis and Y- axis corresponding to the coordinates of the mouse cursor on a surface at the specific point.
The movement of the mouse cursor is interpreted into the digital movement. This is done by available application programming interface (APIs). Therefore at any position on the screen, mouse cursor has a unique X-axis and Y-axis values [14]. When the user move the mouse over the screen these values can be collected and processed for further works. Different numbers are generated each time when the user attempts to move the mouse cursor over the web page. It is difficult for the user to repeat the same pattern of moving. These generated numbers can be considered as a sequence of random numbers. Therefore, there is no need to buy additional device to generate random numbers. Also it is inexpensive, suitable and useful technique to produce numbers. It sounds good to use such a advice as a source of random numbers. Before seeding the 3D chaotic maps, these numbers are processing as we explain later.

Proposed model
In the proposed work, it has been developed a web application to do an alternate method that seeded chaotic maps. General structure of proposed method consists of two components, mouse movement and 3D chaotic system. See figure (3).

Figure (3): General structure of the proposed random bits generator
The first part of the proposed random bits generator which related to a mouse device requires the computer user moves his/her mouse cursor for a while to generate enough coordinates (Xaxis and Y-axis) and then using these coordinates as the initial conditions to seed the chaotic generator.These coordinates are collected while cursor is moving over the screen of the web page to produce two sequences of different values with same length (m), first sequence for Xaxis(called Xm) and second sequence for Y-axis(called Ym). This done using JavaScript methods. To increase the security, repeating same coordinate is not allowed and neglected. Since these sequences will be the initial conditions to the 3D chaotic maps, the slightest variation of these values will eventually diverge completely. These sequences are multiplied by some fraction to be numbers between [0, 1].
3D logistic maps require 3 coefficients, say X, Y and Z. And mouse movement generates two sequences only. To get the third sequence Zm, proposed next formula is used. By subtraction each number in each sequence and multiply the results by the current data and time (Tcurr).

Current date and time is employed in ANSI X9.17(American National Standards
Institute) [15], which is updated on each number generation.
The third sequence is multiplied by some fraction to be in interval [0,1]. Therefore See figure (4).

Figure (4): The operating principle of the first part
These three output sequences will be the initial conditions for the second part of the system (3D chaotic system). Such that the values of X0,Y0 and Z0 will be the initial conditions to the 3D chaotic equations of the system to generate 256 binary bits (now m=0). The next X1,Y1 and Z1 will be the second initial conditions to the 3D Chaotic equations of the system to produce another 256 binary bits (now m=1) and so on for each m. To enter in chaotic behavior (increase the complexity and randomness of generated numbers) which are the desirable properties in cryptography systems, the proposed method ignores first 1000 iterations of each m. After 1000 iterations (proposed generator suggests more than thousand iteration for each m) select 256 numbers from each generated sequences (Xm,Ym and Zm) and comparing these three sequences in algorithmic way to get the two binary sequences(say X and Y). For more explanation let's take these steps of our generator processes; Step1: Generate two sequences Xm and Ym while moving the mouse devise by a user for a specific time.
Step2: Discard the repeated same numbers Step4: Numbers in each three sequences are multiplied by some fraction to be values between Step5: Xm, Ym and Zm sequences are the initial conditions to equation numbers (4), (5) and (6) And also generate second binary bits (R2) from decimal values by comparing the values of new Yi and Zi using this threshold: Step8: for each i, the two new 256 bit sequences of binary R1 and R2 are XORing together in order to generate the final 256 bit as the output of our generator.
For example, if the values of X10, Y10 and Z10 will be 0.271, 0.146 and 0.345 respectively, then these initial condition will enter the chaotic equations and produce 3 sequences of different numbers such that: At the end we will have a huge numbers of binary keys that can be used in cryptography systems.

Statistical testing
To be confidence, that the proposed generator can produce random binary bits that should be cryptographically secure, they should be tested by specific tests that are dedicated to check whether the generated sequences of binary bits are expected to be like the truly random sequence or not For analyzing these sequences, two most common testing methods available to do so; the NIST tests suite [16] and the DIEHARD test suite [17]. Each suite has different types of statistical test. Each type tests specific characteristic of random numbers. Proposed binary bits are tested using five basic tests of randomness and also using the NIST tests suite which is the most strength tests.

Five Basic test
Each following statistical test examines some characteristic of generated random binary bits for a specific pattern or set of patterns. These five tests examine 50 samples, each of length 10 6

Frequency test
Pass value 0.144 with freedom degree " 1 " must be <= 3.84

Poker test
Pass value 2.464 with freedom degree " 5 " must be <= 11.1

Serial test
Pass value 2.496 with freedom degree " 3 " must be <= 7.81

Results interpretation
For testing purposes, in this case, generate 100 (m=100) sequences of binary using the proposed generator. Each sample length is 10 6 bits. We select the value of α = 0.01 and probability values (P-value) related to each sequence is computed for each test. So the total number of P-value we calculate for all samples is 5000.  Approximate entropy (Block length = 10) Success 3.

Conclusion
A new design of random number generator has been proposed. Repeated keys problems are solved in proposed generator. Mouse device is used as a non deterministic source of initial random numbers which is inexpensive, convenient and universal device. Also we mentioned that it is impossible to reproduce the same numbers with the same user. The second 3D chaotic system part has been used to increase the complexity and randomness of the generated keys. Tacking the advantages of chaotic behavior and simplicity of using mouse is the motivation of this proposed method. Eventually a huge numbers of random binary sequences that have maximum periods are generated. These binary sequences are tested. The results of these tests insured that the acceptable characteristics of generated binary sequences to be random binary sequences and hence can be used efficiently in designing of cryptography systems.