A Novel Color Image Encryption Algorithm Based on 5-D Hyperchaotic System and DNA Sequence

Nowadays, it is increasingly necessary to improve the encryption and secure transmission performance of images. Therefore, in this paper, a bit-level permutation algorithm based on hyper chaos is proposed, with a newly constructed 5-D hyperchaotic system combined with DNA sequence encryption to achieve bit-wide permutation of plaintexts. The proposed 5-D hyperchaotic system has good chaotic dynamics, combining hyperchaotic sequence with bit-level permutation to enhance the pseudo-randomness of the plaintext image. We adopt a scheme of decomposing the plaintext color image into three matrices of R, G, and B, and performing block operations on them. The block matrix was DNA encoded, operated, and decoded. The DNA operation was also determined by the hyperchaotic sequence, and finally generated a ciphertext image. The result of the various security analyses prove that the ciphertext images generated by the algorithm have good distribution characteristics, which can not only resist differential attacks, but also have the advantages of large cryptographic space.


Introduction
With the rapid development of the digital economy, the application of the Internet is becoming more and more widespread, which is making people's lives change radically. Work and study are no longer confined to books, and there is a growing trend toward mobile portable devices. In today's world of huge amounts of data, the field of application of digital images as a vehicle for information dissemination is constantly being expanded, and images have the natural advantage of being informative and easy to transmit. Therefore, the security of digital images has become a key to image processing technology [1,2]. The security of images can affect both national security and personal life. In the past, there was a basis for digital watermarking technology [3][4][5][6]. Thus, due to the initial value sensitivity and randomness of chaotic systems, many scholars have applied them to image encryption.
In recent years, the commonly used encryption algorithms are mainly AES and DES algorithms, which can be applied to image encryption technology in theory, but for digital images with large data volume, high redundancy and high correlation, the encryption efficiency using AES and DES is low. However, image encryption algorithms based on chaotic systems are easy to implement in both software and hardware, which makes chaotic image encryption increasingly researched and widely used by scholars. In 2016, Ref. [7] proposed a new one-dimensional discrete chaotic system, co-controlled it with a logistic map for the encryption algorithm, and used both chaotic systems to jointly construct an S-box for permutation and diffusion. Later, Cavusoglu et al. [8] took a 3-D chaotic system to create S-Box for image encryption. In 2019, Ref. [9] proposed a dual image encryption algorithm based on a spatio-temporal chaotic system, and the results showed good security. Subsequently, Alawida et al. [10] took an image encryption algorithm based on hybrid chaos and chaotic perturbation of pixels, which allows for a larger parameter range and optimal chaotic behavior by coupling two one-dimensional discrete chaotic systems. Recently, which only changes the pixel position, while bit-level permutation can change both position and size. In this paper, by designing a new bit-level permutation method, and reordering and diffusing pixel values, we show through our results that our proposed method has a good performance advantage.
DNA coding is used for image encryption by many scholars studying image encryption due to its biological self-encryption properties. Research has shown that DNA computing can simulate DNA biological operations to encrypt information, thus improving the security and efficiency of image encryption algorithms. At present, scholars have combined DNA coding and chaotic systems to propose some new image encryption algorithms. Thus, ref. [22] proposed a rule matrix for DNA encoding and decoding with 2D-LASM, where the images are encoded according to the generated DNA encoding rules, the plaintext DNA matrix is rank-swapped, and the final plaintext matrix is obtained by heterodyning the DNA matrix with a key matrix. In addition, ref. [18] combined Arnold mapping with DNA coding, that is, coding the R, G and B components separately, and finally performing DNA operations on the matrix generated by Arnold mapping and shifting it through the Mandelbrot dataset. In this paper, by dividing the pixel matrix into blocks, the block-based matrix performs DNA operations. The randomness of the encryption algorithm is further improved.

Related Work
Recent studies have shown that traditional chaotic mapping suffers from the phenomenon of cycles [23,24], i.e., an encryption algorithm that uses an Arnold chaotic mapping will revert to a plaintext image after repeated iterations, which reduces the security of the encryption algorithms. In this paper, an image encryption algorithm based on a hyperchaotic system is proposed. The ciphertext can be disrupted and diffused at the same time by bit-level permutation, and the DNA encoding, decoding and operation are performed on the R, G, B surfaces after permutation and diffusion. The initial value of the hyperchaotic system is determined by the information in the plaintext image, while the DNA encoding and decoding is determined by the hyperchaotic sequence. The chaotic matrix is generated by a one-dimensional discrete chaotic system, which performs a DNA operation with the ciphertext matrix; the result of the calculation is then subjected to rank index permutation. From the above operations, the final ciphertext image is obtained. The algorithm security verification results prove that the proposed algorithm in this paper has a uniform pixel distribution, low pixel correlation, high security and can effectively resist a range of attacks.
The rest of this paper is arranged as follows: In Section 3, a new 5-D hyperchaotic system and the corresponding bit-level dislocation rules are proposed; and the dynamics of the hyperchaotic system will be presented. Furthermore, hyperchaotic systems are designed as specific circuits to meet practical requirements. The specific steps of the encryption algorithm in this paper will be discussed in Section 4. Then, in Section 5, the experimental results are given and the security of the encryption algorithm is analyzed. Finally, this paper is concluded in Section 6.

A New 5-D Hyperchaotic System
Hyperchaotic systems have been the focus of attention since they were first proposed [25]. Hyperchaotic systems have more complex dynamic characteristics than chaotic systems, and hyperchaotic systems have more control parameters. In this paper, a new 5-D hyperchaotic system is proposed, and the mathematics expression is defined as where x, y, z, w, u are the state variables of the hyperchaotic system, and a, b, c, d, a 1 , b 1 , c 1 , d 1 , h, j, k are the control parameters of the hyperchaotic system. When a = 23.8, b = 14.2, c = 0.35, d = 0.2, a 1 = 30.9, b 1 = −4.39, c 1 = 1.07, d 1 = −1, h = −0.38, j = −10.6, k = 1, the system behaves in a hyperchaotic state. After introducing each of the above parameters into the hyperchaotic system, the motion characteristics of chaos can be directly observed in the phase diagram, and the phase diagram of the hyperchaotic system is represented in Figure 1. The Lyapunov exponent and the bifurcation diagram are analyzed to determine whether the chaotic system has the important characteristics contained in the chaotic behavior. Likewise, the above parameters are brought into the system and the initial values are chosen as [2, 1, 25, 1, 1]. Figure 2 shows the evolution curves of the five Lyapunov The Lyapunov exponent has two positive numbers, one 0, and two negative numbers. Therefore, the proposed chaotic system is a hyperchaotic system. The transition of a system from regularity to irregularity is characterized by the bifurcation diagram of a chaotic system. By keeping the remaining control parameters constant and choosing the value of k as The complexity of a chaotic system refers to the degree to which a chaotic sequence is close to a random sequence by using a correlation algorithm. The larger the complexity value, the closer the sequence is to a random sequence. In this paper, the Spectral Entropy (SE) is used to test the discrete chaotic sequence, and the result is shown in Figure 4. It can be seen from the figure that the complexity value of the chaotic sequence is very large, and the complexity of the chaotic system is very high. The Lyapunov exponent has two positive numbers, one 0, and two negative numbers. Therefore, the proposed chaotic system is a hyperchaotic system. The transition of a system from regularity to irregularity is characterized by the bifurcation diagram of a chaotic system. By keeping the remaining control parameters constant and choosing the value of k as [0, 4), the bifurcation diagram of the hyperchaotic system is shown in Figure 3. The complexity of a chaotic system refers to the degree to which a chaotic sequence is close to a random sequence by using a correlation algorithm. The larger the complexity value, the closer the sequence is to a random sequence. In this paper, the Spectral Entropy (SE) is used to test the discrete chaotic sequence, and the result is shown in Figure 4. It can be seen from the figure that the complexity value of the chaotic sequence is very large, and the complexity of the chaotic system is very high.

Dissipativity of the Chaotic System
The dissipativity of the hyperchaotic system is calculated as Hence, based on Equation (2), the hyperchaotic system proposed by this paper is a dissipative system which converges at an exponential rate e −21.41t . For the volume element, V 0 converges to V 0 e −21.41t at time t, and as t → ∞ , V 0 → 0 . Since the phase point trajectory curves of the system will all be confined to a set whose volume is 0, the designed hyperchaotic system in this paper with singular attractors is effectively confirmed.

Equilibrium Point Analysis of the Chaotic System
The mathematical formula for the equilibrium points of the hyperchaotic system can be described as According to Equation (3), the unique equilibrium point O (0.0141, 0, 0, 0, 0.4067) of the hyperchaotic system can be obtained. Thus, the Jacobi matrix is expressed as The eigenvalues of the matrix are 23.7325, 0.0191, −1, −10.6 and−33.5616. When one of the real parts of all the eigenvalues of the Jacobi matrix is positive, this corresponds to an unstable equilibrium state. It follows that the system has two eigenvalues greater than 0. Therefore, the point O is an unstable point where chaotic attractors can be formed.

A Simple Chaotic Pseudo-Random Number Generator
Most chaotic sequence quantization methods are mainly composed of basic operations such as modulo, rounding, and expansion. While these methods improve the randomness of chaotic sequences, they also have the disadvantage of a large amount of computation. Therefore, in this paper, we proposed a quantization method with XOR transformation, which is not only simple to operate, but also enhances the randomness of chaotic sequences. Notably, the chaotic pseudo-random sequence is denoted as x n , and this quantization method is introduced as where d(i) is the latter term minus the former term in the chaotic sequence. The result of s 1 (i) depends on the value of d(i). The result of s 2 (i) is obtained by modulo and rounding operations on x n , XOR s 1 (i) and s 2 (i) to get s(i). s(i) is the quantized chaotic sequence. Based on the above operation steps, the quantized results s(i) were run through version 2.1.2 of the NIST SP-800-22 test [26]. The experiment results are listed in Table 1. The results have shown that the chaotic sequences quantized by XOR have excellent pseudorandom performance.

Cosine-Transform-Based Chaotic System
The digitization of a chaotic system will lead to the degradation of dynamic characteristics [27], in order to get the chaotic map to have more complex dynamic behavior. Based on cosine transform, Hua et al. [28] proposed a chaotic system which can produce complex dynamic behavior with the purpose of effectively resisting the dynamic degradation under the influence of limited accuracy. The mathematical expression of the chaotic map is described as Figure 5 shows the bifurcation diagrams of the cosine and logistic maps with varying parameter r. From the bifurcation diagram, it is obvious that the dynamic behavior of the cosine chaotic map is more complex.

Chaotic Circuit Simulation
In this paper, we use the general idea of modular circuit design and the specific chaotic circuit is shown in the Appendix A. The input and output voltages were put in the range of ±10 to ±50 V, which exactly corresponds to the range of values for each state variable. The time domain waveforms and phase diagrams of the chaotic system were obtained through Multisim hardware circuit simulation, and the results were consistent with the numerical simulation results of MATLAB, which established that the chaotic circuit designed and the simulation of Multisim software are fully practicable. The attractor plots from the Multisim simulation can be found in Figure 6. The purpose of the circuit simulation is to provide the basis for the subsequent hardware implementation.

Bit-Level Permutation
This paper used a combination of bit-level permutation and chaotic sequences. While the randomness is further improved, it can also achieve the purpose of diffusion. First, the size of the image is M × N, the chaotic sequence a is sorted with a size of 1 × 4 MN in ascending order, and the index vector b is generated by sorting. Next, the first to fourth columns of the high 4 bit-plane are joined into a 1 × 4 MN one-dimensional 0-1 vector, which is denoted as vector c, and this is rearranged according to the index position of the vector b. The aligned one-dimensional vector thus generated is denoted as vector d. Finally, the vector d is rearranged into an MN × 4 two-dimensional matrix. The whole process can be described in Figure 7. Since the chaotic sequences are determined by the plaintexts, the plaintext relevance of the algorithm is greatly enhanced. Correspondingly, choosing a different plaintext means the scrambling position will also be different. Therefore, three different chaotic sequences will be used for the R, G and B bits of the image. Accordingly, the randomness and security of this algorithm will be greatly enhanced by the combination of bit-level permutation and chaotic sequences.

DNA Coding
DNA in biology consists of base pairs. Base pairs are made up of A (adenine), T (thymine), G (guanine), and C (cytosine). Accordingly, DNA coding is borrowed from DNA in biology, where DNA coding encodes binary 00, 11, 10 and 01 as the corresponding base pairs A, T, G and C. According to Watson-Crick's rule of complementarity, out of 4! = 24 codes, only 8 codes fit the rule. The coding rules are shown in Table 2.
When an encryption algorithm takes one of the encoding rules to encode while another decoding rule is taken, it will effectively encrypt the pixel values. DNA can be encoded and then subjected to DNA operations, which include addition, subtraction, XOR and XNOR operations. For example, we adopted rule 1 from the table to encode the pixel value 228, while obtaining a DNA sequence with a value of TGCA, respectively, and then, decoded it with rule 4 to obtain a pixel value of 27. The whole process proved to be effective in protecting the plaintext. Tables 3-5 list the specific rules of the above DNA operations. Table 3. DNA addition rules.  Table 5. DNA XOR rules.

Color Image Encryption Algorithm
The process of the encryption algorithm proposed in this paper can be illustrated in Figure 8. In order to explain the encryption algorithm proposed in this paper, we use a color image of size M × N as a plaintext image to demonstrate the flow of the encryption algorithm. Correspondingly, the decryption algorithm is the inverse of the encryption algorithm. The process of encryption algorithm is as follows: Step 1. First, decompose the color image into three planes, R, G, and B, which are represented as red, green, and blue, which correspond to the constituent elements of a color image. As shown in Equation (6), the three decomposed matrices are called Y 1 , Y 2 , Y 3 .
Step 2. Next, in order to increase the adaptability of the encryption algorithm, it needs to be filled with 0 before the block so that the three matrices can be divided into blocks of the same size; therefore, the size of the matrix must satisfy the following conditions: where t is the size of the block, 0 makes both M and N divisible by t, and the matrices Y 1 , Y 2 , Y 3 can be decomposed into t × t sized blocks.
Step 3. Then, the M × N decimal matrices Y 1 , Y 2 , Y 3 are transformed into binary 8 × MN matrices, and the upper 4-bit plane 4 × MN matrix is rearranged using bit level permutation. Equally, the lower 4-bit planes are combined from top to bottom for oddnumbered columns, and from bottom to top for even-numbered columns. The scrambled matrices are re-reduced to M × N decimal matrices, P 1 , P 2 , P 3 .
Step 4. The cosine map function is iterated M × N + 3000 times, discarding the first 3000 times to obtain better randomness. In order to avoid the degradation of the chaotic sequence with finite accuracy, a small perturbation of the initial value is performed every 3000 iterations, the initial value after the perturbation is where {S i } is the generated chaotic sequence, whereas the initial values x 0 and r are denoted as one of the keys. Furthermore, the chaotic sequence {S i } is transformed into a decimal number from 0-255, which can be converted into an M × N matrix P 4 , and we take the Reshape function, in which the x 0 can be expressed as According to Equation (9), we can obtain the result that x 0 is the average of the pixel greyscale of Y 1 , Y 2 , Y 3 .
Step 5. Iterate the five-dimensional hyperchaotic system, the initial value of the system is selected by Equation (10), and the five chaotic (P 1 , 129)))/(129 × M × N) Y(0) = sum(sum(bitand(P 2 , 66)))/(66 × M × N) Z(0) = sum(sum(bitand(P 3 , 36)))/(36 × M × N) W(0) = sum(sum(bitand(P 1 , 24)))/(24 × M × N) U(0) = sum(sum(bitand(P 2 , 17)))/(17 × M × N) (10) where five chaotic sequences {X i }, {Y i }, {Z i }, {W i }, {U i } are done AND operation of 129, and the average of the first and eighth planes of P 1 can be obtained. Thus, we convert {X i } into a random integer from 1 to 8 to determine the DNA encoding rules for the sub-blocks in the same position of P 1 , P 2 , P 3 . Similarly, transforming {Y i } into a random integer from 1 to 8 determines the coding rules for P 4 ; and transforming {Z i } into random integers from 1 to 4 will determine the DNA operation rules for P 1 , P 2 , P 3 and P 4 . In addition, the DNA decoding rules that are determined as above after the DNA manipulation are converted to random integers {W i } from 1 to 8, and alongside {U i } are used to form the index matrix required for bit-level scrambling.
Step 6. Divide P 1 ,P 2 , and P 3 into blocks, and the size of each sub-block is t × t. In order to improve the efficiency of the encryption algorithm, the same position sub-blocks of P 1 , P 2 and P 3 are used for the same DNA encoding method, DNA operation and DNA decoding. The end of the operation is transformed into a decimal matrix.
Step 7. The cosine map function is adopted to generate two chaotic sequences {S x } and S y with sizes M and N. The selection of the initial value is determined by Equation (11), and the index matrix is obtained by descending order, taking U x , U y sequence values and their corresponding indices as row and column exchange coordinates, and Equation (12) is used to perform row and column permutation to improve the cropping resistance of the image.

Encryption and Decryption Results
In order to verify the effectiveness of the algorithm, we conducted experiments on Lena, Baboon and Pepper of size 512 × 512 under a Windows 10 environment using MATLAB 2018b. The experimental results are shown in Figure 9, from which it can be established that the original image and the decrypted image have no distortion or data loss, while the cipher image has lost all features of the plaintext image: thus, the experimental results prove that the algorithm has better security.

Keyspace Analysis
The ability of an encryption algorithm to resist exhaustive attacks is reflected by the size of the key space. That is to say, if the key space is larger than 2 128 , this means that it is better resistant to exhaustive attacks. The key in the encryption process of this paper includes the control and initial values of the cosine map, as well as the initial values of the 5-D hyperchaotic system. Therefore, when computational precision is 32, the key space is roughly equal to 2 13×32 . According to the result above, the key space of the algorithm proposed in this paper is large enough to resist exhaustive attack.

Key Sensitivity Analysis
Key sensitivity is an important feature in evaluating the quality of an encryption algorithm, and a small change in key can produce extremely strong sensitivity. We changed the initial value x 0 of the cosine map from 0.5012 to 0.5012000000000001, and obtained the encrypted image shown in the Figure 10, which is proof that even with small changes, the encrypted image is completely different.

Correlation Analysis
As there is a correlation between pixels in the plaintext image, the encryption algorithm is used to reduce the correlation and the encrypted correlation should ideally be 0. The equations to calculate the correlation are given as Cov(x, y) Similarly, the detailed data for calculating the correlations for this algorithm are shown in Table 6. The correlation between the plaintext and ciphertext in each direction is represented separately in Figure 11. In conclusion, the encrypted pixel point correlation is low and the encryption algorithm proposed in this paper shows a high level of security to protect against statistical analysis of the ciphertext information by attackers.

Statistical Characterization
The histogram defines the gray level frequency of the image, and the RGB image histograms of plaintext and ciphertext are shown in Figure 12, which clearly shows the average amount of data in the ciphertext, indicating that the encrypted image masks all the original information. The grey level frequency of the image is defined by the histogram. The RGB image histogram for both plaintext and ciphertext is shown in Figure 11, which clearly shows the average amount of data in the ciphertext and indicates that the encrypted image masks all the original information.
The histogram defines the gray level frequency of the image, and the RGB image histograms of plaintext and ciphertext are shown in Figure 12, which clearly shows the average amount of data in the ciphertext, indicating that the encrypted image masks all the original information. The grey level frequency of the image is defined by the histogram. The RGB image histogram for both plaintext and ciphertext is shown in Figure 11, which clearly shows the average amount of data in the ciphertext and indicates that the encrypted image masks all the original information.

Information Entropy
The uncertainty of the image information can be expressed by the information entropy of the image, which is calculated as where the image gray level is denoted as L, and the probability of occurrence of gray value is denoted as p(i). In addition, the ideal value of H is 8. Lena 256 was evenly selected for the information entropy measure. The comparison of the information entropy of this algorithm with other cryptographic algorithms is shown in Table 7. The ciphertext image information entropy of this algorithm is close to the ideal value, with high uncertainty and little visible information. Based on the above results, the algorithm proposed in this paper is proved to be highly secure.

Noise Attack
During image acquisition and transmission, the encrypted image will certainly be affected by some noise. Hence, the ability to resist certain noise interference is a measure of the cryptographic algorithm's performance. In this paper, pepper noise of strength 0.05 and 0.1 is added to the encrypted image and decrypted with the correct key. The results are shown by Figure 13, which proved that the algorithm can still largely recover the plaintext image even though a certain amount of noise interference is added, which indicates that the algorithm is highly resistant to interference.

Anti-Crop Analysis of Ciphertext Images
Attackers can intercept and corrupt parts of the data in the ciphertext image during image transmission, and in general, the information will be very difficult to recover after loss. Corrupting the inter-pixel correlation can greatly improve the cropping resistance of the algorithm. In this paper, different levels of cropping attacks are applied to different locations of the ciphertext image, and the test results are shown in Figure 14, which confirming that the algorithm can still have some ability to recover the plaintext under cropping attacks, thus demonstrating the strong robustness of the algorithm.

Differential Attack
In our next step, we perform a differential attack on the encryption algorithm by making small changes to the plaintext, and the difference between the cipher text before and after the changes could obtained. The encryption algorithm is sensitive to changes in the plaintext, that is to say, a small change in the plaintext will cause a large change in the ciphertext. NPCR (Number of Pixel Change Rate) and UACI (Uniform Average Change Intensity) are used to encrypt images to measure the variation in the degree of difference between encrypted images. The ideal value for NPCR is 99.6094%; similarly, the ideal value for UACI is 33.4635%, which is calculated as where the relationship between P 1 (i, j) and P 2 (i, j) is Tables 8 and 9 list the various comparisons between the encryption algorithm proposed in this paper and those introduced in other papers. Based on Table 9, it is shown that the NPCR and UACI of the encryption algorithm proposed in this paper are closer to the ideal values than many other encryption algorithms, and that the proposed algorithm can effectively resist the anti-contrast attack.  Table 9. Comparison of NPCR and UACI.

Discussion
In this paper, a new 5-D hyperchaotic system is proposed, which has not only a large Lyapunov exponent but also other good properties. The larger the Lyapunov exponent, the faster the divergence of adjacent trajectories of the system; and this is the source of the sensitive dependence of chaos on initial conditions. In addition, a combination of bit-level permutation and DNA sequences were used to encrypt the color images. The plaintext color image is decomposed into three matrices, R, G and B, and a chunking operation is performed on these matrices, followed by DNA encoding, computation, and decoding. Simultaneously, the DNA operations are based on hyperchaotic sequences. The generated cryptographic images have been tested in various security tests and the experimental results have proved the excellent performance of the algorithm proposed in this paper. Finally, circuit simulations of chaos are performed, which provide the basis for future practical applications of color image encryption algorithms.
Author Contributions: X.L.: methodology, software, validation, and writing original draft preparation. J.Z.: software and validation. X.L. and Q.D. performed the evaluation methods of the security analysis. Project administration and supervision were done by C.F. All authors have read and agreed to the published version of the manuscript.

Conflicts of Interest:
The authors declare no conflict of interest.