Article An Image Encryption Algorithm Based on Multichaotic System and DNA Coding

In this paper, an improved two-dimensional logistic-sine coupling map (N2D-LSCM) and an improved Henon map (NHenon) are proposed. Furthermore, by combining N2D-LSCM and NHenon map, an image encryption algorithm is proposed based on these two chaotic systems and DNA coding. The chaotic sequences generated by N2D-LSCM are used as the parameters of NHenon. In the scrambling stage, DNA encoding is carried out for pixels after scrambling by two chaotic sequences generated by N2D-LSCM; in the stage of diﬀusion, DNA random coding acts on random matrix obtained by two chaotic sequences generated by NHenon, and DNA XOR operation is carried out with the image obtained in the scrambling stage to diﬀuse. Compared with other 2D map for image encryption algorithm, this algorithm exhibits good security and holds high eﬃciency.


Introduction
In recent years, with the rapid development of network communication technology, a large number of digital information is transmitted through the network at every moment. It includes not only text message and images but also audio, videos, and other digital information [1]. How to protect this private information is an important research issue. Image encryption is one of the useful methods to protect image information. Because the digital image has the characteristics of large data capacity, high information redundancy, and high correlation between adjacent pixels, and the traditional text encryption methods, such as DES and AES [2,3], are no longer suitable for image encryption. e researchers introduced chaos theory into image encryption, and the properties of chaos like randomness, sensitive dependence on initial value, and unpredictability made chaos closely connected with cryptography [4]. In recent 10 years, with the increasing number of proposed chaotic systems, many image encryption algorithms have emerged.
Scrambling-diffusion is the classical structure of image encryption based on chaotic system [5], so image encryption mainly contains two stages: scrambling and diffusion. e scrambling phase changes the position of image pixels, and the diffusion phase conducts pixel values replacement and performs mutual diffusion among different pixels. For an encryption algorithm based on chaos, its encryption efficiency and security are mainly determined by the structure of encryption algorithm and the performance of chaotic maps.
In order to increase the efficiency of encryption algorithm, many encryption algorithms only use one-dimensional or two-dimensional chaotic system [6][7][8][9]. Because the chaotic system is deterministic, if the attacker obtains the corresponding chaotic orbit information, it is possible to use the existing analysis technology to analyze the structure type of the chaotic system and reduce the complexity of the key, so as to decode [10]. erefore, the security of low-dimensional mapping is not enough. Some encryption algorithms use a high-dimensional chaotic system, which makes the encryption speed low and cannot meet the real-time requirements [11,12]. e combination of multiple sets of low-dimensional maps can improve the security and efficiency of the algorithm [13,14]. In [13], Hua et al. proposed a composite structure of chaotic mapping based on cosine transform, which can composite many chaotic maps and has better chaotic performance. In [15], Abdelfatah obtained a new one-dimensional chaotic map DCPG by combining Chebyshev chaotic map with tent map; as a result, it largely increases the key space. Based on DCPG, a new encryption algorithm was proposed. Encryption was completed by two rounds of exclusive OR operations, with high encryption efficiency.
DNA molecules have the characteristics of large-scale parallel, huge storage space, and low power consumption. In recent years, many researchers have successfully combined DNA computing and chaotic systems into the field of image encryption [16,17]. In [16], Wang et al. proposed an image encryption method using DNA sequence operation and introduced a high-dimensional chaotic map as a chaotic sequence generator and only uses a single fixed DNA coding rule. In [17], Niyat and Moattar proposed a color image encryption method based on hyperchaotic system and DNA sequence. Image encryption adopts the idea of block. Each block randomly selects a DNA coding rule. However, in the scrambling stage and the diffusion stage, two kinds of threedimensional chaotic systems are used, resulting in large amount of calculation and low encryption efficiency. Dagadu et al. put forward a new image encryption method based on DNA sequence operation and chaos system [18]. Using random DNA coding rules and low-dimensional chaotic maps, the encryption effect and security were improved. Amani and Yaghoobi put forward a new color image adaptive encryption algorithm based on DNA sequence operation and hyperchaos system [19]. Due to the chaotic maps selected by the above algorithms, they have shortcomings in security or efficiency.
In order to overcome the problems of the above algorithms, we proposed an improved two-dimensional logisticsine coupling map (N2D-LSCM) and an improved Henon map (NHenon) in this paper. Further, we propose an image encryption scheme based on multiple chaotic systems and DNA coding. Our scheme use scrambling-diffusion structure. Two chaotic sequences are generated by N2D-LSCM in the scrambling process. On the one hand, these two chaotic sequences are used to permute original image and DNA encoding, respectively. On the other hand, in the diffusion stage, firstly, the sequence value generated by N2D-LSCM is taken as the parameter values of NHenon, and then two chaotic sequences are obtained by iterating the NHenon mapping, one as the key matrix and the other as the corresponding DNA coding rule matrix used in diffusion stage.
e key matrix is encoded by the DNA coding rule matrix. Finally, DNA XOR operation is performed on the DNA molecules between the permuted DNA matrix and the encoded key matrix to complete the image encryption. e simulation results show that this method has good security and can effectively resist many kinds of common attacks, such as statistical attack, brute-force, chosen/known plaintext attack, clipping attack, and noise attack. e rest of this paper is arranged as follows. Section 2 introduces the chaotic system and DNA coding; Section 3 describes the encryption algorithm; Section 4 shows the simulation experiment results; Section 5 presents the security analysis of the encryption method we proposed and the comparison results with the other three methods; finally, Section 6 summarizes this paper.

Chaotic System and DNA Coding
In this part, we first introduce the new 2D logistic-sine coupling map and new Henon map of the two chaotic systems involved in our method. e chaotic behavior of each chaotic map is analyzed by bifurcation diagram, Lyapunov exponent (LE) diagram, and trajectory diagram. In the bifurcation diagram, the horizontal axis represents parameters of a system and the vertical axis represents variables. If the system is chaotic, each fixed variable will correspond to as many parameters as possible. For two trajectories of a chaotic system, from two closed initial states, LE describes their average separation rate. Positive maximum LE number means that the closed trajectories of the dynamic system diverge in each unit time and evolve into completely different trajectories with the increase of time.
erefore, if the maximum LE number of the dynamic system is positive, the system is chaotic and a larger maximum LE number means better performance [6]. If a dynamic system can get more than one positive solution, its trajectory will diverge in many directions, so it has hyperchaotic behavior. e hyperchaotic behavior is a much more complex motion than the chaotic behavior. Trajectories indicate the motion from a given initial state increases with time. e trajectory of periodic motion is a closed curve, and the trajectory of chaotic behavior will never be closed or repeated in theory. erefore, the chaotic trajectory usually occupies part of the phase space, which can reflect the randomness of the output of the chaotic system. If the chaotic track of chaotic system can occupy more phase space, it has better random output. Finally, we will explain the DNA coding method used in this paper.

Chaotic System.
Many chaos-based digital image encryption schemes considering image features have been proposed.
In [1], in order to design a new chaotic map for image encryption algorithm with higher security, a two-dimensional Logistic-Sine coupling map, namely, 2D-LSCM, was proposed. e 2D-LSCM is defined as where θ is the control parameter. It is generated by first coupling the logistic and sine maps, then extending the dimension from one-dimensional (1D) to 2D. e system is chaotic when θ ∈ (0, 1), x i and y i are between As can be seen from Figure 1, the 2D-LSCM has the problem of uneven data distribution. erefore, we have 2 Discrete Dynamics in Nature and Society improved the 2D-LSCM. e new definition of 2D-LSCM (namely N2D-LSCM) is as follows: where θ is the parameter and θ ∈ (0, 1). e system is chaotic when For the values of the above parameters, Figures 3 and 4 are the Lyapunov exponents and trajectories, respectively, corresponding to equations (1) and (2). Compared with 2D-LSCM, N2D-LSCM not only increases the values of two maximum Lyapunov exponents but also further increases the proportion of trajectories in phase space.

Improved Henon Map.
Henon map is a two-dimensional discrete chaotic map, which is defined by When a ∈ [1.1, 1.4], b � 0.3, the Henon map is chaotic. e bifurcation diagram of Henon map is shown in Figures 5(a) and 5(b), and its Lyapunov exponent diagram is shown in Figure 6(a).
According to Figure 5, it can be found that Henon mapping not only has the problem of uneven data distribution but also the parameter range is small. In order to solve the above problems, we combine the Henon map and the sine map to construct a new two-dimensional map. In addition, we also combine the linear part z i into nonlinear part e z i , a new Henon (namely, NHenon) map is obtained, which is defined as follows: e range of parameters a and b is extended to (−∞, +∞).
When z 0 � 0.5 and q 0 � 0.5, a ∈ (−10, 10), b � 1.3, the bifurcation diagram of NHenon is shown in Figures 7(a) and 7(b), and its Lyapunov exponent diagram is shown in Figure 6(b). For the values of the above parameters, Figures 8(a) and 8(b) are the trajectories corresponding to formulas (5) and (6).
By comparing the bifurcation diagrams of Henon map and NHenon map, we can see that NHenon map has more uniform data distribution than Henon map. From Figure 6(b), it can be found that λ 1 ∈ (0.05, 0.2) and λ 2 ∈ (0.35, 0.5); therefore, there are always two positive maximum Lyapunov exponents in NHenon, which have a better chaotic property. At the same time, NHenon's trajectories occupy more phase space than Henon mapping.
In our proposed encryption method, the values of two chaotic sequences generated by N2D-LSCM are taken as the parameters of the NHenon mapping, so as to further improve the chaotic performance of the mapping. e form of the composite chaotic mapping is as follows: where θ ∈ (0, 1) is the parameter, x n ∈ [0, 1], y n ∈ [0, 1], z n ∈ [0, 1], and q n ∈ [0, 1].

DNA Coding.
ere are four bases in the DNA molecule in total, respectively, A, G, C, and T, where A is     complementary to T and G is complementary to C. Applying this property to the binary, that is 0 and 1 complement each other. By this, we can complete the DNA encoding of the binary number. In an image, the value of pixels is represented as binary, and each two bits represent one base, such that 00 and 11, 01 and 10 are complementary pairs in binary form. e eight DNA coding rules in Table 1 satisfy the DNA complementation rules proposed by Watson and Crick [20]. For example, the pixel value is 78, whose binary form is 01001110, if encoded according to rule 1 of Table 1, and the result is CATG.
Binary operations include addition, subtraction, XOR, and many other operations. As researchers delve deeper into DNA computing, they propose addition, subtraction, and exclusive OR operations on DNA computation. In this paper, to simplify the algorithm further, only the XOR operation of DNA is used in the diffusion phase, which is represented by ⊕ .
According to the eight DNA coding rules in Table 1, there are eight corresponding DNA exclusive OR rules, and the DNA exclusive OR operation rules based on DNA encoding rule 1 are shown in Table 2.

Encryption Algorithm Description
SHA256 algorithm can generate a unique hash value of 256 bits for any length of data. In our algorithm, the SHA 256 hash value of plaintext image is used to get the initial values and parameters of N2D-LSCM and NHenon. In the scrambling process, two pseudorandom sequences are generated by N2D-LSCM. On the one hand, these two chaotic sequences are used as a scrambling sequence and a Discrete Dynamics in Nature and Society scrambling DNA coding matrix, respectively. Firstly, the scrambling sequence is used to scramble plaintext image at pixel level, and then scrambling results are encoded according to scrambling DNA coding matrix. On the other hand, in the diffusion stage, the sequence generated by N2D-LSCM is taken as the parameter of NHenon. And then, two chaotic sequences are obtained by iterating the NHenon mapping, one as the key matrix and the other as the corresponding DNA coding rule matrix. e key matrix is encoded by the DNA coding matrix, and finally the permuted DNA matrix and random DNA matrix are performed DNA exclusive OR operation completes image encryption. e flow chart of our encryption algorithm is shown in Figure 9.
Discrete Dynamics in Nature and Society

Generating Initial Values and Parameters of Chaotic
Maps. First, the SHA256 hash value of the original image is set every 8 bits as a group, and a total of 32 sets are used as the encryption key K: K n � k n,1 k n,2 k n,3 k n,4 k n,5 k n,6 k n,7 k n,8 , en, according to formula (7), the intermediate variables used to calculate the initial value and parameters of chaotic mapping are obtained: Among them, l 1 ,l 2 ,l 3 ,l 4 , and l 5 are the intermediate variables for the parameters and initial values of N2D-LSCM and NHenon, respectively. e parameters and initial values of (5) are obtained by substituting the intermediate variables into the following equations: where θ � L 1 , x 0 � L 2 , y 0 � L 3 , z 0 � L 4 , and q 0 � L 5 . Round(·) is rounding function. L i (i � 1, 2, 3, 4, 5) and h are the initial values and parameters of N2D-LSCM and NHenon.

Pixel Level Scrambling
Step 1: four chaotic sequences X, Y, Z, and Q are obtained by iterative system (5) for 1000 + M × N times, and their first 1000 items are deleted. ese four sequences is calculated as follows: where the symbol i indicates rounding up; that is, the smallest integer greater than i. mod indicates modulo, and M and N are the height of the image and the width of the image, respectively.
Step 3 (scrambling stage): the specific process is as follows: (1) Order X increased to obtain the sequence X1 � x1 i | , i � 1, 2, . . . , M × N , and then the elements in X1 corresponds to the subscript in X to form a sequence X2, so that it satisfies the requirements of  Discrete Dynamics in Nature and Society

Diffusion Stage
Step 1: the matrix Z1 is obtained by rearranging the sequence Z into the matrix of M × N.
Step 2: each pixel of matrix Z1 is expanded into 8-bit binary to get matrix Z2.
Step 3: each pixel of Z1 adopts the same coding rule; that is, each pixel corresponds to a DNA coding rule. According to the elements' value of sequence Q, the corresponding DNA coding rule of each pixel is determined, and the DNA coding of Z2 is carried out to obtain the DNA random matrix of M × 4N.
Step 4: assume that the DNA coding matrix after diffusion is C DNA . en, we use the diffusion algorithm proposed in the reference, and the specific process is described as follows: (1) First, calculate the center point of matrix P6 according to equation (11) and then diffuse the center point of P6 according to equation (12)fd12: where ⊕ is the exclusive OR operator.

Getting the Encrypted Image.
After the diffusion process at the DNA level, the C DNA needs to be decoded to get the encrypted image. e decoding steps are as follows: Step 1: the matrix C DNA is randomly decoded into binary form. Let the array of DNA decoding rules be Rules � rule i � (Y i + Q i )mod8 + 1 | i � 1, 2, . . . , M× N}, decode the four DNA codes corresponding to each pixel according to Rules, and obtain the binary matrix C bin of M × 8N after DNA decoding.
Step 2: every 8 bits of binary matrix C bin are restored to decimal numeral system, and the encrypted image C img is obtained.

Experimental Results
Run PyCharm software in Windows 10 64-bit system environment and use the algorithm proposed in this paper to encrypt and decrypt Baboon.pgm(256 × 256), House.pgm(256 × 256), Barche.pgm(512 × 512), and Peppers.pgm (512 × 512) grayscale image. e selected key is shown in Table 3. e experimental results are shown in Figure 10. By comparing the decrypted images in the experiment with the corresponding original images, the result shows that all the pixels are the same.

Key Space.
In order to resist brute attacks effectively, the key space should be large enough. e initial key values of our proposed method are l 1 , l 2 , l 3 and l 4 , and l 5 , and the calculation accuracy is about 10 − 14 , so our key space is 10 70 , which is far larger than 2 100 . at means we can effectively resist brute attacks [21].

Key Sensitivity.
A secure encryption scheme has a very high sensitivity to the key. Even if the encryption key has a tiny change, the encryption/decryption result should be completely different. In our test, we add 0.1234 × 10 − 14 to the key ′ 1 sl 1 in Table 3, and keep the rest of the key 1 unchanged to get key 2 . Encrypt the Peppers.pgm with key 1 and key 2 , respectively. e encryption results are shown in Figures 11(a) and 11(b). Here, Figure 11(c) shows the difference between Figures 11(a) and 11(b). Key 2 is used as the key to decrypt the encryption graph corresponding to key 1 , and the decryption result is shown in Figure 11(d).
e experimental results show that our method has good key sensitivity in the encryption and decryption processes. 8 Discrete Dynamics in Nature and Society

Differential Attack Analysis.
Differential attack is a very common and effective analysis method in image analysis. It modifies the plaintext image slightly and then encrypts the original plaintext image and the modified plaintext image, respectively. By analyzing the difference between the plaintext image and the encrypted image, attackers try to get the relationship between the plaintext image and the encrypted image. In order to resist differential attack effectively, encryption algorithm should have excellent sensitivity to plaintext image. Generally, we measure it according to NPCR and UACI. NPCR represents the pixel change rate when modifying one pixel, and UACI represents the average intensity of the difference between plaintext image and ciphertext image. For 8-bit grayscale images, the expected values of NPCR and UACI are 99.6094% and 33.4635%, respectively. e formulas are as follows: where C is the encrypted image of the unmodified plaintext image, C ′ is the encrypted image of the modified plaintext image, M is the height of the plaintext image, N is the width of the plaintext image, and C(i, j) is the pixel value at the coordinate (i, j) of the encrypted image C. e keys used by  Discrete Dynamics in Nature and Society our encryption method are obtained by the user key and the SHA256 hash of the plaintext image. e encryption result is highly related to the plaintext, which can resist the differential attack effectively. e experimental results of differential analysis with other methods in the comparative literature are shown in Table 4.

Information Entropy.
Shannon entropy analysis has been widely used to evaluate the uncertainty or unpredictability. e formula is as follows: Here, N is the total number of samples (when the image is with a bit-depth of 8, N is 8), m is the information source, and p(m i ) represents the probability of sample m i . For the image with gray level 8, according to the principle of maximum entropy, the information entropy is closer to 8, and it means that the probability of each pixel is more average. Using the methods in this paper and references [9,15,18] to analyze the information entropy of Baboon, House, Lena, Peppers, and their corresponding encrypted images, the comparative experimental results are shown in Table 5.

Histogram Analysis.
A secure image encryption scheme should be able to ensure that the pixel values of the ciphertext image are evenly distributed and enhance the  resistance to statistical attacks, so as to prevent attackers from obtaining any meaningful data from the ciphertext image. We tested Baboon.pgm, House.pgm, Barche.pgm, Peppers.pgm, and their corresponding ciphertext images with different keys. e histogram of the original images is shown in Figure 12.
In the mathematical quantity analysis of each key, we judge the uniformity by the variance of the histogram of the encrypted image. Generally, if the variance of the encrypted image is lower, the uniformity is better. We encrypt the same image using key 1 and different passwords obtained by changing only one parameter in key 1 at a time and then calculate the variance of each encrypted image. In the case of different keys, the closer the two variance values the higher the uniformity. And, the results are shown in Table 6. As can be seen from Table 6, the average variance is about 950 when using key 1 , which is smaller than 1017 in reference [15]. e variance of the histogram is defined as follows: where C is the vector of histogram values and C � C 1 , C 2 , . . . , C 256 and C i and C j represent the number of pixel value equal to i and j, respectively. By calculating the differences of variance between key 1 and the secret key obtained by changing only one parameter in key 1 , we can measure the uniformity of each parameter in secret keys. e result is shown in Table 7. As can be seen from Table 7, the differences of all variances are around 100, so each parameter in the secret key has good uniformity.
rough the above analysis, it can be seen that the pixel values of the encrypted image obtained by this encryption method are evenly distributed and can effectively resist statistical attacks.

Correlation Analysis.
Because of the high correlation of adjacent pixels in the image, in order to resist the statistical attack, the correlation between adjacent pixels should be reduced as much as possible. e correlation coefficient is used to describe the degree of correlation between pixels. e smaller the correlation coefficient is, the lower the correlation between adjacent pixels is. e calculation method is as follows: where x and y are grey-level values of the two adjacent pixels in the image, and the expectation and variance of x are Five-thousand pairs of adjacent pixels are randomly selected from the horizontal direction, vertical direction, and diagonal direction of the original image and the encrypted image, and the correlation coefficient is calculated. e experimental results are shown in Table 8 and Figure 13. Compared with other recently proposed methods, the results are shown in Table 9. It can be seen that the correlation between adjacent pixels of plaintext image is very strong, but the correlation coefficient of encrypted image is close to 0, which proves that the correlation between adjacent pixels is very low.

Resistance to Cropping Attacks.
Because some information loss may occur when data are transmitted in the channel, a good encryption algorithm should recover data as much as possible in the case of information loss. It can be measured by MSE and NSPR, which are defined as follows: PSNR � 10 log 10 255 2 MSE dB, where M and N are the height and width of image P, respectively, P (x, y) represents the pixel value of the original image at coordinates (x, y), and D is the decrypted image of P after losing some data. By testing, we can see that the cipher images can be decrypted with some data loss, which means that proposed algorithm has a good robustness as for data loss. e experimental results are shown in Figure 14 and Table 10.

Resistance to Noise Attacks.
When image data are transmitted in the channel, it may be affected by noise, and the most common ones are Gaussian noise and salt and pepper noise. A good encryption system should be able to recover the encrypted image affected by noise to the maximum extent. By simulating different intensities of Gaussian noise and salt and pepper noise, the corresponding decrypted image is obtained. e experimental results are shown in Figure 15. From testing results, we can see that the cipher images can be decrypted with some noise.

Resistance to Plaintext
Attacks. e classical attack types include ciphertext only, known plaintext, chosen plaintext, and chosen ciphertext, and chosen plaintext is the most powerful attack. e proposed algorithm is sensitive to the initial parameters and values. Moreover, the encryption result of every byte is influenced by the contents of the previous bytes. In general, if the white and black plaintext images can be encrypted, and its histogram with random distribution can effectively resist plaintext attack and selective plaintext attack. e experimental results are shown in Figure 16, and the NPCR and UACI results of the encrypted image are shown in Table 11. It can be seen that the pixels of the encrypted image obey the random distribution.

Conclusions
In this paper, we improve the 2D-LSCM and Henon mapping to make the data more uniform and have larger Lyapunov exponents and then propose our image encryption algorithm. In this algorithm, the SHA256 hash value of plaintext image is used to get the initial values and parameters of N2D-LSCM and NHenon. In the scrambling process, two pseudorandom sequences are generated by N2D-LSCM. ese two chaotic sequences are used as scrambling sequences and scrambling DNA coding matrix respectively. Firstly, scrambling sequence is used to scrambling plaintext image at pixel level, and then scrambling results are encoded according to scrambling DNA coding matrix. In addition, in the diffusion stage, firstly, the sequence values generated by N2D-LSCM are taken as the parameters of NHenon, and then two chaotic sequences are obtained by iterating the NHenon mapping, one is as the key matrix, and the other is as the corresponding DNA coding rule matrix. e chaotic key matrix is encoded by the DNA coding matrix. Finally, the permuted DNA matrix and random DNA matrix performed DNA exclusive OR operation to complete image encryption. e simulation shows that this encryption method has good security and can effectively resist many common attacks, such as statistical attack, violent attack, select/known plaintext attack, cropping attack, and noise attack. e scrambling method proposed in this paper is not efficient enough in operation. In the next step, we will improve the scrambling efficiency in this algorithm and develop an encryption algorithm suitable for color image.

Data Availability
e data used to support the findings of this study are included within the article.