An image encryption algorithm is proposed based on the combination of genetic (DNA) random coding and chaotic mapping. An image encryption algorithm based on an improved new four-dimensional chaotic system and DNA coding is proposed to address the problem that a single coding method is prone to selecting plaintext attacks. Based on a four-dimensional chaotic system existing in the literature, a new four-dimensional hyperchaotic system is obtained through improvement. The initial value of the system is generated based on SHA-256, zigzag transform. The input key and four pseudo-random chaotic sequences are generated iteratively. DNA chunking encoding, arithmetic operation, and decoding are implemented for the image disrupted based on the zigzag transform. The two-dimensional matrix constituted based on the Chaotic Sequence of Chebyshev to obtain the scrambled and diffused ciphertext image. Simulation experiments and security performance analysis show that the algorithm enhances the correlation between the key and the plaintext, the randomness of the encryption process, and effectively improves the anti-attack capability [H. Chen, J. Zhao *et al.*, Appl. Res. Comput. **10**, 0434 (2021)]. In this paper, 512 × 512 × 3 peppers color images are used for testing, and the correlation coefficients of adjacent pixels of the encrypted images are all close to 0, and the information entropy is all more significant than 7.997, which is relative to the theoretical value of 8. The experimental results show that the proposed algorithm improves the security of the ciphertext, increases the critical space, and, at the same time, resists various attack methods.

## I. INTRODUCTION

Digital images are widely used in natural and social sciences as an essential carrier of information dissemination. The security of digital images has become the focus of people’s attention because they may be intercepted in the dissemination process, and image encryption technology can ensure the safe storage and transmission of images. Chaotic systems are characterized by unpredictability, pseudo-randomness, and sensitivity of the initial values, where slight differences in the initial values produce significant differences after iterations. As a result, many digital image encryption algorithms based on chaotic systems have been born.^{1} Reference 2 proposes a messy encryption method based on image segmentation and a multi-diffusion model with good security properties. In the chaotic image encryption algorithm presented in Ref. 3, combining chunking disruption and dynamic index diffusion has the advantage of being fast and secure. Reference 4 gives an image encryption algorithm based on a fractional-order unified chaotic system with high security and low time complexity benefits.

Gene computing has the advantages of larger storage capacity, lower power consumption, and higher information density, thus providing a new research direction for digital image encryption. Reference 5 gives a chaotic image encryption algorithm instead of DNA encoding, but only with simple DNA encoding rules. Reference 6 has long pointed out that it is challenging to resist selective plaintext attacks using a fixed DNA encoding method. The algorithms proposed in Ref. 7 solve this problem using a dynamic DNA encoding scheme. However, their encryption process is independent of the plaintext, and the algorithms are susceptible to known-plaintext and chosen-plaintext attacks. This paper proposes a color image encryption method using the DNA random coding method and combining the improved new four-dimensional chaotic system and Chebyshev roots function to generate cipher images with better resistance to attacks.

## II. BASIC THEORY

### A. Improved new four-dimensional chaotic systems

^{9}

In this equation, x, y, z, and w are chaotic sequence values; a, b, and c are chaotic control parameters. In contrast to the original three parameters, this new four-dimensional chaotic system has only four parameters, and each of them is independent and unrelated to each other. The added parameters also make this system more complex; the 3-D phase diagram and the 2-D phase diagram of this new four-dimensional chaotic system for a = 5, b = 50, and c = 6 are represented in Fig. 2,^{10} respectively.

A distinctive feature of chaotic systems is that they are susceptible to initial conditions and parameters. This is where the trajectories of two neighboring primaries split exponentially during iteration, resulting in an unpredictable state (future state) after a long run. The Lyapunov exponent is a statistical method that can characterize the sensitivity of chaotic systems to initial values quantitatively. Figure 3 shows the Lyapunov exponent diagrams of the four-dimensional chaotic system before and after the improvement with the number of iterations. Figure 3 shows that the four-dimensional chaotic system back and after the progress of the four-dimensional chaotic system's equation tends to stabilize when the number of iterations reaches 8000.^{11} After stabilization, the system before the progress of the four-dimensional chaotic system has only one value of Lyapunov exponent greater than 0. In contrast, after the improvement of the system, there are two values of the Lyapunov exponent greater than 0. The values are much bigger than that of the four-dimensional chaotic system before the improvement of the system, which indicates that the four-dimensional chaotic system after the progress of the four-dimensional chaotic system not only enters into the state of hyperchaos but also has more complex chaotic motions.

### B. Chebyshev roots chaotic sequence

When *k* ≥ 2 (*k* is the order, here *k* = 4), sequences of variables do not match no matter how close the initial values are, i.e., they are chaotic and ergodic in that range. The Chebyshev chaotic mapping bifurcation diagram is shown in Fig. 4,^{12} from which it can be seen that it presents a chaotic state within [−1, 1]. The Chebyshev roots chaotic sequence is a randomized sequence generated by iterating the Chebyshev chaotic mapping over a specified range for a limited number of times. Then, the sort function is selected to compare the sequence to sort the output.^{13}

### C. Zigzag transform

### D. DNA coding

There are four bases in the DNA sequence: A (adenine), C (cytosine), G (guanine), and T (thymine), where A and T are complementary and C and G are complementary. Similarly, the binary numbers 00 and 11 are complementary, and 01 and 10 are complementary. If A, C, G, and T are replaced by 00, 01, 10, and 11,^{15} respectively. Then, there are 24 corresponding coding rules although only eight satisfy the complementarity condition, as detailed in Table I.

. | 1 . | 2 . | 3 . | 4 . | 5 . | 6 . | 7 . | 8 . |
---|---|---|---|---|---|---|---|---|

A | 00 | 00 | 01 | 01 | 10 | 10 | 11 | 11 |

T | 11 | 11 | 10 | 10 | 01 | 01 | 00 | 00 |

G | 01 | 10 | 00 | 11 | 00 | 11 | 01 | 10 |

C | 10 | 01 | 11 | 00 | 11 | 00 | 10 | 01 |

. | 1 . | 2 . | 3 . | 4 . | 5 . | 6 . | 7 . | 8 . |
---|---|---|---|---|---|---|---|---|

A | 00 | 00 | 01 | 01 | 10 | 10 | 11 | 11 |

T | 11 | 11 | 10 | 10 | 01 | 01 | 00 | 00 |

G | 01 | 10 | 00 | 11 | 00 | 11 | 01 | 10 |

C | 10 | 01 | 11 | 00 | 11 | 00 | 10 | 01 |

For example, to encode an image pixel with a value of 156, first, we convert the pixel into binary “10011100,” then encode the pixel 156 according to the first encoding rule in Table I, encode the pixel 156 as “CGTA,” and then decode the pixel according to the same encoding rule. Then, the original appearance can be restored. This pixel 156 was coded as “ATCG” using the fifth coding rule and can still be recovered using the same direction. If the third password is used, the resulting binary value is “01101100,” completely different from the initial value. Therefore, the encoding result is different for the same pixel with varying rules of encoding. If other decoding methods are used for decoding, the original decoding result cannot be restored. This property of DNA allows for a greater variety of DNA coding options and makes it more secure when encrypting images.

### E. DNA algorithm

The operations of DNA are addition, subtraction, same, or different. Eight different encoding results can be obtained for the same pixel using different encoding rules. The first coding rule in Table I is used as an example to operate on DNA, and the results of the operations are obtained as given in Tables II–V.

Nucleotide . | A . | G . | C . | T . |
---|---|---|---|---|

A | A | G | C | T |

G | G | C | T | A |

C | C | T | A | G |

T | T | A | G | C |

Nucleotide . | A . | G . | C . | T . |
---|---|---|---|---|

A | A | G | C | T |

G | G | C | T | A |

C | C | T | A | G |

T | T | A | G | C |

Nucleotide . | A . | G . | C . | T . |
---|---|---|---|---|

A | A | T | C | G |

G | G | A | T | C |

C | C | G | A | T |

T | T | C | G | A |

Nucleotide . | A . | G . | C . | T . |
---|---|---|---|---|

A | A | T | C | G |

G | G | A | T | C |

C | C | G | A | T |

T | T | C | G | A |

Nucleotide . | A . | G . | C . | T . |
---|---|---|---|---|

A | A | G | C | T |

G | G | A | T | C |

C | C | T | A | G |

T | T | C | G | A |

Nucleotide . | A . | G . | C . | T . |
---|---|---|---|---|

A | A | G | C | T |

G | G | A | T | C |

C | C | T | A | G |

T | T | C | G | A |

Nucleotide . | A . | G . | C . | T . |
---|---|---|---|---|

A | T | C | G | A |

G | C | T | A | G |

C | G | A | T | C |

T | A | G | C | A |

Nucleotide . | A . | G . | C . | T . |
---|---|---|---|---|

A | T | C | G | A |

G | C | T | A | G |

C | G | A | T | C |

T | A | G | C | A |

The above table shows that the image can be decrypted if one of the encoding rules is selected and the DNA operation is performed. At the same time, in the encryption process, the results obtained are not the same due to the difference between the arithmetic and the encoding rules, thus improving the security of the encryption algorithm. A standard encryption procedure first encodes an image's pixel values, and then, add, subtract, homogeneous, and heterogeneous operations are performed on the DNA to obtain a ciphertext image. In decoding, the computational rules of DNA are manipulated in reverse, e.g., by converting DNA addition into DNA subtraction.^{16} Finally, according to the encoding rules, binary is converted to decimal to decrypt and obtain the initial image.^{17}

### F. Hash function

The U.S. National Security Agency is one of the SHA algorithms and the successor to SHA-1. SHA-2 can be divided into six algorithmic standards, including SHA-256, SHA-512, and SHA-384. These variants have the same basic structure, except for a few minor differences, such as the length of the generated digest and the number of loops, back to SHA-256, which is a hash function. A hash function, also known as a hash operation, can create a small digital “fingerprint” from any information. Hash functions are used to condense information or data into a summary to reduce the data size and determine the data format. These are known as the characteristics of a hash value. A hash value generally represents a set of letters or numbers with no fixed order. SHA-256 generates a 256-bit hash value called the message digest for a message of any length. A hexadecimal string of length 64 usually represents this message digest.^{18}

## III. IMAGE ENCRYPTION ALGORITHM DESCRIPTION

This paper proposes a new encryption algorithm for the complex problem of choosing a single rule for DNA encoding: dynamic DNA encoding using an improved four-dimensional chaotic system. In this, the random values of the generated sequences are utilized to control the compilation code rules of DNA. After simulation tests, it was found that this algorithm is random in how it compiles the code and has a high level of sophistication. The DNA algorithm is difficult to crack and can withstand many attacks.

### A. Image encryption algorithm framework

In this paper, an image encryption algorithm based on an improved chaotic system and dynamic DNA coding is proposed, and the algorithmic framework of this algorithm is shown in Fig. 6.

### B. Image encryption algorithm

The specific image encryption process looks like this.

Step 1: Generate the image matrix A.

First, an image

*I*is read with dimensions*M*×*N*× 3 and set*t*= 4. Next, the number of rows and columns of the zero-complemented image is changed so that it becomes divisible by*t*. The image*I*is then transformed into a matrix A of*M*×*N*pixels. Then, the pixels of image*I*are converted into an*M*×*N*image matrix A using zigzag transformation.Step 2: Generate matrix B.

Set the Chebyshev mapping chaotic system parameter*μ*= 3.9999, and the initial value of*x*_{0}is found by following steps Eqs. (4)–(6):(4)$x0=sumI:/104,$(5)$x0=x0\u2212floorx0,$(6)$x0=ceil(x0\xd7104).$The processing of Eqs. (4)–(6) allows different images to generate different initial values and to establish a link between the initial value and the plaintext image, thus enabling resistance to selective plaintext attacks. Iterating on this basis, the first 1000 values are eliminated first, and the chaotic sequence with better randomization properties*P*remains. Next, the pseudo-random sequence*P*is converted into integers from 0 to 255 using Eqs. (7)–(9) and converted into the*M*×*N*matrix B,(7)$Q=modfloorP+100\xd71010,10\xd7maxM,N+1,$(8)$Q=Q1:M\xd7N,$(9)$P=modQ,256.$Step 3: Generate the initial values of the improved chaotic system.

The plaintext image is first generated into the respective pixel matrices*I*_{R},*I*_{G}, and*I*_{B}according to the three channels R, G, and B. Then, through the zigzag transformation to disrupt the*I*_{R},*I*_{G}, and*I*_{B}pixel values, after the disruption of the*I*_{R},*I*_{G}, and*I*_{B}back into the matrix*G*_{R},*G*_{G}, and*G*_{B}, the matrix of the rows and columns of each will do the following Eqs. (10)–(13) calculations:(10)$K1=sumsumbitandGR,17/17\xd7SUM,$(11)$K2=sumsumbitandGG,34/34\xd7SUM,$(12)$K3=sumsumbitandGB,68/68\xd7SUM,$(13)$K4=sumsumbitandGR,136/136\xd7SUM.$After that,*x*_{0}is used as the initial value of the SHA256 function, which strengthens the relationship between the plaintext and the key and produces a hexadecimal sequence with a length of 64, which is segmented by every two sizes and which can be expressed as follows:(14)$L=L1,L2,\u2026,L32.$Divide

*L*into four groups of eight numbers, starting with subscript 1.Input*e*_{1},*e*_{2},*e*_{3}, and*e*_{4}, the initial value of the improved new four-dimensional chaotic system is calculated as follows in Eqs. (15)–(18):(15)$X0=e1+K1+L1\u2295\cdots \u2295L8,$(16)$Y0=e2+K2+L9\u2295\cdots \u2295L16,$(17)$Z0=e3+K3+L17\u2295\cdots \u2295L24,$where(18)$W0=e4+K4+L25\u2295\cdots \u2295L32,$*e*_{1},*e*_{2},*e*_{3}, and*e*_{4}are the input keys. The obtained*X*_{0},*Y*_{0},*Z*_{0}, and*W*_{0}are the initial values of the new improved four-dimensional chaotic system.Step 4: Generate a four-segment randomized sequence.

The improved hyperchaotic system is iterated, and the first 1501 terms are eliminated to improve its randomness, resulting in a four-segment random sequence*X*,*Y*,*Z*, and*W*. The four sequences are processed according to Eqs. (19)–(22), and at the end of the processing, each random value in the*X*,*Y*, and*W*sequences is an integer from 1 to 8, and each random value in the*Z*sequence is an integer from 0 to 3. Let the*X*and*Y*series values determine the encoding laws for matrices A and B, respectively. Then, the DNA decoding rules are selected from the importance of the random sequence*W*. Table I lists the eight DNA decoding rules and are denoted by 1–8. The sequence*Z*determines the mode of operation between the DNA matrices; there are four in total, which are recorded as 0–3. Among the modes of operation, 0 can be used to represent the addition of DNA, one can be used to describe the subtraction of DNA, two can be used to represent the heteroscedasticity of DNA, and three can be used to represent the homoscedasticity of DNA,(19)$X=modroundX\xd7104,8+1,$(20)$Y=modroundY\xd7104,8+1,$(21)$Z=modroundZ\xd7104,4,$(22)$W=modroundW\xd7104,8+1.$Step 5: DNA coding.

For matrices A and B, they are encoded in chunks according to the block size set in step 1 such that the number of chips divided is equal to the length of the processed randomized sequence, followed by DNA encoding of each chunk randomly according to the values corresponding to the sequences

*X*sequence and*Y*sequence. That is, each chunk’s coding rules are chosen randomly.Step 6: DNA arithmetic.

Performing DNA operations on the two DNA matrices in chunks based on the random values corresponding to the sequence

*Z*and performing DNA operations on the results of the calculations again with the previous DNA chunks strengthens the linkage between the chunks, i.e., diffusion, which increases the complexity of the cypher and the difficulty of deciphering it.Step 7: DNA decoding.

The DNA decoding of each encoded block matrix is performed based on the value of the sequence W. It involves converting the pixels in the image from binary digits to the importance of ordinary pixels and then combining them into a complete matrix.

Step 8: Generate encrypted image.

The steps from 5 to 7 are looped twice to encrypt the images of the other two channels to obtain the corresponding matrices, and the three-channel matrices are merged to get a final encrypted idea.

### C. Image decryption algorithm

The decryption process of an image is the opposite of the encryption process of an image. Throughout the process, DNA’s encoding and decoding corresponds to DNA’s decoding and encoding in the encryption process, and the selection of encoding rules is consistent with the encryption process. A subtraction operation of DNA replaces the addition operation of DNA, and the subtraction operation of DNA is converted to an addition operation of DNA. The control parameters, initial values, and preprocessing methods for sequences generated by chaotic systems are the same. The steps are as follows.

Step 1: Read the encrypted image and decompose the image into three sub-images according to R, G, and B channels. Then, convert the three images into a pixel matrix. Afterward, the chaotic sequence generated by Chebyshev mapping is converted into

*M*×*N*pixel matrices, and then, all pixel matrices are chunked according to*t*= 4.Step 2: Input the key to obtain the initial value of the improved four-dimensional hyperchaotic system, and input the initial value to iterate the improved four-dimensional hyperchaotic design to get the four chaotic sequences of

*X*,*Y*,*Z*, and*W*.Step 3: Taking the R channel as an example, the matrix after chunking is encoded according to the random value of the sequence

*W*, the chunk matrix R is DNA encoded with the random value of the line*Y*, and an inverse diffusion operation is performed on the chunk matrix according to the arbitrary value corresponding to the sequence*Z*. After that, the initial matrix is obtained by performing a DNA operation with the chunk matrix R, and the chunk pixel matrix is obtained by performing a DNA decoding of the initial matrix according to the random value of the sequence*X*.Step 4: The chunked pixel matrices are combined in sequence, after which the G and B channels are also carried out by step 3 to obtain the respective channel matrices, and the three-channel matrices are combined to obtain the plaintext image.

### D. Experimental results

The simulation was conducted on an Inter(R) Core (TM) i7-7700HQ processor, 2.8 G of RAM, and Win10 operating system. The experimental images used peppers image 512 × 512 × 3, baboon image 512 × 512 × 3, and airplane image 512 × 512 × 3, as shown in Fig. 7. In Fig. 7, the algorithmic encryption and decryption effects of this paper are shown. As can be seen from the ciphertext image (b), the entire encrypted image shows a snowflake-like noise, which masks all the original picture information and makes it completely impossible to recognize the actual knowledge of the image with the naked eye only. As can be seen in image (c), the decrypted image is restored to its original form. This algorithm can be a compelling image encryption algorithm from the encryption results.^{19}

## IV. SECURITY ANALYSIS

To prove the security of this cryptographic algorithm, we take peppers image as an example and analyze the safety of the cryptographic algorithm in detail through performance metrics, such as histogram, information entropy, correlation, sensitivity, and critical space.

### A. Histogram analysis

An image histogram reflects the distribution of pixels in an image. After encrypting the original image, the histogram of its appearance must be almost spatially homogeneous, thus achieving resistance to statistical attacks. Figure 8 shows a histogram of peppers original and cypher images.^{20} As you can see from the image below, the encrypted histogram follows a uniform distribution and becomes flatter to achieve the encryption effect.

### B. Information entropy analysis

Information entropy is often used as a measure of uncertainty in random values. The maximum information entropy value in a 512 × 512 × 3 random image is 8. From Table VI, it can be seen that the information entropy of the present encryption algorithm is more significant as compared to several other encryption algorithms. Therefore, it is more secure from the point of view of information entropy. To further verify the security of the encryption algorithm in this paper, it was tested on more images, and the results obtained are shown in Table VII; all the results are more significant than 7.9992, which indicates that the present encryption algorithm is very secure when analyzed from the point of view of information entropy.^{21}

Arithmetic . | R . | G . | B . |
---|---|---|---|

This article | 7.9993 | 7.9993 | 7.9993 |

Reference 22 | 7.9278 | 7.9744 | 7.9705 |

Reference 23 | 7.9992 | 7.9994 | 7.9993 |

Reference 24 | 7.9993 | 7.9993 | 7.9993 |

. | Original image . | Encrypted images . | ||||
---|---|---|---|---|---|---|

Test pictures . | R . | G . | B . | R . | G . | B . |

Airplane | 7.2682 | 7.5901 | 6.9951 | 7.9993 | 7.9994 | 7.9994 |

Peppers | 7.3388 | 7.4963 | 7.0583 | 7.9994 | 7.9993 | 7.9993 |

Baboon | 7.7067 | 7.4744 | 7.7522 | 7.9993 | 7.9993 | 7.9992 |

. | Original image . | Encrypted images . | ||||
---|---|---|---|---|---|---|

Test pictures . | R . | G . | B . | R . | G . | B . |

Airplane | 7.2682 | 7.5901 | 6.9951 | 7.9993 | 7.9994 | 7.9994 |

Peppers | 7.3388 | 7.4963 | 7.0583 | 7.9994 | 7.9993 | 7.9993 |

Baboon | 7.7067 | 7.4744 | 7.7522 | 7.9993 | 7.9993 | 7.9992 |

### C. Correlation analysis

To analyze the relationship between image pixels, the following adjacent pixels from peppers and cypher images, to calculate the correlation between the pixels of an image, 3000 pairs of adjoining pixel pairs are randomly selected, and the results are shown in Fig. 9.^{22} Also, from Table VIII, we can see the difference in correlation between the original and encrypted images horizontally, vertically, and diagonally.

Pictures . | Original peppers . | Encryption peppers . | ||||
---|---|---|---|---|---|---|

Channel . | R . | G . | B . | R . | G . | B . |

Level | 0.9758 | 0.9761 | 0.9537 | 0.0253 | 0.0091 | −0.0143 |

Vertically | 0.9874 | 0.9879 | 0.9729 | 0.0095 | −0.0198 | 0.0091 |

Diagonal | 0.9629 | 0.9641 | 0.9313 | −0.0005 | 0.0051 | 0.0031 |

Pictures . | Original peppers . | Encryption peppers . | ||||
---|---|---|---|---|---|---|

Channel . | R . | G . | B . | R . | G . | B . |

Level | 0.9758 | 0.9761 | 0.9537 | 0.0253 | 0.0091 | −0.0143 |

Vertically | 0.9874 | 0.9879 | 0.9729 | 0.0095 | −0.0198 | 0.0091 |

Diagonal | 0.9629 | 0.9641 | 0.9313 | −0.0005 | 0.0051 | 0.0031 |

### D. Key space analysis

To effectively resist various attacks, it is necessary to have high security and a sufficient critical domain. The number of keys defines the essential space and determines the key’s resistance to plaintext attacks. Therefore, the higher the number of keys, the larger the critical area becomes and the more resistant it is to powerful spells.

^{−16}; hence, the critical capacity of this encryption algorithm is

Therefore, the algorithm in this paper has a larger critical space and is more resistant to selective plaintext attacks. In addition, the algorithm in this paper provides flexible key space size setting levels, which can meet the needs of users with different security levels. Together with the number of iterations, the critical space of this paper is theoretically infinite, which is why the encryption algorithms in this paper can withstand all attacks.^{25}

### E. Key sensitivity analysis

Key sensitivity means that a slight change in the key will cause a significant difference in the encrypted image, resulting in a decryption error. Now, the critical sensitivity of this algorithm is tested by observing the changes in the decrypted image with a slight change in the value of one of the factors in the key, and the following experiments are carried out using the peppers ciphertext image as an example. Make some minor changes to one of the keys. For example, when an image is encrypted, it has a parameter value of 3; when an image is decrypted, it should also have this parameter value of 3. When this parameter number is not 3, even if it is just a tiny change, the decrypted graph is no longer the original graph. Figure 10 shows a decrypted diagram when the password is wrong.

The test results show that if there is a slight change in the decryption key, the corresponding decrypted image will be very different from the original image in terms of pixel-level and visual effect. The results show that the algorithm is sensitive to cryptographic keys and can better resist brute force attacks.^{26}

### F. Analysis of anti-differential attacks

The study of resistance to differential attacks on ciphertext images can be used to evaluate the merits of cryptographic algorithms. In plaintext images, when a pixel has a slight change in gray level, it can significantly impact the ciphertext image, and the extent of this impact is generally evaluated using methods such as the Number of Pixels Change Rate (NPCR). The NPCR is an index used to measure the sensitivity of an encryption algorithm to slight changes in plaintext images. When a pixel in a plaintext image changes, NPCR is used to calculate the percentage of pixel value changes in the corresponding ciphertext image. Generally, a higher NPCR value indicates that the encryption algorithm is highly sensitive to slight changes in the plaintext, that is, it has better resistance to differential attacks and UACI (Unified Average Changing Intensity). It is also an index used to measure the sensitivity of an encryption algorithm to slight changes in plaintext images. UACI evaluates the anti-differential attack ability of an encryption algorithm by calculating the average change intensity of pixel values in the corresponding ciphertext image when a pixel in the plaintext image changes. Generally, a higher UACI value means that the encryption algorithm has a stronger response to slight changes in the plaintext and has better anti-differential attack ability. The ideal value of NPCR is 99.6094%, and the perfect weight of UACI is 33.4635%.^{27} After changing the value of a particular pixel in different plaintext images and encrypting the plaintext images using the algorithms in this paper, the NPCR and UACI values for other pictures are given in Table IX. The NPCR and UACI of the cypher image of this paper's algorithm are closer to the desired values than other algorithms. The comparison results are given in Table X.

. | Average NPCR (%) . | Average UACI (%) . | ||||
---|---|---|---|---|---|---|

Test pictures . | R . | G . | B . | R . | G . | B . |

Airplane | 99.61 | 99.63 | 99.62 | 33.51 | 33.48 | 33.55 |

Peppers | 99.60 | 99.60 | 99.61 | 33.49 | 33.48 | 33.48 |

Baboon | 99.59 | 99.62 | 99.62 | 33.50 | 33.51 | 33.53 |

. | Average NPCR (%) . | Average UACI (%) . | ||||
---|---|---|---|---|---|---|

Test pictures . | R . | G . | B . | R . | G . | B . |

Airplane | 99.61 | 99.63 | 99.62 | 33.51 | 33.48 | 33.55 |

Peppers | 99.60 | 99.60 | 99.61 | 33.49 | 33.48 | 33.48 |

Baboon | 99.59 | 99.62 | 99.62 | 33.50 | 33.51 | 33.53 |

Arithmetic . | Article . | Reference 28 . | Reference 23 . | Reference 24 . | Reference 29 . |
---|---|---|---|---|---|

Average NPCR | 99.62 | 96.46 | 99.62 | 99.60 | 0.9961 |

Average UACI | 33.52 | 33.10 | 33.48 | 33.44 | 0.3350 |

### G. Noise attack analysis

*M*×

*N*, the Peak Signal-to-Noise Ratio (PSNR) is an index used to measure image quality. It represents the logarithm of the ratio of the maximum power of the signal to the power of the noise multiplied by 10 and is usually measured in units of decibels (dB). The higher the PSNR value, the better the image quality and the smaller the distortion. In the field of image processing, PSNR is often used to evaluate the performance of image compression, filtering, enhancement, and other algorithms)

*.*The PSNR calculation formula is shown as follows:

^{30}

The *MSE* in the squared formula is the mean error between *I*_{1} and *I*_{2}. Usually, the higher the *PSNR* value, the better the reconstruction of the original image. In this analysis, the idea of peppers is usually encrypted first to obtain the encrypted image. Then, pretzel noise is added to the encrypted image to increase the intensity to 0.01, 0.03, and 0.05, respectively. Finally, the cypher image with noise is decrypted, respectively.^{31} Thus, Fig. 11 shows the noisy ciphertext image and its corresponding decoded image. Observation of the figures shows that the decrypted image is relatively straightforward and recognizable. In addition, Table XI lists the *PSNR* values of these decoded images. It shows that the encryption algorithm proposed in this paper can resist the pretzel noise attack. Also, the table lists the corresponding results of the comparative algorithms [17–19]^{32}–[32–33]. From the table, it is easy to know that the *PSNR* values of the encryption algorithm proposed in this paper are mostly higher than the current state-of-the-art encryption algorithms in different missing rates. Figure 12 shows the ciphertext images and their corresponding decrypted images with other Gaussian noises added to the peppers image. Table XII lists these decoded images and the *PSNR* values with the comparative algorithms [17–19]^{33}–[32–33].

Pepper noise density . | 0.01 . | 0.03 . | 0.05 . |
---|---|---|---|

This article | 39.2827 | 36.8922 | 35.8131 |

Reference 17 | 28.6923 | 28.6937 | 28.6211 |

Reference 18 | 28.7044 | 28.7071 | 28.6974 |

Reference 19 | 30.2173 | 29.4494 | 29.3079 |

Reference 23 | 30.6673 | 25.8852 | 21.2355 |

Reference 24 | 34.5442 | 32.6827 | 30.2257 |

Gaussian noise density . | 0.000 01 . | 0.000 05 . | 0.000 07 . |
---|---|---|---|

This article | 32.2240 | 32.0016 | 31.9903 |

Reference 17 | 28.7113 | 28.7000 | 28.7132 |

Reference 18 | 28.7113 | 28.7207 | 28.6930 |

Reference 19 | 28.7114 | 28.7259 | 28.7147 |

Reference 23 | 31.5573 | 28.8852 | 27.4124 |

Reference 24 | 32.3789 | 27.5643 | 27.3135 |

### H. Analysis of shear resistance

A clipping attack is an attack method that allows an image to be tampered with or deleted by intercepting the encrypted image. Generally, the cropped parts are some specific parts, and there is an excellent correlation between them, so restoring the missing information from them is difficult. Therefore, destroying the correlation between pixels becomes a vital method to evaluate the shear resistance of image encryption algorithms.^{23,28,34} When there is a significant correlation between pixels in an image, it will result in missing information in the picture, which will cause the encryption of the image to fail. The method destroys the strong correlation between pixels and makes the distribution of pixels more uniform. When the ciphertext image is cut, the cut portion is not entirely different from the original figure. However, it is scattered among the various region points, so the cut image can maintain enough information to restore the corresponding plaintext image. Below are 1/16, 1/4, and 1/2 cuts of a ciphertext image such as peppers (every pixel at that cut position is 0, and this cut sample is shown in Fig. 13), and the decoding results of the cut ciphertext image are shown in Fig. 13.^{24,29,35} As can be seen from Fig. 13 after cutting out 1/16 of the ciphertext image, the image can be decrypted and restored to the original appearance; in the case of 1/4, the approximate information of the picture can still be restored after decoding; if half of it is cut out, only the approximate outline of the image can be seen. As seen from Table XIII, compared with other algorithms, the algorithm in this paper is more resistant to shear. The test results show that the algorithm has some recovery ability when attacked by shear, and the encryption algorithm can resist some shear attacks.^{36–39}

Defect rate . | 1/16 . | 1/4 . | 1/2 . |
---|---|---|---|

This article | 35.3771 | 32.6881 | 31.5577 |

Reference 17 | 30.6953 | 28.7154 | 26.7132 |

Reference 18 | 28.6997 | 28.6945 | 27.6930 |

Reference 19 | 34.8468 | 33.4350 | 32.7147 |

Reference 23 | 34.3468 | 32.3600 | 31.3774 |

Reference 24 | 35.2631 | 32.3545 | 30.8672 |

## V. CONCLUSION

This paper proposes an image encryption algorithm based on an improved new four-dimensional chaotic system and DNA coding. Based on a four-dimensional chaotic system existing in the literature, a new four-dimensional hyperchaotic system is obtained through improvement. The initial value of the system is generated based on SHA-256, ZigZag transform, and the input key and four pseudo-random chaotic sequences are generated iteratively. DNA chunking encoding, arithmetic operation, and decoding are implemented for the image disrupted based on the zigzag transform. The two-dimensional matrix constituted based on the chaotic sequence of Chebyshev to obtain the scrambled and diffused ciphertext image. Simulation experiments and security performance analysis show that the algorithm enhances the correlation between the key and the plaintext and the randomness of the encryption process and effectively improves the anti-attack capability.

## ACKNOWLEDGMENTS

The authors thanked Ms. Ying Shi for help with language editing and figure artwork.

This study did not receive any specific funding from funding agencies in the public, commercial, or non-profit sectors.

## AUTHOR DECLARATIONS

### Conflict of Interest

The authors declare that they have no known competing financial interest or personal relationships that could have appeared to influence the work reported in this paper.

### Author Contributions

**Chengwei Tang**: Conceptualization (lead); Methodology (lead); Software (lead); Validation (lead); Writing – original draft (lead). **Shibing Wang**: Project administration (lead); Resources (lead); Supervision (lead); Writing – review & editing (lead). **Yubing Shu**: Data curation (equal); Formal analysis (equal); Validation (equal). **Fujun Ren**: Resources (equal); Software (equal).

## DATA AVAILABILITY

The data that support the findings of this study are available from the corresponding author upon reasonable request.