**2. Preliminaries**

#### *2.1. The 6D Hyper-Chaotic System*

There are a lot of classical chaotic systems, e.g. Sine map, Logistic map, Tent map, etc., which have simple mathematical forms and can be implemented easily. However, they suffer from small key spaces, predictable orbits, limited ranges, etc. Existing research has shown that higher dimensional chaotic systems are much securer for image encryption [36]. Therefore, a novel 6D hyper-chaotic system is employed in this paper for chaotic sequences generation, which could be described as Equation (1) [37].

$$\begin{aligned} \dot{\mathbf{x}}\_1 &= g(\omega + \beta \mathbf{x}\_6^2) \mathbf{x}\_2 - a \mathbf{x}\_1 \\ \dot{\mathbf{x}}\_2 &= c \mathbf{x}\_1 + d \mathbf{x}\_2 - \mathbf{x}\_1 \mathbf{x}\_3 + \mathbf{x}\_5 \\ \dot{\mathbf{x}}\_3 &= -b \mathbf{x}\_3 + \mathbf{x}\_1^2 \\ \dot{\mathbf{x}}\_4 &= c \mathbf{x}\_2 + f \mathbf{x}\_4 \\ \dot{\mathbf{x}}\_5 &= -r \mathbf{x}\_1 \\ \dot{\mathbf{x}}\_6 &= \mathbf{x}\_2 \end{aligned} \tag{1}$$

where *a*, *b*, *c*, *d*,*e*, *f* , *g*,*r*, *ω*, and *β* are controlling parameters, and *xi*(*<sup>i</sup>* = 1, 2, ··· , 6) are state variables.

The fourth-order Runge–Kutta method is used to solve this hyper-chaotic system with step size *h* = 0.001. We set the controlling parameters as (*a*, *b*, *c*, *d*,*e*, *f* , *g*,*r*, *ω*, *β*) = (0.3, 1.5, 8.5, −2, 1, −0.1, 0.9, 1, 1, 0.2) and initial state variables as (*<sup>x</sup>*1, *x*2, *x*3, *x*4, *x*5, *<sup>x</sup>*6) = (0.1, 0.6, 0.2, 0.02, 1, 0.5); Figure 1 shows this 6D hyper-chaotic system's attractors. Its Lyapunov exponents are *λ*1 = 7.340, *λ*2 = 0.087, *λ*3 = 0.006, *λ*4 = −0.368, *λ*5 = −1.349, *λ*6 = −67.426. Since this chaotic system has three positive Lyapunov exponents, its prediction time should be longer than other chaotic systems and it is hard to crack. Besides, this hyper-chaotic system exhibits limit cycles, quasiperiodic, and bursting behavior. Accordingly, it could generate effective a pseudo random sequence. More detailed demonstration could be found in reference [37].

**Figure 1.** The attractors of six-dimensional (6D) hyper-chaotic system.

#### *2.2. 3D Transformed Zigzag Diffusion*

Zigzag is a scanning method that is used to scramble pixels in image encryption. By scanning and taking a pixel with left upper corner of image, then taking other pixels one-by-one through Zigzag path, the image could be converted to a matrix in a fixed way. Hence, the image's pixels could be scrambled.

Traditional Zigzag scrambling could only walk through numbers in *N* × *N* matrix with a fixed Zigzag path; an example of 4 × 4 matrix is shown in Figure 2. By this fixed path, different channels of color image could not be scrambled with each other. Due to its drawbacks, this paper proposes a novel 3D Zigzag transformation. Using this transformation, each channel of color image would be cut into two triangles through a diagonal line, and be placed on opposite surfaces of a cube, which is illustrated by an example of 4 × 4 × 3 matrix, as shown in Figure 3. Subsequently, diffusion would start from origin vertex of the frontal side of the cube, and walk through every pixels on six surfaces at the front and back side synchronously with spiral Zigzag path, as in Figure 4. For all triangles that are placed on the cube, the order of diffusion is shown in Figure 5. In this way, different channels of color image could be diffused together.

**Figure 2.** 4 × 4 traditional Zigzag scramble.

#### *2.3. RNA Operation*

Ϯϯ

RNA is one of the major macromolecules necessary for living organism. RNA has a single strand structure with four nitrogen bases: adnine (A), cytosine (C), guanine (G), and uracil (U). For these four units of RNA, a binary system could be employed for representation, which is shown in Table 1. According to the base pairing rules, four bases of RNA could be coded and constructed into three nucleotides that correspond to one amino acid called codon. Accordingly, there are 64 codons truth table of bases combinations, as shown in Table 2. Assuming that pixels in the image could transfer into six-bits format, a corresponding RNA codon could be found in Table 2.

**Table 1.** Binary representation of RNA.



5 \* %

**Figure 3.** Color image to cube.The first row is three channels of a color image. The second row is the triangles generated from image. Additionally, the third row is the placement of triangles on a cube.

**Table 2.** RNA codon table.

**Figure 4.** Three-dimensional (3D) transformed Zigzag diffusion. (**a**) is the Zigzag diffusion process on the front side of cube. (**b**) is the Zigzag diffusion process on the back side of cube.

#### **3. Encryption and Decryption**

In this paper, image encryption could be divided into three parts. Firstly, a 6D hyper-chaotic system is employed to generate chaotic matrices for encryption processes. Subsequently, three-dimensional (3D) transformed Zigzag diffusion is implemented on the permuted image. Finally, RNA concept is used for encoding and decoding.

#### *3.1. Encryption Scheme*

Suppose that plaintext image has *N* rows and *N* columns with RGB channels.

The flowchart of HCZRNA is described in Figure 6, and the specific operations are listed, as follows.

**Figure 6.** The process of encryption.

3.1.1. Initial Values Generation

The HCZRNA scheme uses a 256-bit key of different characters against attacks. The 256-bit long security key would be utilized in two parts, which are hyper-chaotic system initial values generation and RNA encryption.

At first, the initial values of hyper-chaotic system should be generated by a security key. Details of initial values generation is performed in three steps:

•Step 1: divide the secret key *K* into 32 blocks, which could be expressed as *K* = {*k*1, *k*2,..., *k*32}, each *k* is a 8-bits number.

• Step 2: *K* array that is generated in step 1 is calculated into four intermediate parameters *d*1, *d*2, *d*3, *d*4 by Equation (2) with four user-defined constants *c*1, *c*2, *c*3 and *c*4.

$$\begin{cases} d\_1 = c\_1 + \frac{k\_1 \oplus k\_2 \oplus \cdots \oplus k\_8}{256} \\ d\_2 = c\_2 + \frac{k\_9 \oplus k\_{10} \oplus \cdots \oplus k\_{16}}{256} \\ d\_3 = c\_3 + \frac{k\_{17} \oplus k\_{18} \oplus \cdots \oplus k\_{24}}{256} \\ d\_4 = c\_4 + \frac{k\_{25} \oplus k\_{26} \oplus \cdots \oplus k\_{32}}{256} \end{cases} \tag{2}$$

where ⊕ represents bitwise XOR operation.

• Step 3: The initial values *x*1 to *x*6 of 6D hyper-chaotic system could be obtained from the 4 intermediate parameters by Equation (3).

$$\begin{cases} \mathbf{x}\_1 = \frac{((d\_1+d\_2)\times 10^8)\bmod 256}{255} \\ \mathbf{x}\_2 = \frac{((d\_2+d\_3)\times 10^8)\bmod 256}{255} \\ \mathbf{x}\_3 = \frac{((d\_3+d\_4)\times 10^8)\bmod 256}{255} \\ \mathbf{x}\_4 = \frac{((d\_1+d\_3)\times 10^8)\bmod 256}{255} \\ \mathbf{x}\_5 = \frac{((d\_1+d\_4)\times 10^8)\bmod 256}{255} \\ \mathbf{x}\_6 = \frac{((d\_2+d\_4)\times 10^8)\bmod 256}{255} \end{cases} \tag{3}$$

where *mod* means module operation.

#### 3.1.2. Hyper-Chaotic Matrices Generation

With the initial values that are calculated in Section 3.1.1, chaotic matrices could be generated from 6D hyper-chaotic system. In HCZRNA, chaotic matrices would be utilized in three parts, which are permutation, 3D transformed Zigzag diffusion, and RNA operation. Suppose that the plaintext image has *N* × *N* × 3 pixels, an *N* × *N* × 6 chaotic matrix is needed for permutation, a 2 × *N* × *N* × 6 chaotic matrix for Zigzag, and 64 × 6 chaotic matrix for RNA.

Therefore, the 6D hyper-chaotic system utilizes initial values from Equation (3) to iterate for generating a (3 × *N* × *N* + 64) × 6 matrix. Given that *ith* iteration's state values could be described as *si* = {*<sup>x</sup>*1,*i*, *<sup>x</sup>*2,*i*, *<sup>x</sup>*3,*i*, *<sup>x</sup>*4,*i*, *<sup>x</sup>*5,*i*, *<sup>x</sup>*6,*i*} , a hyper-chaotic matrix *S* could be depicted as Equation (4) after all iterations.

$$S = \{\mathbf{s}^1, \mathbf{s}^2, \dots, \mathbf{s}^M\} = \begin{cases} \mathbf{x}\_{1,1', 1', 2', \dots, \mathbf{x}\_1, \mathbf{x}\_1} \\ \mathbf{x}\_{2,1', 2', 2', \dots, \mathbf{x}\_2, \mathbf{x}\_2} \\ \mathbf{x}\_{3,1', 3', 2', \dots, \mathbf{x}\_3, \mathbf{x}\_M} \\ \mathbf{x}\_{4,1', 4', 2', \dots, \mathbf{x}\_1, \mathbf{x}\_4, \mathbf{M}} \\ \mathbf{x}\_{5,1', 3', 5', 2', \dots, \mathbf{x}\_5, \mathbf{x}\_6} \\ \mathbf{x}\_{6,1', 4', 5', 2', \dots, \mathbf{x}\_6, \mathbf{M}} \end{cases} \tag{4}$$

where *M* = 3 × *N* × *N* + 64.

However, the numbers in matrix *S* are double-precision values, which are suitable for permutation but not for Zigzag and RNA, and color image only has three channels that are smaller than channels of *S*. Hence, matrix *S* should be separated into three pieces respectively.

For permutation, a matrix *S*1 is calculated from the first *N* × *N* part of *S* by Equation (5).

$$S\_1 = \begin{Bmatrix} \mathbf{x}\_{1,1} + \mathbf{x}\_{2,1}, \mathbf{x}\_{1,2} + \mathbf{x}\_{2,2}, \dots, \mathbf{x}\_{1,M'} + \mathbf{x}\_{2,M'}\\ \mathbf{x}\_{3,1} + \mathbf{x}\_{4,1}, \mathbf{x}\_{3,2} + \mathbf{x}\_{4,2'}, \dots, \mathbf{x}\_{3,M'} + \mathbf{x}\_{4,M'}\\ \mathbf{x}\_{5,1} + \mathbf{x}\_{6,1'}, \mathbf{x}\_{5,2} + \mathbf{x}\_{6,2'}, \dots, \mathbf{x}\_{5,M'} + \mathbf{x}\_{6,M'} \end{Bmatrix}\_{3 \times M'} \tag{5}$$

where *M* = *N* × *N*.

While matrix *S*2 is cut from *sM*+<sup>1</sup> to *s*3*M* in *S* for 3D transformed Zigzag diffusion. Additionally, because 8-bit integer digits are needed for diffusion, each item *xi*,*j* in *S*2 should be calculated by Equation (6).

$$\begin{aligned} \text{Suppose} \qquad \vec{s}\_{i} &= \{ \mathbf{x}\_{i,(M'+1)}, \mathbf{x}\_{i,(M'+2)}, \dots, \mathbf{x}\_{i,3M'} \} \\ y\_{i,j} &= 2 \times \mathbf{x}\_{i,j} + \frac{\max(\vec{s}\_{i}^{\*}) + \min(\vec{s}\_{i}^{\*})}{\max(\vec{s}\_{i}^{\*}) - \min(\vec{s}\_{i}^{\*})} \\ \mathbf{x}\_{i,j}^{\prime} &= ( (\lfloor y\_{i,j} \rfloor - \lfloor \lfloor y\_{i,j} \rfloor \rfloor) \times 10^{10} ) \bmod 256 \end{aligned} \tag{6}$$

where *max* and *min* are maximum and minimum operations.

Matrix *S*3 is the last part of matrix *S* and it is used to sort operation for encrypting RNA codons tables as indexes. Because there only needs two indexes sequences, matrix *S*3 should be summarized as Equation (7).

*index*1 = {*<sup>x</sup>*1,3*M*+<sup>1</sup> + *<sup>x</sup>*2,3*M*+<sup>1</sup> + *<sup>x</sup>*3,3*M*+1, *<sup>x</sup>*1,3*M*+<sup>2</sup> + *<sup>x</sup>*2,3*M*+<sup>2</sup> + *<sup>x</sup>*3,3*M*+2,..., *<sup>x</sup>*1,3*M*+<sup>64</sup> + *<sup>x</sup>*2,3*M*+<sup>64</sup> + *<sup>x</sup>*3,3*M*+<sup>64</sup>} *index*2 = {*<sup>x</sup>*4,3*M*+<sup>1</sup> + *<sup>x</sup>*5,3*M*+<sup>1</sup> + *<sup>x</sup>*6,3*M*+1, *<sup>x</sup>*4,3*M*+<sup>2</sup> + *<sup>x</sup>*5,3*M*+<sup>2</sup> + *<sup>x</sup>*6,3*M*+2,..., *<sup>x</sup>*4,3*M*+<sup>64</sup> + *<sup>x</sup>*5,3*M*+<sup>64</sup> + *<sup>x</sup>*6,3*M*+<sup>64</sup>} (7)
