Hyper-Chaotic Color Image Encryption Based on Transformed Zigzag Diffusion and RNA Operation

With increasing utilization of digital multimedia and the Internet, protection on this digital information from cracks has become a hot topic in the communication field. As a path for protecting digital visual information, image encryption plays a crucial role in modern society. In this paper, a novel six-dimensional (6D) hyper-chaotic encryption scheme with three-dimensional (3D) transformed Zigzag diffusion and RNA operation (HCZRNA) is proposed for color images. For this HCZRNA scheme, four phases are included. First, three pseudo-random matrices are generated from the 6D hyper-chaotic system. Second, plaintext color image would be permuted by using the first pseudo-random matrix to convert to an initial cipher image. Third, the initial cipher image is placed on cube for 3D transformed Zigzag diffusion using the second pseudo-random matrix. Finally, the diffused image is converted to RNA codons array and updated through RNA codons tables, which are generated by codons and the third pseudo-random matrix. After four phases, a cipher image is obtained, and the experimental results show that HCZRNA has high resistance against well-known attacks and it is superior to other schemes.


Introduction
Nowadays, rapid developments of Internet and digital technologies have led to tremendous digital multimedia contents transmitting over Internet networks. Thus, protection on the contents of digital data has attracted serious concern from medical, military, and many other areas. Various image encryption methods have emerged by using cryptographic techniques [1][2][3][4]. Although there exists a view that AES is not suitable for image encryption, Zhang recently refuted it by using AES of cipher block chaining mode to encrypt images [5].
The chaos-based encryption method has become one of the most ideal methods, since it has a lot of appropriate characteristics, e.g. high sensitivity on initial conditions, mixing property, ergodicity, complex behavior, etc. [6][7][8]. As a result, a lot of researchers have presented plenty of image encryption schemes with a chaotic system [9][10][11][12][13]. In [14], Askar et al. proposed a chaotic economic map based image encryption method, whose simulation results indicated that the proposed algorithm could successfully encrypt and decrypt the images, and it had a good performance on security tests, except noise attacks analysis. By using a single round based hyper-chaotic system, Shaikh et al. presented a color image encryption method with bi-directional pixel diffusion [15]. Additionally, Li et al. presented a "transforming-scrambling-diffusion" model based color image encryption method with a four-dimensional (4D) hyper-chaotic system, which could convert pixel values to gray format before scrambling [16]. There is no doubt that some of the encryption methods in these chaos-based schemes still have weaknesses to some extent. However, different chaotic systems are neither superior nor inferior each other. A high-dimensional chaotic system has complex chaotic behaviors with high time cost, while a low-dimensional • Extensive experiments and analyses demonstrate that the proposed HCZRNA could resist various types of attacks.
The rest of this paper is structured as follows: Section 2 introduces the used 6D hyperchaotic system, 3D Zigzag and RNA. Section 3 presents the HCZRNA scheme and explains how initial values and pseudo-random matrix are generated in detail. Section 4 reports and analyzes the experimental results. Finally, Section 5 concludes this paper.

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].

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.

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.

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.

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.

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 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 .
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).
where mod means module operation.

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 i th iteration's state values could be described as (4) after all iterations.
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).
While matrix S 2 is cut from s M +1 to s 3M in S for 3D transformed Zigzag diffusion. Additionally, because 8-bit integer digits are needed for diffusion, each item x i,j in S 2 should be calculated by Equation (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).

Permutation
In this part, matrix S 1 is used to permute plaintext image. At the beginning, each element in S 1 should be allocated to each pixel as index. Hence, an N × N × 3 matrix S 1 is needed to be converted from S 1 by reshaping.
Afterwards, each pixel in plaintext image has a corresponding index in S 1 at the same coordinate. Combine plaintext image with matrix S 1 , and take another reshaping operation to convert these two matrix into two sequences with a length of N × N × 3. After sorting S 1 ascendingly with image sequence synchronously, pixels' orders in plaintext image sequence have been scrambled.
Finally, reshaping the sorted image sequence to an N × N × 3 matrix, the initial cipher image could be generated.

Diffusion
After permutation, a diffusion scheme by 3D Zigzag transformation is proposed, as follows. An initial cipher image would be split and placed on the surfaces of an N × N × 6 cube, termed as P, as described in Section 2.2. Additionally, chaotic matrix S 2 would also be placed on another two N × N × 6 cubes, since diffusion would implement two rounds. For the first N × N × 6 numbers in S 2 , each number would be placed on a cube in order, which could be called cube SC 1 .For the last N × N × 6 numbers in S 2 , cube SC 2 could be generated by the same process.
Subsequently, diffusion would start from origin point of cube P on the front side, and its coordinate is [1,1,1]. At each iteration, the pixel's value C i,j,m is calculated by Equation (9). C i,j,m = (P i,j,m ⊕ (T + x i,j,m;1 )) mod 256 (9) where i, j, m are the coordinates of pixel at the i th row, j th column, and m th side on the cube.
T is the previous one diffused pixel's C value, if i, j, m = 1, 1, 1, T is a user-defined constant.
x i,j,m;1 is the corresponding coordinate's value in SC 1 .
For the second round of diffusion, Equation (9) would change to Equation (10).
where D is result of diffusion, and T is the previous one diffused pixel's D value, and, if i, j, m = 1, 1, 1, T is the last pixel's C value after the first round diffusion. While x i,j,m;2 is corresponding coordinate's value in SC 2 . Through these two round diffusions, D cube is generated. Additionally, recover the D's N × N × 6 matrix by reversing processes of image splitting and cube placement in The encryption from diffused matrix D mat through RNA operation could be described, as follows: • Step 1: RNA operation is initiated from creating two encrypted codons tables, called T 00 and T 01 . In which, T 00 and T 01 are shuffled tables from codons truth, as in Table 2.
The shuffle orders are generated according to indexes sequences calculated from Equation (7). After sorting with these two indexes sequences, the original codons truth table could be shuffled to two different encrypted codons tables T 00 and T 01 . Subsequently, by the complementary rules of RNA, additional tables T 10 and T 11 could be generated from T 00 and T 01 . Hence, four encrypted codons tables are generated. • Step 2: for each element in D mat , binary number conversion is processed, which is recorded as B.
Each b i,j,m could be expressed as eight binary numbers, which could be depicted as Step 3: divide b i,j,m into four pieces, each two bits are one piece, which are recorded as: Additionally, combine three channels' bts at the same coordinate together: Therefore, each bt i,j has six bits that could transfer to RNA codons according to Table 1.
Exchange each two bits in bts to RNA base one-by-one according to the principle of row priority, bts could be coded to codons. And put them into a one-dimension sequence BS as Equation (14).
Walk through sequence BS, and find corresponding index id of each codon in BS from where n is the walking times. Take the codon T z (id) to replace the origin codon BS(n). When iterations termination, an encrypted sequence is generated. • Step 5: decode each base in encrypted sequence BS to binary format by Table 1, put all of the binary digits back to original coordinates by reversing operations in Step 3. Additionally, change binary matrix into 2-bit matrix. The cipher image is generated.
The HCZRNA encryption has four stages: hyper-chaotic matrices generation (Sections 3.1.1 and 3.1.2), hyper-chaotic permutation (Section 3.1.3), 3D transformed Zigzag diffusion on surfaces of cubes, which is generated from initial cipher image (Section 3.1.4), and a bit-level RNA operation (Section 3.1.5). The major steps of the HCZRNA are Sections 3.1.4 and 3.1.5, i.e., the transformed Zigzag diffusion on 3D cubes and bit-level RNA substitutions with hyper-chaotic matrix, respectively. The HCZRNA uses the strategy of "divide and conquer" that is widely used in various applications to decompose the original encryption task into a couple of simpler sub-tasks [38,39].

Decryption
In this paper, the encryption scheme has been depicted, and decryption is the inverse process of encryption. Details are proposed, as follows.

•
Step 1: redo the processes that are listed in Sections 3.1.1 and 3.1.2 to generate hyperchaotic matrices S 1 , S 2 , and S 3 . • Step 2: convert the cipher image to a binary format, and reconstruct three channels' pixels at each coordinate into four 6-bit binary arrays by using Euqation (12) and (13). Change 6-bit arrays into codons from codons truth Table 2, and put them in a onedimension sequence BS as Equation (14). • Step 3: generate key binary sequence BK through Equation (15) and encrypted codons tables {T 00 , T 01 , T 10 , T 11 } by redoing Step 1 in Section 3.1.5. • Step 4: Check each 2-bits z in BK and find corresponding table T z from {T 00 , T 01 , T 10 , T 11 }. Walk through BS and find each codon's corresponding index id in Table T z . Replace codon in BS to codon id in codons truth Table 2. After all codons are replaced, convert them into binary formats and 8-bit numbers, matrix D mat is obtained. • Step 5: split matrix D mat and place triangles on cube surfaces as the process shown in Section 2.2. Redo Section 3.1.4 with modified Equation (17) two rounds, and then walk through pixels with reversed Zigzag path. Take Figure 4 in Section 2.2 as an example, the traversal road of decryption is shown in Figure 7. If we put all the pixels together, the order of traversal is depicted in Figure 8.
C i,j,m = (D i,j,m ⊕ (T + x i,j,m;2 ))mod256 P i,j,m = (C i,j,m ⊕ (T + x i,j,m;1 ))mod256 (17) where T is the previous one pixel's D value, and, if i, j, m = 1, 1, 1, T is the last pixel's C value after first round iteration. T is the previous one pixel's C value and, if i, j, m = 1, 1, 1, T is the user-defined constant that is used in Section 3.1.4. • Step 6: after the process in Step 5, return the triangles in the cube to theirs original coordinates on a image. Additionally, the reverse processes in Section 3.1.3, reshape S 1 to construct sorted sequence. Find image pixels' corresponding coordinates through sorted sequence and recover. The decrypted image is generated.

Experimental Results
The encryption and decryption schemes have been tested on four popular RGB color images in Table 3. All of the experiments are conducted by MATLAB R2019b on 64-bit Windows 10 system, and the main hardware includes an Xeon(R) W-2223 @ 3.60 GHz CPU as well as 32 GB RAM. For the controlling parameters setting in Equation (1), (a, b, c, d, e, f , g, r, ω, β) = (0.3, 1.5, 8.5, −2, 1, −0.1, 0.9, 1, 1, 0.2). Constants c 1 , c 2 , c 3 , c 4 in Equation (2) are set as (1, 1, 2, 2) and the initial constant of T in Equation (9) is 11. The security key can be set by users, so we set a 256-bit hexadecimal sequence that is shown below as the security key in all of the experiments. The key can also be optimized by some evolutionary optimizations, such as differential evolution and particle swarm optimization [40][41][42][43].
In order to demonstrate performance of proposed HCZRNA scheme, five state-ofthe-art encryption schemes are employed for comparison: a Four-wing hyper-chaotic system based dynamic DNA encryption scheme [29], an extended Zigzag confusion and RNA encryption based scheme [23], a Hopfield chaotic neural network-based scheme [44], a scheme with utilization of differences between two 1D chaotic maps [45] and a scheme with 4D hyper-chaotic system and DNA encryption [46].

Key Space
For an image encryption system, large enough key space is necessary to withstand a brute-force attack. In HCZRNA, a 256-bit security key is used to calculate the initial values of the hyper-chaotic system to generate the pseudo random matrices that could affect the outputs of permutation, diffusion, and RNA operations. As we know, different initial values in a hyper-chaotic system would get different pseudo random sequences, and each bit has two states, the security key has 2 256 different states, so it could generate 2 256 results of a hyper-chaotic system. Therefore, the key space of HCZRNA could be calculated as 2 256 . Theoretically, if the key space of an encryption scheme is larger than 2 100 , this scheme could resist violent crack by modern computers [47]. Therefore, the proposed HCZRNA in this paper has a large enough key space to resist brute-force attack.

Sensitivity of Keys
The sensitivity test on keys refers to utilize slightly different keys to encrypt the same images. If an encryption is sensitive, the encryption with slight difference on keys would get completely different cipher images. To test the key sensitivity, we would use two different keys to encrypt four test images, one of these two keys is initial security key key 1 , another key is key 2 , which is one bit changed for key 1 . These two keys are stated as follows, where the changed bits are shown in red: By comparing two cipher images from the same plaintext image, the differences of cipher images that are encrypted from these two security keys are stated in Table 4. In the table, it is obvious that all of the differences between two cipher images are over 99%, which reveals that, even with tiny changes in security keys, encryption by HCZRNA would also lead to extremely different outputs. Hence, HCZRNA satisfies sensitivity requirements.

Histogram
Because a histogram reflects each pixel's times in an image, histograms of meaningful images are fluctuated, while cipher images' histogram should be flat and uniform. That is to say, if an encryption scheme is well-designed, the histograms of cipher images should be as flat as possible. For the proposed HCZRNA, a histogram of Baboon and its cipher image are placed in Figure 9. From this figure, it could find that histograms of all channels in plaintext image are fluctuated, while histograms of cipher image's different channels are almost distributed in a narrow range, and their values are around 1000. For more accurate results, histogram statistics are introduced to evaluate the variance and standard deviation of plaintext and cipher images [48,49]. Variance is used to calculate the average difference in each gray level frequency with respect to mean valuex, which could be formulated as Equation (18).
where h, w represent the image's height and width respectively, x is the frequency of different gray levels of pixels in a image, and thex is the mean value of xs. And α is the variance, the higher is α, the more fluctuate is the graphic histogram. Accordingly, if a encryption is well-designed, the α of encrypted image should be low. As α is always very high in plaintext image, a standard deviation is used to evaluate histogram's fluctuations, which is stated as Equation (19).
where β is the standard deviation. For all test images, Table 5 describes the results of histogram statistics. In the table, the variances and standard deviations of plaintext images are very high, while they are extremely different in cipher images. All of these performances indicate that the proposed HCZRNA could effectively resist histogram attack.

Correlation
The correlation test refers to adjacent pixels' relationship. A meaningful image has high correlation because values of adjacent pixels are close to each other. This attribute could be utilized to crack. Therefore, a well-designed encryption scheme should have low enough correlations in three directions: horizontal, vertical, and diagonal directions. Given a pixel sequence that is represented by X = {x 1 , x 2 , . . . , x N } and its adjacent pixel sequence Y = {y 1 , y 2 , . . . , y N } in an image, correlation between X and Y could be denoted as γ X,Y in Equation (20).
where E(X) is X s mathematical expectation and D(X) is standard deviation. If X and Y are identical, γ X,Y would be a maximum of 1. On the contrary, γ X,Y would be close to 0 when X and Y have few correlations. Figure 10 depicts the correlation test results. It is obvious that the adjacent pixels' distributions in plaintext images are concentrated, while the distributions in the cipher images are opposite.
More accurately, Table 6 provides correlation coefficients between plaintext images and cipher images. Additionally Table 7 demonstrates comparisons with references [44,45]. Through this test, it could find that the correlation coefficients of the proposed HCZRNA are extremely close to 0, which means that HCZRNA could effectively break correlations existing in plaintext images. While the comparisons show that the proposed HCZRNA achieves the best results with [44,45] in all cases. This reveals that HCZRNA outperforms when compared schemes in terms of reducing correlations.

Information Entropy
Information Entropy shows the randomness and uncertainty of image's pixels. If pixels in an image have uniform distribution, this image could resistant statistical attacks. Because there are 256 gray levels in each channel of color image, the Entropy calculation could be formulated as Equation (21): where C denotes channels of color image and p(i) is probability of gray level in whole channel.
The bigger H(C), the bigger uncertainty of image. While the theoretical value of H(C) is 8. Table 8 shows the entropies of all channels of plaintext color images and corresponding cipher images through encryptions by proposed HCZRNA. It is obvious that cipher images have increased entropies a lot from plaintext images and their entropies are very close to the theoretical value. Moreover, a comparison is held between HCZRNA and Ref. [23,29,[44][45][46], and the results are stated in Table 9. Among all of the encryption schemes, the proposed HCZRNA achieves the highest entropies in four out of six cases. It could conclude that HCZRNA has the ability to resist statistical attack.

Differential Attack
The differential attack test is an important security test for image encryption, which reveals the influence on the cipher image caused by a minor change in pixels of plaintext image. If a tiny change on pixels in plaintext image leads to significant different cipher image, that is to say the encryption scheme could resist differential attack.
Two important indices are introduced to measure the ability of differential attack resistance, which is called the number of pixel change rate (NPCR) and the unified average changing intensity (UACI). Additionally, they are defined as Equations (22) and (23): where e 1 and e 2 are two cipher images, and e(i, j) means the pixel's value at coordinate i, j in image e. F(i, j) denotes whether the same coordinate's pixel values in e 1 and e 2 are independent or not, which could be formulated as Equation (24): For two random images, NPCR and UACI's expected values are stated as: NPCR = 99.6094% and U ACI = 33.4635% for an 8-bit gray image [30].
Hence, to realize the test, one bit would be changed on a random pixel in plaintext image. And both the plaintext image and changed image are encrypted to two different cipher images. Table 10 lists the average results of ten times tests. It could find that all NPCR values and UACI values of cipher images' different channels exceed the theoretical values. Additionally, comparisons with Ref. [23,29,[44][45][46] are shown in Tables 11 and 12. Through the comparisons, the proposed HCZRNA encryption scheme has better performances on NPCR and UACI, which indicates that HCZRNA could resist differential attack well.

Robustness
It is unavoidable that there data loss or noise attack occur when cipher images are transmitting. Hence, a well-designed encryption and decryption scheme should resist contamination on cipher images to recover plaintext images without great changes.
To demonstrate robustness of proposed HCZRNA scheme, 12.5%, 25%, and 50% data lose tests and 1%, 5%, and 10% salt and pepper noise tests would presented in Figures 11 and 12.   Figure 11. Cropping attack tests. The first row is cipher images with 12.5%, 25% and 50% data loss, and the second row is decrypted images from the first row. Figure 12. Noise attack tests. The first row is cipher images with 1%, 5%, 10% salt and pepper noise, and the second row is decrypted images from the first row.
From the figures, the main information of plaintext images could be identified from decrypted images, which could conclude that HCZRNA has enough robustness for data loss and noise attacks. Here, the Mean Squared Error (MSE) and Peak Signal to Noise Ratio (PSNR) are also utilized to test robustness [48,49], which is formulated as Equation (25).
where P and E represent two different images. MSE is used to evaluate the difference between two images, and PSNR depicts the ratio between the maximum possible power of a signal and the power of distorting noise that affects the quality of its representation. The lower the MSE, the higher PSNR, which indicates that two images have high similarity.
Hence, under noise attacks, if the PSNR between the plaintext image and decrypted image is high, the encryption and decryption schemes are good enough. Tables 13 and 14 present the results of plaintext image and decrypted image of Lena under data loss and salt and pepper noise attacks. Through the results, we could find there are high MSEs and low PSNRs in these tables, which figures out that HCZRNA could resist attacks of data loss and noise.

Running Time
In HCZRNA, the pixels of image would be walked through multiple times in diffusion and RNA operation. Suppose that the size of RGB image is N × N × 3. For the five parts of encryption processes that are listed in Section 3.1, initial values of hyper-chaotic system are calculated from the security key, which costs O(1) time complexity; the hyper-chaotic matrices are computed 3 × N × N + 64 times iterations; for permutation, reshape and sort operations are implemented three times; while the diffusion process walks through each pixel two times, which costs O(2 × N × N × 3); at last, as RNA operation walks through all 6-bit codons that are transformed from 8-bit pixels, the times of iteration are increased to 4 3 × N × N × 3. Hence, the time complexity of HCZRNA could be calculated . Using the experiment environment that is listed in this section, the running times of encryption and decryption could be stated in Table 15. Although the time costs of encryption and decryption are not very good, the time complexity is also a polynomial time, which could be tolerable. Additionally, the processes of RNA operation on different codons have no correlation with each other, which could improve computational time by computing RNA operation in parallel.

Conclusions
A novel hyper-chaotic system based image encryption scheme is proposed with 3D transformed Zigzag and RNA operation in this paper. By using the 6D hyper-chaotic system, three auxiliary matrices are generated, including one permutation index matrix, one mask matrix for Zigzag, and one codon table index matrix. Subsequently, two rounds 3D transformed Zigzag diffusion mechanism is proposed for pixels diffusion with each other. Nevertheless, additional encryption with RNA codons makes more reliable and secure results through employing codons tables and security keys. Through simulations, the proposed HCZRNA has better performances on the resistance of different types attacks than the compared encryption schemes, while the speed is not ideal, since it is a complex process. On the premise of ensuring performance, we would simplify diffusion and RNA operation processes and optimize the encryption steps for improving speed in the future.