Adaptive Chaotic Image Encryption Algorithm Based on RNA and Pixel Depth

: To prevent the leakage of image content, image encryption technology has received increasing attention. Most current algorithms are only suitable for the images of certain types and cannot update keys in a timely manner. To tackle such problems, we propose an adaptive chaotic image encryption algorithm based on RNA and pixel depth. Firstly, a novel chaotic system, two-dimensional improved Logistic-adjusted-Sine map is designed. Then, we propose a three-dimensional adaptive Arnold transform for scrambling. Secondly, keys are generated by the hash values of the plain image and current time to achieve one-image, one-key, and one-time pad simultaneously. Thirdly, we build a pre-permuted RNA cube for 3D adaptive scrambling by pixel depth, chaotic sequences, and adaptive RNA coding. Finally, selective diffusion combined with pixel depth and RNA operations is performed, in which the RNA operators are determined by the chemical structure and properties of amino acids. Pixel depth is integrated into the whole procedure of parameter generation, scrambling, and diffusion. Experiments and algorithm analyses show that our algorithm has strong security, desirable performance, and a broader scope of application.


Introduction
With the increasing use of instant messaging technology, images are widely used for communication. Meanwhile, some image content contains sensitive information, so image content security becomes an essential issue for scientists and engineers. As a standard and effective technology to protect the content security of digital multimedia information, the image encryption technology plays a significant role in many applications. To better protect the image content, besides the generation of cipher images, the applicability of the algorithm and the real-time update of the key are the crucial problems that researchers must focus on.
After decades of development, various excellent algorithms have emerged. To overcome the shortcomings of traditional algorithms, scholars have introduced chaos theory to image encryption. Classic text encryption algorithms such as Data Encryption Standard (DES), Advanced Encryption Standard (AES), and RSA cannot perform well in image encryption [1][2][3][4]. Matthews proposed that the chaotic system can be used in cryptography in 1989 [5]. As a result of its high sensitivity to initial values and parameters, pseudo randomness, ergodicity, complexity, etc., the chaotic system is extensively utilized in image encryption [6]. Recently, a series of image encryption algorithms have been proposed based on chaos [7][8][9][10][11][12][13]. Liu et al. proposed a multidimensional chaotic image encryption algorithm based on DNA coding. The traditional three-dimensional (3D) Lorenz system is improved to form a four-dimensional (4D) hyperchaotic Lorenz system for chaotic encryption [14]. By generating three new chaotic signals from two nearby orbits of one-dimensional (1D) chaotic maps, Zhou et al. proposed a simple color image cryptosystem with a very high level of security [15]. To improve the security of image

2D-ILASM Chaotic System
Recently, Zhou et al. [38] presented a novel chaotic system named 2D-LASM, which is derived from 1D Sine and Logistic maps. Compared to Sine and Logistic maps, 2D-LASM has a more complex structure, wider chaotic range, and better ergodicity. It is defined as where the system parameter µ ∈ [0, 1], the state variables x, y ∈ (0, 1), and the system is chaotic. When µ = 0.7, the Lyapunov exponents are 0.7884 and 0.7495, the system is hyperchaotic. Figure 1a plots the phase diagram of the chaotic system with the initial values x 0 = 0.1, y 0 = 0.1, andµ = 0.7. From Figure 1a, it is clear that the system is unable to cover the entire phase plane, so the security of the algorithm cannot be ensured. To further analyze the performance of 2D-LASM, we select 10,000 points from chaotic sequence generated by 2D-LASM. Figure 2a,b show the sequence statistical histograms of 2D-LASM. From Figure 2a,b, we find that the chaotic sequence is distributed unevenly; most of the data are concentrated on both sides, while the middle distribution is less. However, for a valid chaotic system, the numerical distribution of the chaotic sequence should be as close to uniform as possible. The experimental analyses of 2D-LASM shows that it exhibits weak chaotic behaviors in iteration. Therefore, we improve 2D-LASM by introducing the module operations, which can weaken those shortcomings and perform a better chaotic performance. The 2D-ILASM is expressed via Equation (2) as follows:  The experimental analyses of 2D-LASM shows that it exhibits weak chaotic behaviors in iteration. Therefore, we improve 2D-LASM by introducing the module operations, which can weaken those shortcomings and perform a better chaotic performance. The 2D-ILASM is expressed via Equation (2) as follows: x i+1 = mod(sin(πµ(y i + 3)x i (1 − x i )), 0.2) y i+1 = mod(sin(πµ(x i+1 + 3)y i (1 − y i )), 0.2) (2) where the system parameter µ ∈ [0, 1] and the state variables x, y ∈ (0, 0.2). The phase diagram of 2D-ILASM is shown in Figure 1b, which is distributed on the entire phase plane. The sequence statistical histograms of 2D-ILASM are shown in Figure 2c,d. These figures indicate that chaotic sequences scatter evenly in different intervals. The ideal pseudorandom sequence used in cryptosystems should possess fine statistical properties [39]. To analyze the output performance of the 2D-ILASM, the test standard of NIST SP800-22 is introduced [40,41]. The NIST SP800-22 is a statistical package consisting of 15 test items that are used to verify the randomness of the produced sequences. For each test, the p-value is expected to fall into [0.01, 1] to accept the sequences as random. If a p-value for a test is determined to be equal to 1, then the sequence appears to have perfect randomness. As shown in Table 1, the tested sequences may pass all the test items. Therefore, the outputs of the 2D-ILASM can be considered randomness and used as key streams for image encryption. According to the above analyses, 2D-ILASM is suitable for generating chaotic sequences with excellent properties. In our algorithm, the proposed chaotic system is used to produce highly random chaotic sequences.

Chen-4D Hyperchaotic System
Based on the 3D Chen chaos, a 4D Chen hyperchaotic system has been reconstructed [42]. The 4D Chen hyperchaotic system has high dynamics complexity, a large key space, and more resistance to exhaustive attacks. The specific equation is as follows: where a, b, c, d, and e are parameters for controlling chaotic coefficients, and, z, u, v, and w are state variables of the chaotic system. When a = 35, b = 7, c = 12, and e ∈ ( 0.085, 0.798], the conditions of the hyperchaotic system are met, and the system is in a hyperchaotic state. The phase diagrams of the Chen hyperchaotic system are depicted in Figure 3.

RNA Encoding Rules and Operations
DNA and RNA are the core materials in the process of biological genetics. A DNA sequence is composed of four bases, namely A (adenine), C (cytosine), G (guanine), T (thymine), which are arranged in a certain order. An RNA sequence is also built of four nucleic acid bases. There is only one different base; that is, U (uracil) in RNA replaces T in DNA [43]. In the past several years, DNA coding technology is widely used in image encryption for its excellent characteristics in computing. In RNA coding, two binary numbers are mapped to one base under the designed coding rule. In biology, single-stranded RNA synthesizes its complementary strand according to the principle of complementary base pairing and then forms double-stranded RNA [43]. Based on the above discussion, we adopt RNA coding and operation in this paper, A and U are complementary, and C and G are complementary. Following the RNA complementation rules, we can only get eight coding rules shown in Table 2.
Analogous to DNA operations and inspired by the RNA complementary pairing rules, there are six operators in RNA operations: addition, subtraction, add-complement, sub-complement, XOR (exclusive OR), and XNOR (exclusive NOR). In RNA calculation, the proposed eight coding rules and six operations make 48 different choices for every

RNA Encoding Rules and Operations
DNA and RNA are the core materials in the process of biological genetics. A DNA sequence is composed of four bases, namely A (adenine), C (cytosine), G (guanine), T (thymine), which are arranged in a certain order. An RNA sequence is also built of four nucleic acid bases. There is only one different base; that is, U (uracil) in RNA replaces T in DNA [43]. In the past several years, DNA coding technology is widely used in image encryption for its excellent characteristics in computing. In RNA coding, two binary numbers are mapped to one base under the designed coding rule. In biology, single-stranded RNA synthesizes its complementary strand according to the principle of complementary base pairing and then forms double-stranded RNA [43]. Based on the above discussion, we adopt RNA coding and operation in this paper, A and U are complementary, and C and G are complementary. Following the RNA complementation rules, we can only get eight coding rules shown in Table 2.
Analogous to DNA operations and inspired by the RNA complementary pairing rules, there are six operators in RNA operations: addition, subtraction, add-complement, sub-complement, XOR (exclusive OR), and XNOR (exclusive NOR). In RNA calculation, the proposed eight coding rules and six operations make 48 different choices for every operation between two bases. Tables 3-8 show the addition operation, the subtraction operation, the add-complement operation, the sub-complement operation, the XOR operation, and the XNOR operation, respectively, which are designed under the coding rule 1. Table 3. RNA addition rule.  Table 5. RNA add-complement rule.  Table 7. RNA XOR rule. Table 8. RNA XNOR rule.

−'
The three adjacent bases on the messenger RNA chain that determine an amino acid during protein synthesis are called codons. RNA is composed of four bases, and every three bases are combined into a codon. In theory, there are 4 × 4 × 4 = 64 kinds of base combinations, that is, 64 kinds of codons. Then, m-RNA can be combined with t-RNA, amino acids can be combined with different polarities, and chemical structures can be formed, as shown in Figure 4. The three adjacent bases on the messenger RNA chain that determine an amino acid during protein synthesis are called codons. RNA is composed of four bases, and every three bases are combined into a codon. In theory, there are 4 4 4 64 × × = kinds of base combinations, that is, 64 kinds of codons. Then, m-RNA can be combined with t-RNA, amino acids can be combined with different polarities, and chemical structures can be formed, as shown in Figure 4.
Aliphatic hydrophobic amino acid Aliphatic hydrophilic amino acid Heterocyclic amino acid Aromatic amino acids Start codon Stop codon The difference in the structure of amino acids depends on the difference of the side chain groups. Wang et al. [43] divided amino acid types according to the polarity of amino acid side chain groups to build the RNA operator controller. In the proposed algorithm, amino acids are classified according to the chemical structure and properties of the side chain groups. By the correspondence between the first three bits of the four vertices of the RNA scrambled image and the codons, the operators used in the selective diffusion are selected. Due to the different number of codons for each amino acid, to make the RNA operators distributed in the calculation process more evenly, we consider dividing amino acids into six types. Each type represents a kind of operator. The specific correspondence is shown in Table 9. Table 9. Correspondence between amino acid category and operator.

Category of Amino Acids
Operator Aliphatic hydrophobic amino acid Aliphatic hydrophilic amino acid Aromatic amino acids Stop codon Heterocyclic amino acid Start codon

Pixel Depth
Pixel depth refers to the number of bits used to store each pixel, which are measured in BPP (Bit Per Pixel), and it is also used to measure the resolution of an image. Pixel depth determines the number of colors each pixel of a color image may have or determines the number of gray levels each pixel of a grayscale image may have. The more the number of bits representing the pixel value in the image, the more color types it can express, the deeper its pixel depth, and the larger its BPP value. The difference in the structure of amino acids depends on the difference of the side chain groups. Wang et al. [43] divided amino acid types according to the polarity of amino acid side chain groups to build the RNA operator controller. In the proposed algorithm, amino acids are classified according to the chemical structure and properties of the side chain groups. By the correspondence between the first three bits of the four vertices of the RNA scrambled image and the codons, the operators used in the selective diffusion are selected. Due to the different number of codons for each amino acid, to make the RNA operators distributed in the calculation process more evenly, we consider dividing amino acids into six types. Each type represents a kind of operator. The specific correspondence is shown in Table 9. Table 9. Correspondence between amino acid category and operator.

Category of Amino Acids Operator
Aliphatic hydrophobic amino acid ⊕ Aliphatic hydrophilic amino acid Aromatic amino acids + Stop codon − Heterocyclic amino acid + Start codon −

Pixel Depth
Pixel depth refers to the number of bits used to store each pixel, which are measured in BPP (Bit Per Pixel), and it is also used to measure the resolution of an image. Pixel depth determines the number of colors each pixel of a color image may have or determines the number of gray levels each pixel of a grayscale image may have. The more the number of bits representing the pixel value in the image, the more color types it can express, the deeper its pixel depth, and the larger its BPP value.
When the BPP of an image is 8 or 16, the maximum number of colors that a single pixel can express is 2 8 = 256 or 2 16 = 65,536, and the range of colors displayed is limited, which is called grayscale or high color image. When the BPP of an image is 24, the maximum number of colors that a single pixel can express is 2 24 = 16,777,216. Use 24 bits to display a pixel composed of 8 bits that are red, 8 bits that are green, and 8 bits that are blue. Each color can be displayed completely, so images with 24 bits and above are called true-color images. When the BPP of an image is 32, 2 32 = 2 24 + 2 8 , the common 32-bit color in the computer field does not represent 2 32 colors, but an 8-bit (2 8 = 256 level) transparency is Electronics 2021, 10, 1770 9 of 28 added to the 24-bit color. Therefore, the total number of 32-bit colors is the same as 24-bit colors, and 32-bit colors are called a full-color image. Pixel depth is one of the properties of the image itself, just like its size. Integrating pixel depth into the encryption process can increase the security and scope of the algorithm. In the proposed algorithm, the pixel depth of the plain image participates in the whole process of parameter generation, scrambling, and diffusion to enhance applicability and security. Lena images with different pixel depths are shown in Figure 5.
pixel can express is 2 = 256 or 2 = 65,536, and the range of colors displayed is limited, which is called grayscale or high color image. When the BPP of an image is 24, the maximum number of colors that a single pixel can express is 2 24 = 16,777,216. Use 24 bits to display a pixel composed of 8 bits that are red, 8 bits that are green, and 8 bits that are blue. Each color can be displayed completely, so images with 24 bits and above are called true-color images. When the BPP of an image is 32, 2 32 = 2 24 + 2 8 , the common 32-bit color in the computer field does not represent 2 32 colors, but an 8-bit (2 8 = 256 level) transparency is added to the 24-bit color. Therefore, the total number of 32-bit colors is the same as 24bit colors, and 32-bit colors are called a full-color image. Pixel depth is one of the properties of the image itself, just like its size. Integrating pixel depth into the encryption process can increase the security and scope of the algorithm. In the proposed algorithm, the pixel depth of the plain image participates in the whole process of parameter generation, scrambling, and diffusion to enhance applicability and security. Lena images with different pixel depths are shown in Figure 5.
where N is the order of the matrix, are the positions of elements before applying AT, and are the positions of elements after applying AT. The first three iterations of the 2D-AT in the cycle, shown in Figure 6a-c, failed to hide the content of the plain image ideally. This situation can be changed after three iterations. For the above reasons, some image scrambling methods based on 2D-AT usually require multiple operations to achieve better performance, so the scrambling efficiency may be low. Due to its 2D characteristics, 2D-AT is mostly applied to grayscale images. When applied to color images, 2D-AT is mainly used on the RGB components separately-the image is not treated as a whole, so the scrambling results are not satisfactory.
To overcome the shortcomings of 2D-AT and obtain better scrambling performance, in this paper, we build the 3D adaptive Arnold transform (3D-AAT) by adding two adaptive parameters 1 q and 2 q in 3D-AT. The 3D-AAT is given by
where N is the order of the matrix, x, y ∈ {1, 2, · · · , N} are the positions of elements before applying AT, and x , y ∈ {1, 2, · · · , N} are the positions of elements after applying AT. The first three iterations of the 2D-AT in the cycle, shown in Figure 6a-c, failed to hide the content of the plain image ideally. This situation can be changed after three iterations. For the above reasons, some image scrambling methods based on 2D-AT usually require multiple operations to achieve better performance, so the scrambling efficiency may be low. Due to its 2D characteristics, 2D-AT is mostly applied to grayscale images. When applied to color images, 2D-AT is mainly used on the RGB components separately-the image is not treated as a whole, so the scrambling results are not satisfactory.
To overcome the shortcomings of 2D-AT and obtain better scrambling performance, in this paper, we build the 3D adaptive Arnold transform (3D-AAT) by adding two adaptive parameters q 1 and q 2 in 3D-AT. The 3D-AAT is given by where N is the order of the matrix, x, y, z ∈ {1, 2, · · · , N} are the position of elements before applying 3D-AAT, q 1 and q 2 are two adaptive parameters calculated by Equation (10), and x , y , z ∈ {1, 2, · · · , N} are the position of elements after applying 3D-AAT. According to the experimental results shown in Figure 6d,f, we can see that images with different pixel depths all perform satisfactory results by only one round 3D-AAT. Therefore, 3D-AAT has an ideal scrambling effect and efficiency and is suitable for scrambling images with various pixel depths. fore applying 3D-AAT, 1 q and 2 q are two adaptive parameters calculated by Equation (10), and are the position of elements after applying 3D-AAT. According to the experimental results shown in Figure 6d,f, we can see that images with different pixel depths all perform satisfactory results by only one round 3D-AAT. Therefore, 3D-AAT has an ideal scrambling effect and efficiency and is suitable for scrambling images with various pixel depths. AT is a periodic map, and the period depends on the size of the image. For example, an RNA cube is obtained from a 512 512 × plain image with different pixel depths, and the corresponding periods of 2D-AT and 3D-AAT are shown in Table 10. We can see from Table 10 that for the same order N , the period of 3D-AAT is much larger than of 2D-AT. Assuming AT's period is T , if an image is scrambled by AT for times, then the image can be recovered by applying T t − times Arnold transform again. In practical engineering applications, the image order is generally large, and it is inefficient to use the transformation period to restore the image. Therefore, this paper uses the corresponding inverse transform to perform the corresponding operation. The 3D inverse adaptive Arnold transform (3D-IAAT) is shown as Equation (6).  AT is a periodic map, and the period depends on the size of the image. For example, an RNA cube is obtained from a 512 × 512 plain image with different pixel depths, and the corresponding periods of 2D-AT and 3D-AAT are shown in Table 10. We can see from Table 10 that for the same order N, the period of 3D-AAT is much larger than of 2D-AT. Assuming AT's period is T, if an image is scrambled by AT for t times, then the image can be recovered by applying T − t times Arnold transform again. In practical engineering applications, the image order is generally large, and it is inefficient to use the transformation period to restore the image. Therefore, this paper uses the corresponding inverse transform to perform the corresponding operation. The 3D inverse adaptive Arnold transform (3D-IAAT) is shown as Equation (6). Secure Hash Algorithms (SHA) are a kind of hash functions released by the National Institute of Standards and Technology (NIST), which is mainly used in the integrity security services [45]. SHA-256 is a commonly used one with an output digest length of 256 bit. To prevent hackers from inferring the original password through the rainbow table, when calculating the hash, they cannot calculate the original input only. It is necessary to add salt to make the same input get different hash values, increasing the hacking difficulty greatly. In this paper, to strengthen the plaintext sensitivity and security of the algorithm, we combine the SHA-256 hash value of the plain image and the current computer time with the external parameters to generate keys jointly.
By combining the hash value of the current computer time and the plain image, oneimage, one-key, and one-time pad can be realized simultaneously. Each parameter in the proposed algorithm changes with time. Even if the key is leaked, it is secure to transmit the cipher image of the same plain image next time.
For the plain image with pixel depth d and the computer's current system time, the SHA-256 is used to get two hash codes H 1 and H 2 with 256 bits. H 1 and H 2 respectively take the first 128 bits and then integrate them into a 256-bit hash code H , which is divided into 8-bit blocks, i.e., where h i , i = 1, 2, · · · 32 are blocks with 8-bit length. The required key stream is calculated by Equations (8)-(10), where x 0 , y 0 , z 0 , u 0 , v 0 , w 0 , µ , e , t are the external parameters input by the user. {x 0 , y 0 , µ} are the initial values and control parameter of a 2D-ILASM hyperchaotic system, {z 0 , u 0 , v 0 , w 0 , e} are the initial values and control parameter of a 4D-Chen hyperchaotic system respectively, and {t, q 1 , q 2 } are the iterate number and control parameters of 3D-AAT.
where mod(·) denotes the modulus after division, bin2dec(·) denotes binary to decimal, f loor(·) is the rounded-down function, and denotes the XNOR operation in the binary system.

Encryption Process
Supposing that Alice is the sender and Bob is the recipient. The encryption flowchart of the proposed algorithm is shown in Figure 7. The encryption process is described in detail as follows.
is the rounded-down function, and  denotes the XNOR operation in the binary system.

Encryption Process
Supposing that Alice is the sender and Bob is the recipient. The encryption flowchart of the proposed algorithm is shown in Figure 7. The encryption process is described in detail as follows.   Step 1: Key generation Alice reads the current computer time and the plain image I with size m × n and pixel depth d. The SHA-256 is used to generate the 256-bit hash value H by Equation (7). Alice randomly selects external parameters x 0 , y 0 , z 0 , u 0 , v 0 , w 0 , µ , e , t as the user's input keys. The parameters {x 0 , y 0 , µ, z 0 , u 0 , v 0 , w 0 , e, t, q 1 , q 2 ,} are generated by Equations (8)-(10).
Step 2: Chaotic sequence generation Alice iterates the 2D-ILASM system 1000 + m × n × d/2 times with the initial values x 0 , y 0 and control parameter µ, discarding the first 1000 values to obtain the excellent randomness. Two chaotic sequences X, Y are produced. Then, the 4D-Chen system iterates 1000 + mn times with the initial values z 0 , u 0 , v 0 , w 0 and control parameter e to generate four chaotic matrices Z, U, V, W with the equal size of m × n.
Step 3: Encoding rule generation Calculate where mod(·) denotes the modulus after division and f loor(·) is the rounded-down function. {r 1 , r 2 , r 3 , r 4 , r 5 , r 6 ,} are the encoding and decoding rules that need to be used in subsequent operations.
Step 4: RNA cube generation Alice uses the RNA coding rule r 1 to encode the plain image I, and a 3D RNA matrix I 3D of size m × n × d/2 is obtained. Using one RNA code as the layer thickness and stratifying I 3D , we can get RNA layered images I R j , j = 1, 2, · · · , d/2 with the same size m × n and corresponding vectors are V 1 j , j = 1, 2, · · · , d/2, respectively. After that, Alice connects V 1 j into a long vector V 1 by Equation (20) and calculates [X , p 1 ] = sort(X(j)), j = 1, 2, · · · , d/2 where sort(·) is the sorting function, ceil(·) is the function that rounds toward positive infinity, X , Y are the sorting sequences, and P 1 , P 2 are the indexes recording the elements arrangement in X , Y . The scrambling result V 2 of V 1 is obtained by Equation (21). Finally, she upscales the dimension of V 2 to produce the scrambled RNA cube I 2 3D with size l × l × l after zero padding. This operation aims to initially scramble the plain image and generate a cube for the next 3D-AAT. The schematic diagram of RNA cube generation is shown in Figure 8. image and generate a cube for the next 3D-AAT. The schematic diagram of RNA cube generation is shown in Figure 8. Step 5: Adaptive 3D scrambling operation Alice utilizes t times 3D-AAT into RNA cube Step 6: Operator controller generation Six RNA operation rules: addition, subtraction, add-complement, sub-complement, XOR, and XNOR are defined in Section 3.3. Alice applied the RNA theory in biology to Step 5: Adaptive 3D scrambling operation Alice utilizes t times 3D-AAT into RNA cube I 2 3D obtained in Step 4. Let I 3 3D be the corresponding result. After converting I 3 3D into a 1D RNA sequence V 3 and deleting the previously added zero codes, Alice uses rule r 2 to decode the code-deleted 1D RNA sequence V 4 . Then, she performs a dimension upscaling operation on V 4 to produce the scrambled image I 4 with size m × n. At this point, the scrambling stage is completed. The parameters of 3D-AT are also used as keys.
Step 6: Operator controller generation Six RNA operation rules: addition, subtraction, add-complement, sub-complement, XOR, and XNOR are defined in Section 3.3. Alice applied the RNA theory in biology to construct the RNA amino acid sequence generation table, as shown in Figure 4. Moreover, the corresponding relationship between the RNA amino acid sequence generation table and the RNA operator is designed, i.e., the operator controller, as shown in Table 9.
Step 7: Operator selection The four vertices of the scrambled image I 4 are chosen respectively, the first six bits of their pixel values are used as control parameters, and the RNA coding rule r 3 is exploited to encode them. Utilizing the distribution of the parameter's RNA values in the amino acid sequence generation table shown in Figure 4, Alice checks the operator controller Table 9 to select four out of six operators, namely operator 1, operator 2, operator 3, and operator 4. The selected operators participate at the subsequent diffusion stage.
Step 8: Selective diffusion Alice segments scrambled image I 4 every 8 bits into images I 4 i , i = 1, 2, · · · , d/8 and then uses RNA coding rule r 4 on I 4 i to obtain I 5 i . Z 1 , U 1 , V 1 , W 1 are the results of encoding the chaotic matrices Z, U, V, W by rule r 5 . She selects operators under the corresponding relationship in Step 7. According to the operation rule in Step 8, the chaotic RNA matrices Z 1 , U 1 , V 1 , W 1 and the scrambled RNA image I 5 i are diffused as follows: where I e i , i = 1, 2, · · · , d/8 are the diffused RNA images. Then, I e i are merged into the cipher RNA image I e . Finally, Alice decodes I e by rule r 6 into the cipher image I c .

Decryption Process
The decryption is the inverse procedure of encryption. When the SHA-256 value H, the pixel values of the four vertices of the scrambled image, and external parameters x 0 , y 0 , z 0 , u 0 , v 0 , w 0 , µ , e , t are sent by Alice, Bob can decrypt the cipher image I c with pixel depth d. The decryption flowchart is shown in Figure 9.

Experiments
Plain images of size 512 × 512, including grayscale image Lena with pixel depth 8BPP, grayscale image Lena with pixel depth 16BPP, and color image Baboon with pixel depth 24BPP as shown in Figure 10, are tested by the proposed encryption algorithm. The computer configuration used in the experiments is shown as follows: Intel(R) core (TM) i5-8265U CPU, 1.80 GHz processor, 8 GB RAM. We utilize standard test images as the experimental images. At 15:31 on 10 December 2020, we used 8BPP Lena as an example, whose corresponding hash value H is listed as H= 9390454675d1f5e55b046d30f05a8ea1532c6b269a 303ac19d3d0a906bb5e250. The external parameters are shown in Table 11. The corresponding cipher images are shown in Figure 11. It can be seen from the results that the plain images are encrypted into noise-like images by the proposed algorithm. Experimental results illustrate that the cipher images appear to be noisy so that people can hardly get any meaningful information visually. Therefore, the proposed algorithm has an excellent encryption effect. The decrypted images are identical to the plain images in Figure 10, respectively.

Decryption Process
The decryption is the inverse procedure of encryption. When the SHA-256 value H , the pixel values of the four vertices of the scrambled image, and external parameters

Experiments
Plain images of size 512 × 512, including grayscale image Lena with pixel depth 8BPP, grayscale image Lena with pixel depth 16BPP, and color image Baboon with pixel depth   Table 11. The corresponding cipher images are shown 11. It can be seen from the results that the plain images are encrypted into noise ages by the proposed algorithm. Experimental results illustrate that the cipher im pear to be noisy so that people can hardly get any meaningful information visuall fore, the proposed algorithm has an excellent encryption effect. The decrypted im identical to the plain images in Figure 10, respectively.

Component Values
External parameters

Algorithm Analyses
An excellent image encryption algorithm can resist several commonly used such as the brute-force attack and differential attack. This section gives detailed

Component Values
External parameters

Algorithm Analyses
An excellent image encryption algorithm can resist several commonly used attacks, such as the brute-force attack and differential attack. This section gives detailed figures, tables, and descriptions to measure the performance of the proposed algorithm. The decryption results with the wrong key, 3D histograms of plain images and cipher images, adjacent pixel correlations of cipher images, and resistance to cropping and noise attacks are presented in figures. The key space, chi-squared test results, correlations between plain images and cipher images, information entropy, time complexity, and resistance to differential attacks are presented in numbers and tables as follows. We also compare it with some similar algorithms.
The average encryption time of the 512 × 512 grayscale images was 0.9274 s. The comparison results of the 512 × 512 8BPP Lena are shown in Table 12.

Algorithm Analyses
An excellent image encryption algorithm can resist several commonly used attacks, such as the brute-force attack and differential attack. This section gives detailed figures, tables, and descriptions to measure the performance of the proposed algorithm. The decryption results with the wrong key, 3D histograms of plain images and cipher images, adjacent pixel correlations of cipher images, and resistance to cropping and noise attacks are presented in figures. The key space, chi-squared test results, correlations between plain images and cipher images, information entropy, time complexity, and resistance to differential attacks are presented in numbers and tables as follows. We also compare it with some similar algorithms.
The average encryption time of the 512 × 512 grayscale images was 0.9274 s. The comparison results of the 512 × 512 8BPP Lena are shown in Table 12.

Key Space Analysis
The key space is equivalent to the number of all available keys in an algorithm. For an excellent encryption algorithm, its key space should be so large that it cannot be cracked by the brute-force attack. The required keys are composed of 256-bit hash value H and external parameters x 0 , y 0 , z 0 , u 0 , v 0 , w 0 , µ , e , t . If the calculation accuracy is 10 −14 , then the key space for the proposed algorithm is about 10 14×9 × 2 256 ≈ 1.1579 × 10 203 ≈ 2 674 , which is greatly larger than the required value 2 100 in the cryptosystem.
Considering the actual technology, the fastest supercomputer today (Summit) is capable of 200 PFLOPS (10 15 floating-point operation per second) or 200,000 trillion calculations per second. According to Equation (24) [45], even with five times the most powerful computing power at present, it will take 1.2359 × 10 196 years to crack the encryption system with the key space of 2 674 . Therefore, the key space of the proposed algorithm is huge enough to resist the brute-force attack.

Key Sensitivity Analysis
An effective and robust encryption algorithm should be sensitive enough to even the slightest changes in its keys. The incorrect outcome will be produced when we use the key after any slightest changes to decrypt the cipher image. By subtracting the error images, the attacker cannot extract any clues related to the cipher image. As shown in Figure 12, (a) is Lena's cipher image encrypted with the keys (x 0 = 0.9865, y 0 = 1.4335, z 0 = 1.4977, u 0 = 0.5501, v 0 = 2.5159, w 0 = 1.3714, µ = 1.6686, e = 0.2759, t = 2.5568), while (b) is the decrypted image of decrypting (a) with correct keys, which is exactly the same as the plain image. Figure 12c-f show the decryption results with the error keys respectively, where the only minimal difference is between the wrong key and the correct key. Assuming the attackers subtract the error decrypted image pairwise to analyze information to help crack the cipher image, any information of the plain image will not be disclosed to them. The corresponding results are shown in Figure 12g-l. Therefore, the proposed algorithm is highly sensitive to the keys. tem with the key space of 2 . Therefore, the key space of the proposed algorithm is huge enough to resist the brute-force attack.

Key Sensitivity Analysis
An effective and robust encryption algorithm should be sensitive enough to even the slightest changes in its keys. The incorrect outcome will be produced when we use the key after any slightest changes to decrypt the cipher image. By subtracting the error images, the attacker cannot extract any clues related to the cipher image. As shown in Figure 12, while (b) is the decrypted image of decrypting (a) with correct keys, which is exactly the same as the plain image. Figure 12c-f show the decryption results with the error keys respectively, where the only minimal difference is between the wrong key and the correct key. Assuming the attackers subtract the error decrypted image pairwise to analyze information to help crack the cipher image, any information of the plain image will not be disclosed to them. The corresponding results are shown in Figure 12g-l. Therefore, the proposed algorithm is highly sensitive to the keys.

Histogram Analysis
The histogram can reflect the statistical characteristics of the distribution of pixel values. For an ideal encryption algorithm, the histogram of the cipher image should always be uniform [45]. Figure 13 shows the 3D histograms of the plain images and the cipher images with various pixel depth. The experimental results show that the histograms of the cipher images are evenly distributed, which are completely different from the plain images and no longer present any statistical characteristics of plain images.

Histogram Analysis
The histogram can reflect the statistical characteristics of the distribution of pixel values. For an ideal encryption algorithm, the histogram of the cipher image should always be uniform [45]. Figure 13 shows the 3D histograms of the plain images and the cipher images with various pixel depth. The experimental results show that the histograms of the cipher images are evenly distributed, which are completely different from the plain images and no longer present any statistical characteristics of plain images.
The histogram can reflect the statistical characteristics of the distribution of pixel values. For an ideal encryption algorithm, the histogram of the cipher image should always be uniform [45]. Figure 13 shows the 3D histograms of the plain images and the cipher images with various pixel depth. The experimental results show that the histograms of the cipher images are evenly distributed, which are completely different from the plain images and no longer present any statistical characteristics of plain images.

Chi-Squared Test
The chi-square test can produce quantitative numerical results to analyze the distribution of cipher images more accurately while avoiding visual deception. We use the formula in an article [49] for comparative analysis as follows: where m and n are the size of the image. The larger 2 χ is, the more the pixel values deviate from the average level, and the more uneven the pixel distribution is. Table 13 provides 2 χ values of the corresponding test results, we can see that the 2 χ value of the cipher image is much smaller than that of the plain image. Information entropy is a measure of the indeterminacy of image information. The information entropy of an ideal cipher image should be close to 8 [50]. The information

Chi-Squared Test
The chi-square test can produce quantitative numerical results to analyze the distribution of cipher images more accurately while avoiding visual deception. We use the formula in an article [49] for comparative analysis as follows: where q i represents the times the pixel value i appears in the image. q is the theoretical value, which is defined as: where m and n are the size of the image. The larger χ 2 is, the more the pixel values deviate from the average level, and the more uneven the pixel distribution is. Table 13 provides χ 2 values of the corresponding test results, we can see that the χ 2 value of the cipher image is much smaller than that of the plain image.

Information Entropy Analysis
Information entropy is a measure of the indeterminacy of image information. The information entropy of an ideal cipher image should be close to 8 [50]. The information entropy of the gray image is described as where m i is the i th gray level for the digital image I with 256 gray levels, and P(m i ) is the emergence probability of m i . Table 14 shows the entropy of plain images and cipher images with various pixel depth and also includes comparison with other algorithms. Therefore, the proposed algorithm can effectively resist the statistical attack.

Differential Attack Analysis
Differential attack is often used to test the plaintext sensitivity of image encryption algorithms [49]. In the encryption procedure, the ideal encryption algorithm should respond powerfully to the slight changes in the plain image. The Number of Pixels Change Rate (NPCR) reflects the number of changed pixels in the cipher image after the plain image is changed. The Unified Average Changing Intensity (UACI) measures the average difference intensity of pixel values between two cipher images, which correspond to the original image and the changed original image. To evaluate the ability to resist the differential attack, we employed the NPCR and UACI as the indicators for evaluating the differential attack. NPCR and UACI are defined by where I (i, j) is the cipher image of the plain image, I (i, j) is the cipher image of the modified plain image, and f (i, j) is defined by Even if two images are very similar, such as only one-bit difference, their hash values of SHA-256 are completely different [51]. Since the keys are related to the hash value, their values are very sensitive to the plain image. In the experiment, a pixel I(68, 189) of the plain image is chosen. To test the ability to resist the differential attack, the gray value of this pixel is changed to 200. The corresponding experimental results are shown in Figure 14 and Table 15. For the proposed algorithm, compared with standard values NPCR = 99.6094% and UACI = 33.4635%, our results are closer to theoretical values than similar algorithms, as shown in Table 15, and they demonstrate that a slight change to the plain image will result in a great change in the cipher image. Therefore, the proposed algorithm has an excellent ability to resist the differential attack. Electronics 2021, 10, x FOR PEER REVIEW 21 of 29 Figure 14. Cipher images and decrypted images of plain images with one-pixel difference: (a1) Lena (8BPP); (a2) Cipher image of (a1); (a3) Cipher image of (a1) changed by one pixel; (a4) Decryption of (a2); (a5) Decryption of (a3); (b1) Lena (16BPP); (b2) Cipher image of (b1); (b3) Cipher image of (b1) changed by one pixel; (b4) Decryption of (b2); (b5) Decryption of (b3); (c1) Baboon; (c2) Cipher image of (c1); (c3) Cipher image of (c1) changed by one pixel; (c4) Decryption of (c2); (c5) Decryption of (c3). The encryption quality of cipher images is often quantitatively verified by mean square error (MSE), peak signal-to-noise ratio (PSNR), and structural similarity index (SSIM). The specific formulas of them are defined as follows [45]: where Figure 14. Cipher images and decrypted images of plain images with one-pixel difference: (a1) Lena (8BPP); (a2) Cipher image of (a1); (a3) Cipher image of (a1) changed by one pixel; (a4) Decryption of (a2); (a5) Decryption of (a3); (b1) Lena (16BPP); (b2) Cipher image of (b1); (b3) Cipher image of (b1) changed by one pixel; (b4) Decryption of (b2); (b5) Decryption of (b3); (c1) Baboon; (c2) Cipher image of (c1); (c3) Cipher image of (c1) changed by one pixel; (c4) Decryption of (c2); (c5) Decryption of (c3).

Encryption Quality Analysis
The encryption quality of cipher images is often quantitatively verified by mean square error (MSE), peak signal-to-noise ratio (PSNR), and structural similarity index (SSIM). The specific formulas of them are defined as follows [45]: where where M × N is the size of the image, P is the plain image, E is the cipher image, P is the mean of the plain image, E is the mean of the cipher image, σ P is the standard deviation of the plain image, σ E is the standard deviation of cipher image, and σ PE is the crosscorrelation of the plain image and cipher image. L is the dynamic range of the pixel values (for grayscale images, L = 255) with K 1 = 0.01 and K 2 = 0.03. Currently, the cipher image with a large MSE value, a PSNR lower than 10 dB, and an SSIM close to 0 means an efficient pseudorandom ciphertext and has a structural difference with its plain image. As shown in Table 16, the indicators of the proposed algorithm are relatively close to ideal values.

Correlation Analysis
The strong correlation of adjacent pixels is an important feature of digital images [34]. Therefore, the correlation of adjacent pixels is one of the important criteria for evaluating the performance of an image encryption algorithm. To analyze the performance of the algorithm in the pixel correlation test, we conducted corresponding experiments. The correlation coefficient of each pair is defined by where E(x) and D(x) are the mathematical expectation and variance of the data x, respectively. They are defined by For the proposed algorithm, 40,000 pairs of adjacent pixels are randomly selected from the plain images and the cipher images. For all plain images and cipher images with various pixel depth, Figures 15-20 reflect their horizontal, vertical, and diagonal relevance for adjacent pixels, respectively. For the proposed algorithm, Table 17 lists the adjacent pixels of the plain image and the correlation coefficients of their corresponding cipher images. Experimental results show that the correlation coefficients of the plain images are close to 1, whereas the correlation coefficients of the cipher images are close to 0 in all directions. Therefore, the proposed algorithm can destroy the correlation between adjacent pixels well and protect the content of the plain image.
For the proposed algorithm, 40,000 pairs of adjacent pixels are randomly selected from the plain images and the cipher images. For all plain images and cipher images with various pixel depth, Figures 15-20 reflect their horizontal, vertical, and diagonal relevance for adjacent pixels, respectively. For the proposed algorithm, Table 17 lists the adjacent pixels of the plain image and the correlation coefficients of their corresponding cipher images. Experimental results show that the correlation coefficients of the plain images are close to 1, whereas the correlation coefficients of the cipher images are close to 0 in all directions. Therefore, the proposed algorithm can destroy the correlation between adjacent pixels well and protect the content of the plain image.
For the proposed algorithm, 40,000 pairs of adjacent pixels are randomly selected from the plain images and the cipher images. For all plain images and cipher images with various pixel depth, Figures 15-20 reflect their horizontal, vertical, and diagonal relevance for adjacent pixels, respectively. For the proposed algorithm, Table 17 lists the adjacent pixels of the plain image and the correlation coefficients of their corresponding cipher images. Experimental results show that the correlation coefficients of the plain images are close to 1, whereas the correlation coefficients of the cipher images are close to 0 in all directions. Therefore, the proposed algorithm can destroy the correlation between adjacent pixels well and protect the content of the plain image.      have been damaged in different ways and degrees are used as samples to part the test, and the results are satisfactory. In the cropping attacks test, we set 12. and 50% of cropping in a cipher image. As shown in Figure 20, the attacked ciphe still contain considerable plaintext information after being decrypted. In the nois test, salt and pepper noises with strengths of 2%, 10%, and 20% were mixed into t image respectively, and the decryption results are shown in Figure 21.

Time Complexity Analysis
The size of the plain image is m n × . For our algorithm, two stages mainly time. One stage is the generation of random sequences. A Chen-4D hyperchaot and 2D-ILASM chaotic systems iterates multiple rounds to generate six s { , , , , , } X Y Z U V W whose longest length is

Robustness Analysis
Destroying the integrity of ciphertext is a common method in hacker attacks, which can prevent the recipient from obtaining plaintext information successfully. Cropping and noise attacks are the two most common methods [30]. In this section, cipher images that have been damaged in different ways and degrees are used as samples to participate in the test, and the results are satisfactory. In the cropping attacks test, we set 12.5%, 25%, and 50% of cropping in a cipher image. As shown in Figure 20, the attacked cipher images still contain considerable plaintext information after being decrypted. In the noise attacks test, salt and pepper noises with strengths of 2%, 10%, and 20% were mixed into the cipher image respectively, and the decryption results are shown in Figure 21.
Electronics 2021, 10, x FOR PEER REVIEW Destroying the integrity of ciphertext is a common method in hacker attack can prevent the recipient from obtaining plaintext information successfully. Crop noise attacks are the two most common methods [30]. In this section, cipher im have been damaged in different ways and degrees are used as samples to parti the test, and the results are satisfactory. In the cropping attacks test, we set 12. and 50% of cropping in a cipher image. As shown in Figure 20, the attacked ciphe still contain considerable plaintext information after being decrypted. In the nois test, salt and pepper noises with strengths of 2%, 10%, and 20% were mixed into t image respectively, and the decryption results are shown in Figure 21. The size of the plain image is m n × . For our algorithm, two stages mainly time. One stage is the generation of random sequences. A Chen-4D hyperchaoti and 2D-ILASM chaotic systems iterates multiple rounds to generate six s

Time Complexity Analysis
The size of the plain image is m × n. For our algorithm, two stages mainly consume time. One stage is the generation of random sequences. A Chen-4D hyperchaotic system and 2D-ILASM chaotic systems iterates multiple rounds to generate six sequences {X, Y, Z, U, V, W} whose longest length is m × n × d/2. Therefore, the complexity of this stage is O(m × n × d/2). The other stage is the adaptive RNA coding and operation, including six RNA coding and four RNA operation steps. The complexity of this stage is still O(m × n). Finally, the complexity for the proposed algorithm is O(m × n × d/2), which means that its complexity is linear. In summary, the proposed algorithm's time complexity is determined by the size and the pixel depth of the plain image.

Discussion
As we envisioned, integrating the current time and pixel depth into the encryption algorithm can update keys timely while making the algorithm self-adaptive to solve the problems of some algorithms. Since the proposed algorithm operates at the RNA base level throughout, it is time-consuming to a certain extent. Though the encryption speed of the proposed algorithm meets the basic requirements of image encryption algorithms and is faster than some existing ones, it is still not enough for real-time encryption. The proposed algorithm is only for one image. We may extend it to multiple-image encryption in subsequent research. In theory, the proposed algorithm can be utilized for images with greater pixel depth (such as remote sensing images). However, this has already involved the research field of hyperspectral image processing and has not been carried out in this paper. The experimental results have been able to prove the performance of the proposed algorithm. The authors will focus on the aforementioned problems to conduct deeper research.

Conclusions
This paper proposes an adaptive, chaotic image encryption algorithm based on RNA and pixel depth to enhance encryption performance and applicability. This paper designs a novel chaotic system called "2D-ILASM" and the 3D-AAT for scrambling, and keys are generated from the hash values of the plain image and current time; then, a pre-permuted RNA cube is constructed for 3D adaptive scrambling finally. RNA operation is introduced to realize the selective diffusion effect of RNA bases. Through the experimental results and algorithm analyses, the proposed algorithm is suitable for images with different pixel depths, updates the keys in real time, and has sufficient security to resist various attacks, such as the brute-force attack, differential attack, and statistical analysis attack, etc. Furthermore, this algorithm can extend to multiple images. Therefore, when people need to transfer different types of valuable images at the same time, the proposed algorithm is the better choice to ensure applicability, security, and the transmission privacy.