**4.1 Random number generator**

Sensitivity to initial conditions is one of the most important property of chaotic systems. Therefore, chaotic systems are very suitable for the cryptography purpose. But before that, it should be noticed that the probability density distributions (PDD) of chaotic systems are not uniform distribution. **Figure 11(a)** and **11(b)** are the waveform and PDD of *x*<sup>4</sup> of Eq. (4). It shows that PDD of the output sequences has physical characteristic. The cryptosystem with these sequences cannot resist side channel attack.

To remove physical characteristic, one can use the following de-correlation operation:

$$\mathbf{S}\_{out} = \mathbf{S}\_{in} \ast \mathbf{10}^6 - floor \left( \mathbf{S}\_{in} \ast \mathbf{10}^6 \right) \tag{9}$$

In fact, Eq. (9) can be applied in all chaotic/torus-chaotic/hyperchaotic systems. The output sequences can pass fifteen random tests of NIST 800-22, as shown as in **Table 1**, which indicated the proposed method can provide high security Level. This proposed method can be used as a part of some cyber security systems such as the verification code, secure QR code and some secure communication protocols.

#### **Figure 11.**

*Waveform and PDD before and after de-correlation operation of x*<sup>4</sup> *of Eq. (4): (a) is the waveform of x*<sup>4</sup> *before de-correlation operation; (b) is the PDD of x*<sup>4</sup> *before de-correlation operation; (c) is the waveform of x*<sup>4</sup> *after de-correlation operation; (b) is the PDD of x*<sup>4</sup> *after de-correlation operation.*

*Chaotic Systems with Hyperbolic Sine Nonlinearity DOI: http://dx.doi.org/10.5772/intechopen.94518*


### **Table 1.**

*Pseudo-random properties of x*<sup>3</sup> *of Eq. (8) after de-correlation operation.*

### **4.2 Image encryption**

Image encryption is another widely used engineering application of chaotic system. In this section, we will use Eq. (7) for image encryption purpose.

A flowchart of the encryption scheme is shown in **Figure 12**.

The detailed encryption process includes the following steps.

Input: Plain image; Initial conditions for the chaotic system; Control parameters of the chaotic system.

Output: Ciphered image.

Step 1: Calculate the average pixel value of the plain image and generate the pseudorandom sequence.

Step 2: Transform the pseudorandom sequence and change pixel value of the image via XOR.

Step 3: Sort the pseudorandom sequence for permutation.

Step 4: Shift the pixel positions by column using the sorted elements.

Step 5: Shift the pixel positions by row using the sorted elements.

To provide a better understanding of this scheme, the pseudocode is provided in **Table 2**.

**Figure 12.** *A flowchart of the encryption scheme.* Input: Plain image Org\_Img, Initial conditions for the chaotic system, Control parameter for the chaotic system, Output: Ciphered Image En\_Img [m,n] size(Org\_Img); Avg\_pixel\_value mean2(Org\_Img)\*10^(-5) % mean2 is a function that returns the % average value of a matrix x(1) x(1) + Avg\_pixel\_value y(1) y(1) z(1) z(1) u(1) u(1) s(1) u(1)\*10^4 – floor(u(1)\*10^4) For i=1:1:m\*n % Generate pseudorandom sequence that will % be used for diffusion and permutation [dx, dy, dz, du] Runge-Kutta (x(i), y(i), z(i), u(i)) x(i+1) x(i) +dx y(i+1) y(i) +dy z(i+1) z(i) +dz u(i+1) u(i) +du s(i+1) u(i+1)\*10^4 – floor(u(i+1)\*10^4) End Count=1 % Count flag For i=1:m % Diffusion Operation For j=i:n diff(Count) mod (s(Count)\*10^14, 256) % transform s, which could be used for XOR En\_Dif(i,j)=bitxor(Org\_Img(i,j), diff (Count)); % Bitwise exclusive OR Count= Count+1; End End S\_index Sort(s) For i=1:n % Column-wise permutation For j=1:m En\_per\_col (i,j) Sort (En\_Dif, S\_index) End End For i=1:m % Row-wise permutation For j=1:n En\_Img (i,j) Sort (En\_per\_col, S\_index) End End
