Analog circuit and microcontroller based RNG application of a new easy realizable 4D chaotic system

Analog circuit and microcontroller based RNG application of a new easy realizable 4D chaotic system

Accepted Manuscript Title: Analog Circuit and Microcontroller Based RNG Application of a New Easy Realizable 4D Chaotic System Author: Sezgin Kac¸ar P...

331KB Sizes 1 Downloads 40 Views

Accepted Manuscript Title: Analog Circuit and Microcontroller Based RNG Application of a New Easy Realizable 4D Chaotic System Author: Sezgin Kac¸ar PII: DOI: Reference:

S0030-4026(16)30810-5 http://dx.doi.org/doi:10.1016/j.ijleo.2016.07.044 IJLEO 57964

To appear in: Received date: Accepted date:

16-5-2016 19-7-2016

Please cite this article as: Sezgin Kac¸ar, Analog Circuit and Microcontroller Based RNG Application of a New Easy Realizable 4D Chaotic System, Optik - International Journal for Light and Electron Optics http://dx.doi.org/10.1016/j.ijleo.2016.07.044 This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.

Analog Circuit and Microcontroller Based RNG Application of a New Easy Realizable 4D Chaotic System Sezgin Kaçar* [email protected]  Sakarya University, Technology Faculty, Dept. of Electrical – Electronics Engineering, Sakarya, Turkey.  *

 

Corresponding author. 

Abstract In this article a new easy-to-implement 4 dimensional chaotic system was developed and its dynamic attitudes were analyzed. Following this, analogue circuit implementation of this system was done both in Pspice simulation and real circuit components. Finally, a micro controller based random number generator in which the new chaotic system was used and also which passed all NIST randomness tests was designed. Furthermore, a user interface, designed with the help of MATLAB GUI, that helps with computer-check of the designed random number generator was presented. Keywords: Chaotic system; Analog circuit; Microcontroller; Random number generator.  

1. Introduction Studies based on chaotic systems have recently turned out to be a popular field. There are numerous applications particularly in safe communication, random number and signal generators and encryption [1-4]. Many continuous and discrete time chaotic systems in different sizes are available in literature [5-8]. Nevertheless, not every single system can be used in real applications since equations in chaotic systems are complex and values needed by the parameters and initial values are hard to obtain. Especially as the size of chaotic systems grow, it becomes harder to implement the systems. That is why chaotic systems proposed here must have chaotic features and must also be easy to implement so that they can be used in real applications. In this article, a new continuous time chaotic system with 4 dimensions, 5 parameters, 2 cubical non-linear terms was introduced. This new chaotic system has very good dynamic features as well as simple mathematical equations, wide parameter scales and initial values that can be 0, which is why it is very easy to be implemented. In this way, after the analyses of the chaotic system were made, in the rest of the article, both an analogue chaotic signal generator and a MATLAB GUI aided, micro controller based new random number generator that passed all NIST [9] tests were designed and then real implementations of the new chaotic system were performed. 2. A New 4d Chaotic System In this part, a new chaotic system with 4 dimensions, 5 parameters, 2 cubical non-linear terms was presented as in Equation-1. The most important feature of this system is that all initial values can be close to 0 and it is advantageous in terms of real circuit implementation. When one of the initial values is very close to 0, around ±ε and others are equal to zero, the system can enter chaos. In addition to this, if all initial values are taken as 0, and a stable value very close to 0 (±ε) is added to the first equation in Equation-1, the system works autonomously and it shows chaotic behaviors. Another feature of the system is that there are wide parameter intervals for chaotic behaviors in it. In this way, an autonomous real circuit implementation can easily be carried out by using standard circuit components. Without being influenced by tolerances or deviations of circuit components and power sources, the system enters chaos and can show chaotic behaviors.

x  a( y  x)  w y  b( x  y)  xw2   z  c( z  w)  wx 2 w  d ( x  y )  ez

 

 

 

 

(1)

Yet another significant feature of the system is that when system parameters are picked appropriately, state variables have values within certain limits. This feature makes it possible to use the system in real implementations without any scaling procedure. In the chaotic system seen on Equation-1, for instance, when system parameters are a=25, b=5, c=10, d=20, e=15 and initial values are (x0, y0, z0, w0) = (0.1, 0, 0, 0), 2 and 3 dimensional phase portraits belonging to the state variables of the system are as given on Figure 1 and 2. As it is particularly seen on 2 dimensional phase portraits, state variables (x,y,z,w) have values ranging from +8 to -8. In this way, real circuit implementation of the chaotic system in Equation-1 can easily be performed without any scaling procedure. Jacobian matrix of the system was found as seen on Equation-2. When system parameters are a=25, b=5, c=10, d=20, e=15 and initial values are (x0, y0, z0, w0) = (0.1, 0, 0, 0), equilibrium points and Eigen values belonging to the chaotic system are calculated as given on Table 1.  a b  w 2 J   2w   d

0 1   x  0 0  c  c  x2   d e 0  a b

(2)

An examination of values on Table 1 reveals that the system has five real equilibrium points. Among these equilibrium points, complex values in Eigen values obtained from Jacobian matrix for E1 and E2 were calculated. Furthermore, there is a positive real value in Eigen values calculated for all equilibrium points. This situation shows that chaotic system in Equation-1 is unstable for given parameter values in all equilibrium points. Based on this, it can be said that the chaotic system will show chaotic behavior for the given parameter values. A noteworthy feature of chaotic systems is that state variables are sensitive to changes in initial values. The chaotic system in Equation-1 shows right this feature. After system parameters are set as a=25, b=5, c=10, d=20, e=15 and initial values are first taken as (x0, y0,

z0, w0) = (1, 0, 0, 0) and then (x0, y0, z0, w0) = (1.000001, 0, 0, 0), graphical demonstration of values of x state variable is as seen on Figure 3. According to this, when one in a million change occurred in only one of the initial values, time series taken from the output - x of the system started changing after around 2.5 milliseconds. This situation proves how sensitive the system in Equation-1 is to initial values. For which parameter values astem will show chaotic behavior can be determined with Lyapunov Exponents and Bifurcation diagrams. Figure 4 exhibits Lyapunov Exponents graphics and Bifurcation diagrams obtained according to a and b parameters of the new system. In Figure 4-a and 4-c, a parameter is changeable and other parameters are b=5, c=10, d=20, e=15. In Figure 4-b and 4-d, b parameter is changeable and other parameters are a=25, c=10, d=20, e=15. In all graphs in Figure 4, initial values are assumed as (x0, y0, z0, w0) = (0.000001, 0, 0, 0). After a careful examination, one can see that only an initial value very close to 0, like x0=106 , was given to the chaotic system in Equation-1, and other initial values were assumed as 0. As it is understood from Lyapunov spectrums and Bifurcation diagrams on Figure 4 obtained with these diagrams, the system shows chaotic behavior for a very wide value range of a and b parameters. As it is clear from the graphs in Figure 4-a and 4-c, the system enters and exits chaos a few times when a parameter is in the range of approximately 10
exponents were calculated as L1=6.863, L2=0.0044, L3=-10.91, L4=-18.79. Lyapunov dimension of the systems, according to these values, were found as seen in Equation-3. The value found here is considerably good in terms of the chaotic behavior of a system. Finally, it was examined whether the system was dissipative or not according to Equation-1and Equation-4 was found. j

DL  j 

L i 1

i

L

i  j 1

V 

 2

n

L1  L2 6.863  0.0044  2  2.2312 L3  L4 10.91  18.79

(3)

i

x y z w     a  b  c  0  (a  b  c) x y z w

(4)

Based on the information above, as long as a-b+c>0 , the system is dissipative and it meets Equation-5. Thus, time-dependent function for V value can be written as in Equation-6. According to Equation-6, the volume of the system will shrink from V0 value to 0. This means the chaotic system in Equation-1 is able to model a physical system. dV  e ( abc ) dt

(5)

V (t )  V0 e  ( a bc )t

(6)

3. Analog Circuit Implementation Of The New Chaotic System In this part, the system in Equation-1 was designed as an analogue circuit as seen on Figure 5 and set in Pspice environment. As seen on Figure 5, 4 integrators, 4 multipliers and 3 inverters were used in the circuit in order to implement 4 differential equations that make up the chaotic system. For the circuit design, Equation 7, 8, 9 and 10 which give circuit counterparts of state variables were utilized. t t t       1 1 1      x(t )   y ( t ) dt x ( t ) dt w(t )dt          R2 C1 0   R3C1 0   R1C1 0  t t t       1 1 1 y(t )   x(t ).w(t ).w(t )dt   x(t )dt     y(t )dt        R5 C 2 0   R4 C 2 0   R6 C 2 0  t t t       1 1 1  w(t ).x(t ).x(t )dt  z (t )   z (t )dt    w(t )dt       R C R C R C  7 30   9 30   8 30  t t t       1 1 1  x(t )dt    w(t )   y(t )dt        z(t )dt  R C R C R  10 4 0   11 4 0   12 C 4 0

(7) (8) (9) (10)

In order for Equation 7, 8, 9 and 10 to provide the chaotic system in Equation 1, if derivatives of both sides of equations are taken and adjustments are done accordingly, state variables are found as in Equation 11. After a comparison of Equation 1 and 11, resistance and condenser

counterparts of system parameters are found as in Equation 12. When resistance and condenser values in Equation-12 were adjusted and the system parameters were set as a=25, b=12, c=10, d=20, e=15, 2 dimensional phase portraits from Pspice simulation were found as given on Figure 6.    1 1 1 2  y (t )  x(t )  y(t )  x(t ).w(t )  R5 C 2 R4 C 2 R6 C 2   1 1 1 2 z(t )   z (t )  w(t )  w(t ) x(t )  R7 C3 R9 C3 R8 C3  1 1 1  w (t )  x(t )  y(t )  z (t )  R10 C 4 R11C 4 R12 C 4 x (t ) 

a

1 1 1 y(t )  x(t )  w(t ) R2 C1 R3C1 R1C1

1 1 1 1 1 1 1 1 1  ,b   ,c   ,d   ,e  R2 C1 R3 C1 R5 C 2 R4 C 2 R7 C3 R9 C3 R10 C 4 R11C 4 R12 C 4

(11)

(12)

Looking at the phase portraits on Figure 6, one can see that they are almost the same as those on Figure 1. The very little differences here are caused by the different values of system parameters determined by resistance and condensers used in the circuit and also caused by simulation calculations in Pspice program. In addition, no initial value was defined for the simulation in Pspice and the circuit was autonomously simulated. So it is clearly understood that the chaotic system can easily be implemented with the help of standard circuit components and correct results can be found. Simulation of the chaotic system was made in Pspice environment. Then its physical circuit was established with standard circuit components like AD633 analog multiplier, TL081 OPAMP, 0.25 W standard valued resistances and 1 nF condensers and it was worked as seen on Figure 7. For the real circuit implementation, the system worked autonomously without defining initial values and it showed chaotic behavior. Oscilloscope images seen on Figure 8 are two dimensional phase portraits of the chaotic system with system parameters as a=25, b=12, c=10, d=20, e=15 values. Results on Figure 8 are exactly the same as those mathematical results on Figure 1 and simulation results on Figure 6. In this way, the chaotic system presented in Equation-1 was implemented with both Pspice simulation and real circuit implementations and the results were verified. 4. Matlab Gui Aided Microcontroller Based Rng In this part, randomness features of the new chaotic system were utilized and a

microcontroller based, programmable random number generator implementation was done. C8051F120 microcontroller, which is seen on Figure 9 and whose features are given on Table 2, was used. The implementation was performed with C8051FX20-TB Development Kit, seen on Figure 10, by SILICON LABORATORIES (SILABS) which includes this microcontroller. For this implementation, a user interface was developed with MATLAB GUI so that system parameters, initial values and random number types can be entered to computer by the user. After the system parameters and initial values in GUI on Figure 11 are entered and type (bit stream, 8 bit integers, 16 bit integers) of random numbers to be generated is chosen, “SendValues” button is pressed and these data are sent to microcontroller. All communication between the computer and the microcontroller occurs via serial port with RS232 protocol. As the next step, “Start” button is pressed and microcontroller starts generating random numbers according to the data received from the user. Microcontroller send values of state variables and random number that it has generated to the computer and these values are exhibited on the table in GUI. If the user chooses “Sendrandomnumberstoports” option, microcontroller sends the numbers it has generated to its own ports instead of the computer. When the user presses the “Stop” button, microcontroller stops generating numbers and starts to wait for new operation information. The user can choose time series of the desired state variables and 2 and 3 dimensional phase portraits from “Plots” panel and have them drawn with “Plot” button. The user can also save all data by using “SaveValues” button. Working principle of the MATLAB GUI aided microcontroller based random number generator described above is exhibited on Figure 12. Figure 13 shows how the development kit works with GUI by being connected to computer. Figure 14 shows the flow diagram of the embedded software of the RNG which works on microcontroller. As it is demonstrated by the flow diagram, once necessary data are taken from the user interface and start command is given, differential equations of the chaotic system in Equation 1 are decrypted with Runge-Kutta-4 algorithm for random number generation and state variables are obtained. Following this, state variables are converted to 32bit binary numbers. Then their LSBs are taken and random numbers are generated and sent to the computer or the card ports depending on the user’s demand. For the evaluation of the designed RNG, bit stream was produced for the parameter and initial values on Figure 11 and it passes 1.000.000-bit NIST randomness tests, which are internationally approved. NIST tests

results are given on Table 3. 5. Conclusions This article includes the presentation and analysis of a new high dimensional (4D) and easyto-implement chaotic system. Its operability was tested with real implementations. Analyses which exhibit the dynamic behaviors of the new presented chaotic system show that the system has very good dynamic and chaotic features. Moreover, its simple equations, due to its wide parameter scale and initial values that can be 0, the new chaotic system easily provided an analog circuit design and implementation. Without entering an initial value externally, analog circuit formed with standard circuit components worked autonomously with success, which proved that the new chaotic system can easily be implemented. In addition, in the MATLAB GUI aided RNG implementation done with microcontroller, the new presented chaotic system was simply solved with Runge Kutta 4 algorithm and state variables were found and random numbers were generated. All the generated random numbers passes all NIST tests, which proved that the proposed new chaotic system can easily be implemented and it also has very good chaotic and randomness features. Thanks to this, this proposed system will practically be used in popular areas like encryption, information security and safe communication.  

[1]

References

[2]

S. Çiçek, A. Ferikoğlu, İ. Pehlivan,;1; A new 3D chaotic system: Dynamical analysis, electronic circuit design, active control synchronization and chaotic masking communication application, Optik, 127(8) (2016) 4024-4030.

[3]

A. Akgul, I. Moroz, I. Pehlivan, S. Vaidyanathan,;1; A new four-scroll chaotic attractor and its engineering applications, Optik, 127 (13) (2016) 5491-5499.

[4]

M. Alçın, İ. Pehlivan, İ. Koyuncu,;1; Hardware design and implementation of a novel ANN-based chaotic generator in FPGA, Optik, 127 (13) (2016) 5500-5505.

[5]

U. Cavusoglu, A. Akgul, S. Kacar, I. Pehlivan, A. Zengin,;1; A novel chaos-based encryption algorithm over TCP data packet for secure communication, Security Comm. Networks, (2016), https://dx.doi.org/10.1002/sec.1414.

[6]

C. Li, I. Pehlivan, J.C. Sprott, A. Akgul,;1; A novel four-wing strange attractor born in bistability, IEICE Electron. Express, 12(4) (2015) 1-12.

[7]

İ. Pehlivan, Y. Uyaroglu,;1; A new 3D chaotic system with golden proportion equilibria: Analysis and electronic circuit realization, Comp. & Elec. Eng., 38 (2012) 1777-1784.

[8]

Z. Wei, I. Pehlivan,;1; Chaos, coexisting attractors, and circuit design of the generalized Sprott C system with only two stable equilibria, OAM-RC, 6(7-8) (2012) 742-745.

[9]

I. Pehlivan, Z. Wei,;1; Analysis, nonlinear control, and chaos generator circuit of another strange chaotic system, Turk. J. Elec. Eng. & Comp. Sci., 20(2) (2012) 12291239.

[10] ;1; NIST, A statistical test suite for random and pseudorandom number generatorsfor cryptographic

applications,

2010

csrc.nist.gov/publications/nistpubs/800-22-

rev1a/SP800-22rev1a.pdf. [11] ;1; https://www.silabs.com/Support%20Documents/TechnicalDocs/C8051F12x-13x.pdf

(last accessed on 16.05.2016) [12] ;1; http://www.silabs.com/support%20documents/technicaldocs/c8051f02x-dk.pdf (last accessed on 16.05.2016)  

Figure Captions Fig. 1. Two dimensional phase portraits: a) x-y, b) x-z, c) x-w, d) y-z, e) y-w, f) z-w

Fig. 2. Three dimensional phase portraits: a) x-y-z, b) x-y-w, c) y-z-w, d) x-z-w Fig. 3. Sensitivity of the time series of the state variable – x for different initial conditions (x1(0)=1, x2(0)=1.000001) Fig. 4. Lyapunov Exponents and bifurcation diagrams for a and b parameters: a) lyapunov exponents for a, b) lyapunov exponents for b, c) bifurcation diagram for a, d) bifurcation diagram for b Fig. 5. Analog circuit of the chaotic system in Equation-1 (in Pspice) Fig. 6. Two dimensional phase portraits obtained in Pspice: a) x-y, b) x-z, c) x-w, d) y-z, e) y-w, f) z-w Fig. 7. Analog circuit realization of the new chaotic system Fig. 8. The phase portraits obtained from real circuit implementation: a) x-y, b) x-z, c) x-w, d) y-z, e) y-w, f) z-w Fig. 9. C8051F120 microcontroller

Fig. 10. C8051FX20-TB development kit: a) real image, b) port locations [11] Fig. 11. User interface designed by MATLAB GUI Fig. 12. Working principle of the microcontroller based RNG Fig. 13. Working of the realized RNG system

 

Fig. 14. Flow chart of the microcontroller based RNG  

Tables  Table I. Equilibria and Eigen values Equilibria

x

y

z

w

E1

0

0

0

0

E2

3.1932

3.2455

3.3732

0.1703

E3

-3.1932

-3.2455

-3.3732

-0.1703

E4

3.1316

-3.2455

-3.1202

0.1670

E5

-3.1316

3.2455

3.1202

-0.1670

 

Eigen values (λ1,2,3,4) -28.1397 8.7482 -5.3042 +11.5031i -5.3042 -11.5031i -29.5198 -5.1347 + 7.5398i -5.1347 - 7.5398i 9.7891 -25.9910 7.0018 -0.4289 -10.5819 -29.6124 -9.8097 -0.7918 10.2139 -26.0730 7.1146 -1.2682 -9.7734

Table II. Features of C8051F120 [10] Mixed-signal System-on-a-Chip MCUs with 64 digital I/O pins High-Speed pipelined 8051-compatible CIP-51 microcontroller core (100 MIPS) In-system, full-speed, non-intrusive debug interface (on-chip) True 12 or 10-bit 100 ksps ADC with PGA and 8-channel analog multiplexer True 8-bit 500 ksps ADC with PGA and 8-channel analog multiplexer Two 12-bit DACs with programmable update scheduling 2-cycle 16 by 16 Multiply and Accumulate Engine 128 or 64 kB of in-system programmable Flash memory 8448 (8 k + 256) bytes of on-chip RAM External Data Memory Interface with 64 kB address space SPI, SMBus/I2C, and (2) UART serial interfaces implemented in hardware Five general purpose 16-bit Timers Programmable Counter/Timer Array with 6 capture/compare modules On-chip Watchdog Timer, VDD Monitor, and Temperature Sensor

 

Table III. NIST Randomness Tests Results Test Frequency test Block frequency test Run test Longest runs of ones test Binary matrix rank test FFT test Non overlapping template matching Overlapping template of all ones test

 

P Value 0.675 0.495 0.049 0.874 0.996 0.978 0.456 0.996

Test Universal statistical test Linear complexity Serial test (P value - 2) Approximate entropy test Cumulative sums test Random execursions test (x=-4) Random execursions variant test (x=9)

P Value 0.448 0.238 0.903 0.336 0.647 0.449 0.996