An Image Encryption Scheme Based on IAVL Permutation Scheme and DNA Operations

In this paper, a novel image encryption algorithm based on a new permutation scheme and DNA operations are introduced. In our algorithm, SHA 256 and DNA hamming distance participate in the generation of the initial conditions of the 4D chaotic system, which can associate the encryption system with the original image. In the permutation process, based on the adjustment process of the IAVL (improved balanced binary tree), a new scrambling algorithm is constructed. Then the dynamic block coding rules are designed, in which different image blocks have different coding rules. In the diffusion process, a new diffusion algorithm with intra-block and inter-block is proposed to perform DNA operations on the intermediate encryption result and the key matrix. In the security analysis, the key space of the encryption system is 2933 and the information entropy is about 7.9973. In addition, the NPCR and UACI in the differential attack test are close to the ideal values of 99.6094% and 33.4653%. To further prove the security of the encryption algorithm, the Irregular deviation, Maximum deviation, Energy, Contrast, and Homogeneity tests are introduced into the analysis. Experimental results illustrate that the encryption scheme can against multiple illegal attacks like statistical, brute-force and differential attacks.


I. INTRODUCTION
As an important carrier of information, image files are frequently transmitted over the public Internet. So how to prevent eavesdropping becomes a major challenge. Traditional text information has some mature encryption technologies, including RSA, DES and AES [1], but they cannot meet the needs of image encryption due to the large size and special storage format of the image files. In recent years, image encryption technology has attracted the attention of more and more scholars and experts [2]- [8]. Various encryption techniques like SCAN [9], [10], elliptic curve [11], Fourier transform [12], cellular automata [13] and wavelet transform [14] have been introduced by the research community for image encryption which based on the chaotic systems. In 1998, image encryption based on the architecture of scrambling and diffusion has been proposed by Fridrich's for image encryption [15]. Until now, many chaotic-based encryption schemes still use this The associate editor coordinating the review of this manuscript and approving it for publication was Gulistan Raja . framework [5], [16]- [32]. For example, a new threedimensional chaotic system for image encryption was used in [16]. They change the plain images to a 3D cubic DNA matrix to reduce encryption time. Nepomuceno et al. [17] used 1D chaotic map of the difference of two pseudo-orbits to encrypt image. To increase the encryption key space, the research community finds that multiple chaotic maps are often used in combination in some image encryption. Based on using a dynamical state variables selection mechanism, a fast image encryption technique was proposed by Chen et al. [21]. The two-dimensional area-preserving chaotic map was used to produce the pseudo-random sequences for the permutation stage and the key matrix are obtained by a one-dimensional chaotic system for the diffusion stage. Kulsoom et al. [19] proposed an efficient encryption technology in which pixels of image is permuted using PWLCM system and diffusion is operated using 1D Logistic map. Zhu and Zhu [20] suggested a plaintext-related image encryption scheme using 5D chaotic map in which scrambled image is divided into lots of blocks and diffused within the block, authors stated that the scheme can resist VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ selected plaintext attacks due to permutation operation is related to the plain image. One-time pad is currently the most secure encryption algorithm, but its password storage has a high cost. Therefore, more and more researchers have turned their attention to the field of DNA encryption. The DNA computing algorithm has advantages which include high parallelism, ultra-low power consumption and big information density. So, image encryption combined with the DNA computing algorithm and the chaotic map is born which is used to solve this problem [18], [33]- [43]. An image encryption based on dynamic DNA encoding was proposed by Aditya et al. [33]. In the encryption scheme, dynamic DNA encoding and pixel scrambling are applied. Patro et al. [34] suggested an efficient image encryption scheme, which is secure, lossless, and noise-resistive using chaos, hyper-chaos, and DNA sequence operations. A block encryption algorithm for gray images was introduced by Rehman et al. [35]. In the selective diffusion process, higher and lower bit planes of an image are encoding into DNA sequences, respectively and divided into blocks to implement DNA algebraic operation with each other. Finally, the higher bit planes of blocks are replaced by the result.
There are other algorithms that can help improve the proposed encryption system [2], [44]- [58]. For example, RGB DNA image encryption technology was designed in [44]. But Ozakaynak et al. [53] claimed that it has performance defects. Firstly, the equivalent key may be cracked by several special plain images. Second, the security is poor in the face of chosen-plaintext attack. Yang et al. [45] used a hyperchaotic sequence to improve the color image encryption scheme in which DNA encoding rule fixed 1 and decoding fixed 3. The fixed image encoding/decoding rules may be to expand the key space, but the security is not as good as dynamic ones. the encryption process is not sensitive enough to changes to the keys or the original images. In order to improve the disadvantages of some common encryption systems and enhance the performance of the system, a safe and efficient encryption scheme is urgently needed to be proposed.
Based on the above analysis, an encryption scheme combining the chaotic system and DNA manipulation is proposed. Our algorithm has three advantages: First, a new 4D chaotic system is designed in our encryption scheme [7]. Through dynamical analysis, it is found that this system has many control parameters and any small change in them will create a new state of chaos. So, it can use to generate a large number of pseudo-random numbers for image encryption. Second, the process of adjusting IBST to IAVL is accompanied by the exchange and movement of nodes. Therefore, a new scrambling algorithm is designed by referring to the IAVL adjustment process. Compared with the previous circular scrambling of rows and columns, the new scrambling algorithm also has column exchange operations, which greatly increases the flexibility of the scrambling algorithm. Third, during the diffusion process, the dynamic coding of DNA and the intra-block and inter-block diffusion technology are applied, which will greatly improve the diffusion effect of the image.
The paper structure is outlined as follows. In Sec. II, preliminary materials are given. In Sec. III the details of our encryption scheme are introduced. Then simulation tests are shown in Sec. IV. Finally, Sec. V and Sec. VI give security analysis and paper conclusion, respectively.

A. THE MODEL OF THE CHAOTIC SYSTEM
In this section, a new chaotic system model will be cited. After the initial values and parameters are given, the dynamical characteristics are then analyzed to prove the applicability of this chaotic system in the encryption field.

1) 4D CHAOTIC SYSTEM
The new four-dimensional chaotic system is introduced as follows where x, y, z and u make up the system states variable and a, b, c, d, e, r, α and β are system parameters.

3) LYAPUNOV EXPONENT SPECTRUM AND BIFURCATION DIAGRAM
The LEs (Lyapunov exponential spectrum) and BDs (bifurcation diagram) can verify the chaotic behavior, so LEs and BDs under the parameters d∈[0, 6], r∈[0 0.2] and α∈[0 1.5] are shown in Fig.2(a)-(f), here the iteration step is 0.001. The results show that the new 4D chaotic system has surprising strong randomness.

B. THE RANDOMNESS OF 4D CHAOTIC SYSTEM
In this section, to distinguish the randomness of chaotic systems, NIST SP 800-22 is introduced [54]. The results of the test can be judged by three criteria. The first evaluation criterion is P − value, set the confidence level is α, if P − value>0.01, it can be proved that the sequence of this system can pass the randomness test. The second evaluation criterion is P − value T , which can be used to prove that all P − value sample blocks obey uniform distribution. The   formula is as follows where G i represents the number of P − value in sub-interval i, and m represents the sample size. If the proved chaotic sequence has a high degree of randomness, then P − value T ≥0.0001. The third criterion is the rate at which the sample sequence of the test passes. First set the confidence level α, and then the confidence used for the test results is defined as followŝ whereP = 1 − α, s represents the size of the test sample. For P − value ≥0.01, the ideal pass ratio should be 0.9960.
Tab.1 shows the randomness test of the 4D chaotic system. The results show that the system can pass the test and the generated sequence has good randomness.
where x i and y i are elements of two DNA sequences x and y with the same size, if

D. BINARY TREE 1) IMPROVED BINARY SORT TREE
Binary Sort Tree (BST) is also called Binary Search Tree.
Here, we limit the number of nodes in the tree to three, assuming that the three nodes are represented as A, B, and C.   Therefore, Improved Binary Sort Tree (IBST) has five basic types, as shown in Fig.3.

2) IMPROVED BALANCED BINARY TREE
Balanced binary tree (AVL), the absolute value of the height difference between the left and right subtrees of the tree does not exceed 1. For the above-mentioned IBST with only three nodes, there are five rules for adjusting to improved balanced binary tree (IAVL). The specific implementation steps are as follows 1. LL type balanced rotation (right rotation): that is, perform a right rotation operation on the IBST in the shape of Fig.3(a), rotate B upward instead of A as the root node, and rotate node A to the lower right to become the right child node of B. The operation process is shown in Fig.4(a).
2. LR type balanced rotation (first left and then right double rotation): That is, two rotation operations are required for the IBST of the shape of Fig.3(b), first left rotation and then right rotation, and node C is rotated left as the left child of B. Exchange the positions of nodes B and C. Rotate node A to the lower right to become the right child node of B. The operation process is shown in Fig.4 3. RL type balanced rotation (right and then left double rotation): that is, two rotation operations are required for the IBST of the shape of Fig.3(c), first right rotation and then left rotation, and node C is rotated right as the right child of B. Exchange the positions of nodes B and C. Rotate the node A to the lower left to become the left child node of C. The operation process is shown in Fig.4(c).
4. RR type balanced rotation (left rotation): that is, a left rotation operation is required for the IBST of the shape of Fig.3(d), B is rotated to the upper left instead of A as the root node, and node A is rotated to the lower left to become the left child node of B. The operation process is shown in Fig.4(d).
5. AVL type: In order to facilitate the operation of scrambling the image, A nodes in Fig.3(e) is adjusted downward, and exchange the positions of nodes B and C in Fig.3(e). The result is shown in Fig.4(e).

III. ENCRYPTION SCHEME A. GENERATION OF THE INITIAL VALUES OF THE CHAOTIC SYSTEM
Firstly, SHA 256 hash function of the plain image is used to generate to 256-bit external secret key. Then, divide the external secret key K into 32 groups, each group contains 8 bits as follows where, i = 1, 2, 3, . . . , 32, k i means the ith bit group. The parameters used to generate initial values can be obtained as follows where mod is the modular operator, mean () is used to average, and K 2i ⊕ K 2i+1 is the XOR operation between K 2i and K 2i+1 .
The initial values (x 0 , y 0 , z 0 , u 0 ) of the 4D chaotic system are given as keys, and perform addition operation with (k a , k b , k c , k d ) to obtain new initial values of the chaotic system as follows

B. PERMUTATION OPERATION BASED ON IAVL
A new scrambling algorithm can be designed based on the adjustment process of the IAVL. The idea is as follows, assuming that the elements used to construct the IBST come from the matrix Q of the same size as the image, in the process of adjusting IBST to IAVL involves the movement and exchange of nodes, corresponding a new scrambling algorithm can be associated with it. The specific scrambling operations are as follows Step 1: Suppose the image P size is M ×N , give the initial value (x 1 , y 1 , z 1 , u 1 ) of the chaotic system, which produced by formula 7, and iterate the chaotic system M ×N +l times, discard the first l times to obtain state variables x i , y i , z i and u i , then the chaotic sequence S z x 1 , x 2 , . . . , x MN .
Step 2: Modify the chaotic sequence S, and turn it into a matrix of size M ×N . S = mod(floor((x i + 100) × 10 10 ), 10 × max(M , N )) + 1 (8) Sort S to generate the index value Q as shown in formula 9.
[lx, Q] = sort(S) (9) Step 4: Take the ith row element Q(i,:) (i = 1, 2, 3,. . . , M ) of the matrix Q, and make a group of every three elements (a total of N /3 groups), and write down where the three elements are column j, j+1 and j+2 (j = 1, 4, 7, . . . , N /3-2). Construct a IBST respectively, where A = Q(i, j), B = Q(i, j+1) and C = Q(i, j+2). Then, according to the adjustment process of IAVL, perform column cyclic shift and column exchange operations on the image. The specific rules are as follows Case1: If the type to be adjusted is the LL type, according to Fig.4(a), the column j where the element of the A node is located corresponds to the jth column of the image and moves downward Q(i, j) times, and the column j+1 where the element of the B node is located corresponds to the jth column of the image and moves downward Q(i, j+1) times.
Case2: If the type to be adjusted is the LR type, according to Fig. 4(b), move the ith row of the image to the left by Q(i, j+2) times, and the value of the C node element Q(i, j+2) and B node element Q(i, j+1) are regarded as two columns in the image to exchange, and then the j column where the A node element is located corresponds to the jth column of the image and moves down Q(i, j) times.
Case3: If the type to be adjusted is the RL type, according to Fig.4(c), move the ith row of the image to the right by Q(i, j+2) times, and the value of the C node element Q(i, j+2) and B node element Q(i, j+1) are regarded as two columns in the image to exchange, and then the j column where the A node element is located corresponds to the jth column of the image and moves down Q(i, j) times.
Case4: If the type to be adjusted is the RR type, according to Fig.4(d), the column j where the element of the A node is located corresponds to the jth column of the image and moves downward Q(i, j) times, and the column j+1 where the element of the B node is located corresponds to the jth column of the image and moves downward Q(i, j+1) times.
Case5: If the IBST is constructed as shown in Fig.4(e), the column j where the element of the A node is located corresponds to the jth column of the image and moves downward Q(i, j) times, and the value of the C node element Q(i, j+2) and B node element Q(i, j+1) are regarded as two columns in the image to exchange, and then the j column where the A node element is located corresponds to the jth column of the image and moves down Q(i, j) times.
Step 5: Return to Step 4, i = i+1 and repeat M -1 times to get the scrambled matrix B2. In order to facilitate the understanding of the entire scrambling operation process, we take one step in the scrambling process as an example. Assuming that Q(1,:) is (1, 6, 3, 2, 4, 5) and image P is (6×6) matrix, as shown in Fig.5(a), the IBST constructed by taking the first three numbers of Q(1,:) is shown in Fig.3(c) (A = 1, B = 6, C = 3), and adjust the corresponding operation rules to IAVL as Case4: Here the adjustment type is RL operation, as depicted in Fig.4(d) and i = 1, j = 1. First, since C = 3 and the line to be operated is i = 1, the first line of the image is shifted to the right circle once, as shown in Fig.5(b); Second, swap columns 3 and 6 of the image, since the nodes B = 6 and C = 3 have to be swapped; Finally, since A = 1 and j = 1, the first column of the image is circularly shifted downward once; The final result is illustrated in Fig.5(c).

C. BLOCK-BASED DYNAMIC DNA ENCODING
In the encoding process, block-based DNA coding is proposed with the help key matrix to achieve dynamic coding. That is to say, the coding rules of the image block are selected by the corresponding key matrix block. Here, we update the initials value of the chaotic system again by using the DNA hamming distance algorithm on the plain image. When the plain image changes, the corresponding key matrix will also change, and finally change the choice of image coding rules. The design of the coding rules is demonstrated as follows.
Step 1: Each pixel of the image can be encoded to produce four DNA codes where coding rule u = 1 is selected. Then, taking the first DNA code of all image pixels can form a DNA matrix BP0 of size M ×N , then manipulating the same operation to the second, third and fourth DNA codes of the image to generate BP1, BP3 and BP4. Step 2: The DNA hamming distances are computed using the four DNA matrices, the result is as follows Step 3: Set r = M ×N , initial values after update of the 4D chaotic system are defined as follows Step 4: Iterated Eq. (1) r+ l times using the new initial values in (9), then discard the former l values, modify the obtained state x i , y i and z i variables as follows Step 5: The final key matrix can be obtained by the following formulas where where T (i,j) and F(i,j) represent the values of a new matrix in row i, column j, which is used to calculate the key matrix K 2. Step 6: Divide image B2 and the key K 2 into M ×N /4 blocks of size 2 × 2, each block encoding rule s i comes from the following formulas s i = mod(floor((m 1 + m 2 + m 3 +m 4 +m 5 +m 6 )/6), 8)+1 (15) where where K 2i (k) (k = 1, 2, 3, 4) represents the kth element of the ith (i = 1, 2, . . . , M ×N /4) block of the key matrix, m j (j = 1, 2, . . . , 6) represents the absolute value of the difference between any two elements in the block.
Step 7: DNA matrix D with a size of M ×N ×4 is obtained according to s i coding B2 and manipulate the same encoding operation to K 2, then K 3 is obtained.

D. INTRA-BLOCK AND INTER-BLOCK DIFFUSION OPERATION
In the diffusion process, the diffusion operation is carried out with the help of the key matrix produced by Sec. III.C. Diffusion steps include intra-block and inter-block diffusion, firstly, intra-block DNA sequence operations include 3 types in Tab.4, it depends on the corresponding DNA sequence in the key block. Finally, the algorithm between blocks is a DNA addition operation and the diffusion operation is carried out in the horizontal and vertical directions respectively. The specific steps are shown below.
Step 1: Divide DNA matrix D and K 3 into M ×N /4 blocks of size 2 × 2.
Step 2: Selected rules functions f (,) are defined by the following Tab.5. If the first element of each block is equal to 'A', 'T', 'C' or 'G', the corresponding DNA operation is selected.
Step 3: Intra-block diffusion is implemented by the following formula C i (k) (k = 1, 2, 3, 4) represents the kth element of the ith (i = 1, 2, . . . , M ×N /4) block of the encrypted, D i (k) and K 3i (k) are the kth element of the corresponding encoded DNA image block and key DNA block, respectively. and C i (k-1) represents the (k-1)th element of the encrypted in the block. When k = 1, C i (0) = D i (4).
Step 4: Divide C into N blocks of size M ×4, the horizontal diffusion between blocks is as follows where C(i) represents the ith (i = 1, 2, . . . , N ) block in the horizontal direction, C(i+1) represents the block behind C(i) and C1(i+1) indicates the result after diffusion. When i = N , Step 5: Divide C1 into M /4 blocks of size N , the vertical diffusion between blocks is as follows where

E. THE WHOLE ENCRYPTION PROCESS
As you can see from the Fig.6, the complete encryption step is divided into six steps as shown below.
Step 1: Input standard gray image B with a size of M ×N .
Step 2: Calculate the external key K determined by image B through SHA 256 function in Eq. (5). The initial values of the 4D chaotic system can be calculated by using Eq. (7).
Step 3: The sequence S is generated by using new initial values in Eq. (7), and perform permutation operation on the image B of each pixel as stated in Sec. II.B to get permutated matrix B2.
Step 4: The key matrix K 2 is generated by using new initial values in Eq. (11) whose lengths are M and N , respectively. Partition image B2 into M ×N /4 blocks of size 4 × 4 and encode them using dynamic coding technology as shown in Sec. III.C to obtain DNA matrix D and K 3 of size M ×N ×4.
Step 5: Implement intra-block and inter-block diffusion on the encoded image D to get diffusion C2 with the help of the key matrix K 3 as described in Sec. III.D Step 6: Decode the DNA matrix C2 by the f decoding rule and it can be obtained through f = (floor(mod(d 1 ×1000),8+1)) where d 1 came from Eq. (10). Finally, the cipher image is obtained.

IV. SIMULATION RESULTS
In this section, the simulation tests are implemented on a computing device with the following hardware and software environments: intel core i5-105G3 processor and 16GB (DDR4 3200MHz) RAM, MATLAB 2019a and window-10 system. In our algorithm, the initial values and parameters of the

V. SECURITY ANALYSES A. KEY SPACE ANALYSIS
The primary goal of the encryption system is to effectively deal with brute force attacks. After research by cryptography experts, the length of the key is at least 100 bit [4]. In the proposed algorithm, the composition of the key can be expressed as the following (1) The initial values and control parameters are (x, y, z, u) and (a, b, c, d, e, r, α, β).
(2) The 256-bit hash values are given by SHA 256 function to generate new initial values for the permutation phase.
(3) The four disturbance (d 1 , d 2 , d 3 , d 4 ,) parameters are obtained using DNA hamming distance to get new initial values for DNA encoding and diffusion phase.
(4) In order to avoid transit effects, iterating parameter l (500) is given as secret key.
(5) DNA encoding u and decoding rule f . When the computer's precision is set to 10 −15 , the key size of the initial value and parameters of the chaotic system will be 10 180 ≈2 598 , the external key space is 2 128 , key space for other parameters will reach 10 90 +2 9 +2 6 ≈2 207 . So, the total key space is about 2 933 , Tab.6 shows the comparison of key spaces in different literatures. It can be seen that our algorithm has the largest key space, so the system will not be damaged by violent attacks. At the same time, in the face of the management of such a large key space, we use the parameters mentioned in (1) and (4) as the encryption and decryption side private keys. (2), (3) and (5) are transmitted on the key channel. This can greatly reduce the administrative burden of the key space.

B. HISTOGRAM ANALYSIS
The histogram can present the statistical information of the pixels graphically. A good encryption system should resist statistical attacks and it has a uniform distribution. Fig.8(a) and (b) are the histograms of the image Pepper (256 × 256) before and after encryption. After observing Fig.8(b), since the image is quite flat, the attacker cannot obtain any information just by observing the image.

C. CHI-SQUARE AND VARIANCE TESTS
In order to further evaluate the distribution uniformity of pixels, the Chi-square test will be used as a test tool [2]. It is expressed as where F i and G i represent observed frequency distribution and theoretical frequency distribution, respectively and G = MN /256. The smaller the chi-squared value, the more uniform the histogram. In other words, the better the encrypted image information is hidden. In general, the commonly used significance level is 0.05, χ 2 0.05 = 293.2783. Through the Chi-square test on Fig.8, the test result is 256.0156, which is far lower than χ 2 0.05 , so Fig.8 can be considered to be approximately evenly distributed.
The variance is another kind of quantitative analysis of histogram [32]. The smaller the variance, the more uniform the histogram is tested. Its mathematical expression formula is (21) where N is the number of gray levels of an image. For an 8-bit gray image, N = 256. C is a vector and C = c 0 ,c 1 ,. . . ,c N −1 , c i and c j are the numbers of pixels with gray values equal to i and j, respectively. The variance test is performed on the histogram in Fig.8 and the result is Var(C) = 256.0156. In the variance test, the difference around 260 is already ideal, that is, the histogram near this value is very uniform.

D. CORRELATION ANALYSIS
The adjacent pixels generally have a certain connection, which is often used by attackers to analyze image information. The 2000 pairs of adjacent points in the image are selected to test the correlation, where the selection directions of the pixel pairs are horizontal (H), vertical (V) and x i (25) where x and y is a pair of adjacent pixel values, N represents the number of image pixels, E(x) is expectation, cov(x, y) and D(x) represent the covariance and variance, respectively. Fig.9 shows a quantitative representation of the correlation before and after image encryption and the specific values of the correlation and the comparison with other documents as listed in Tab.7. It can be seen from Fig.9 and Tab.7 that the correlation in the original image is an approach to 1, but the encrypted image is an approach to 0. Compared with [18], [42], [43], our algorithm makes the correlation coefficient of the encrypted image lower, while compared with [49], the correlation coefficient is close, which shows that the correlation of the plain image is eliminated after encryption.

E. INFORMATION ENTROPY
It is generally believed that information entropy is a measure of the degree of randomness of information. The calculation formula entropy is as follows where m i represents the source value, p(m i ) is the probability of the source value. L is equal to 256 due to the range of the pixel value belongs [0 255] for grayscale images. For the encrypted image, the information entropy should be close to the ideal value 8. Tab.8 and Tab.9 list the information entropy of an image before and after encryption and   [18], [42], [43], [49].  compares it with related references. In Tab.8, it can be seen that the information entropy of our algorithm is only lower than that of House in [42] and [49]. Then by comparing the information entropy of images of different sizes in Tab.9, it can be seen that the information entropy of images of (256 × 256) and (512 × 512) is always around 7.9973 and 7.9993, which is basically the same as that of [35]- [37]. Therefore, the encrypted image almost does not have the possibility of information leakage.
The Local Shannon entropy can be used to measure the precise randomness of the image pixels after encryption, so the security of our algorithm information entropy can be further demonstrated. The formula is as follows where k is the number of non-overlapping blocks that the source S is divided into, T B is the number of pixels contained in each block, and H (S i ) is the information entropy of each block. In the test of local entropy in this paper, parameters k = 30 and T B = 1936 are set. At different significance level (0.001, 0.01, 0.05), the local Shannon entropy should be between (7.901515698, 7.903422936), (7.901722822,7.903215812) and (7.901901305, 7.903037329), respectively [18]. As can be seen from Tab.10, all images pass the security test at the confidence level of 0.001 and 0.01, while only a part fails at the confidence level of 0.05. Therefore, our algorithm can pass the security test of information entropy.

F. DIFFERENTIAL ATTACK
To put it simply, differential attack tests the sensitivity of encrypted images to changes in plain images. At present, NPCR (pixel change rate) and UACI (uniform mean change intensity) are the most commonly used differential attack test tools. They can be expressed as follows where C is assumed to be the encrypted image of P, then C 1 is the encrypted image after P randomly changes one pixel, L represents the number of pixels of image P. If C(i, j) = C 1 (i, j), D(i, j) = 0; Otherwise, D(i, j) = 1. We make a slight change to the pixel value at any point of the image in which sizes tested here are all (256 × 256) and calculate the average value of 10 times of NPCR and UACI as the final comparison  [18], [42], [43], [49]. result and the results and comparative documents are shown in Tab.11. It is not difficult to find that the NPCR and UACI produced by our algorithm are closer to the expected values of 99.6094% and 33.4653%. Therefore, our scheme has good performance against differential attacks.

G. ERROR METRIC ANALYSES
In this section, PSNR (peak signal to noise ratio) and MSE(mean square error) are introduced to measure the difference between the original image and the cipher image [54]. The smaller the measured PSNR, the larger the difference between the two images before and after encryption. Moreover, the larger the measured MSE, the greater the difference between the two images. The PSNR and MSE formulas are defined as whereṗ(i,j) and p(i,j) represent the two images before and after encryption, and M and N represent the rows and columns of the image respectively. Tab.12 shows the error analysis results. It can be seen that the values of MSE and PSNR are within the range of expected values after ensuring high-quality encryption of the image. Meanwhile, the mean values of MSE and PSNR of the four images in the table are given, which are 8.83.4, 8556.45 respectively. Therefore, the above results can show that the proposed encryption scheme has high efficiency.

H. ENCRYPTION QUALITY ANALYSIS
Maximum deviation (MD) and irregular deviation (ID) are often used as important indicators to evaluate the quality of encryption [54]. In general, the lower the values of MD and ID, the more uniform the histogram distribution after encryption, and the better the encryption quality. The mathematical formulas for MD and ID are shown below where d i represents the quantity difference corresponding to the ith coordinate point of the plain and cipher histograms. b stands for bits.
where h i represents the absolute difference between plain and cipher images. The deviation from uniform histogram (DH) can alse be used to calculate the quality of the encrypted image, that is, whether the histogram distribution of the encrypted image is uniform [55]. The lower the DH obtained, the better the quality of the encryption. The mathematical formula can be written as where m×n represents the size of the image and H c represents the histogram of the cipher image. H ci can be obtained by the following formula.
Tab. 13 shows the results of the encryption quality test, in which the tested data are MD, ID and DH. The test image compared with the literature in the table is Pepper. Through comparative analysis, we can see that the data of MD is almost the same, the data of ID is slightly better than ours, but the DH of our algorithm is better. Therefore, our algorithm can be said to have better encryption quality.

I. ENERGY OF ANALYSIS
In the calculation of energy, the GLCM (gray level co-occurrence matrix) is introduced into the calculation, VOLUME 9, 2021   where the GLCM is used to measure the occurrence frequency of two specific pixel values with a certain spatial relationship, and then perform image texture analysis [32]. The test result is usually used to evaluate the information in the image by counting the sum of squares of all the elements in the matrix.
Tab.14 shows the energy value of our encryption scheme. It can be seen that the mean value of energy in the table is close to that of the comparative literature, indicating that the pixels of the encrypted images are disordered, that is, the quality of our encryption algorithm is high.

J. ANALYSIS OF CONTRAST
The difference intensity of adjacent pixels can be calculated by contrast analysis. For an encrypted image, the better the encryption quality, the higher the contrast value [32]. The mathematical formula for contrast is shown below Tab.14 is the contrast value calculated by our scheme. It can be seen that our algorithm has a high contrast value, so our algorithm can provide high security.

K. HOMOGENEITY
The close relationship between the element distribution in GLCM and the diagonal elements in GLCM can be determined by homogeneity testing. In the evaluation of image encryption, the smaller the value of homogeneity, the higher the quality of the encrypted image [32]. Its mathematical formula is expressed as The values of the test results are collected in Tab.14. It can be seen that our algorithm has a small homogeneity value, which indicates that the proposed encryption scheme is excellent in both encryption quality and security.

L. KEY SENSITIVITY
Key sensitivity is an important index of encryption system, and can be tested in two ways: (i) vastly different cipher images should be obtained when encryption systems use slightly different keys to operate the same original image. (ii) even if the decryption keys are almost the same as the encryption key, the correct decryption image cannot be decrypted.
To test the sensitivity of the encryption process, that is, the first case mentioned above. First, make slight changes to the correct key, then encrypt Baboon (256 × 256), and finally compare the difference between the encrypted image with the correct key and the wrong key. Here, test values (x 0 , y 0 , z 0 , u 0 , a, b, c) as the modified object and all key values are given at the beginning in Sec. III. The amount of change is set to t = 10 −12 , take the modification of x 0 as an example: set x 0 = x 0 + t and keep the rest of the parameters unchanged. Perform the same operation on (y 0 , z 0 , u 0 , a, b, c), and finally seven encrypted images can be obtained, as shown in Fig.10(a)-(g). comparing the difference image of Fig.10(h)-(n), also proves that our encryption system is extremely sensitive to the key.
In addition, to test the key sensitivity in the second case. The key changes in the same way as the decryption process, and the decrypted image is shown in Fig.11. The difference between correctly decrypted and incorrectly decrypted images is presented numerically in Tab. 15.
Through a complete test of the sensitivity of the key, even if the attacker uses a nearly correct key, nothing useful can be obtained. This shows that our cryptographic system is extremely sensitive and can pass the key sensitivity test.

M. ROBUSTNESS ANALYSIS
Generally, the image and transmission process will inevitably be affected by noise and the loss of some data. The robustness noise tests include Gaussian white noise pollution and salt paper noise pollution, while the loss of data loss is simulated by cutting the image block.
Pepper image (256 × 256) is a test image and added with salt and pepper noises to perform noise contaminations with different parameters and the experimental results are presented in Fig.12. To further analyze the impact of noise, NPCR and UACI test values of pepper and salt noise and Gaussian noise under different noise parameters are presented in Tab.16 and 17, respectively. It can be seen from Tab.16 when the noise of pepper and salt is 1%, 3% and 5%, the influence is small, and when the noise is 10%, the influence is greater, but the overall outline is still visible. This shows that the algorithm can pass the salt and pepper noise attack test. although the Gaussian white noise test was slightly worse, the outline of the decrypted image was still clearly visible. It can therefore tolerate a certain degree of Gaussian noise attack. To verify this conclusion, Tab.17 shows the test results of Gaussian noise under different parameters. By analogy with the literature [34] and [36], We find that the performance of NPCR and UACI in the table is not as good as [34], but [36] compared to our NPCR is slightly larger but   the UACI is smaller. From this point of view, it also shows that our algorithm has a certain ability to resist Gaussian white noise attack.  In block loss operation, the cipher image data loss is set to 1/16, 1/8, 1/4 and 1/2 respectively and the experimental results are given in Fig.13. We can see from Fig.13 that the proposed algorithm can cope with information loss well. In summary, our algorithm has good robustness.

N. KNOWN-PLAINTEXT AND CHOSEN-PLAINTEXT ATTACK ANALYSIS
In general, known -plaintext and chosen -plaintext attacks can easily break encryption systems that are not sensitive to plaintext. They mainly select some special images to obtain encryption system keys and then decrypt the images. In this paper, the generation of the chaotic sequence is very sensitive to the change of plain image, which can be stated from the following two aspects: First, during the scrambling process, SHA 256 participates in the update of the initial value of the chaotic system, which means that once the encrypted image changes, the chaotic sequence will also change. Secondly, the DNA hamming distance used in the diffusion process is also determined by the encrypted image. These two characteristics determine that the encryption system is highly sensitive to the encrypted image, so known -plaintext -attack and known -plaintext attack is invalid to the system.

O. COMPUTATIONAL TIME ANALYSIS
The time consumption of the proposed encryption system is mainly in the following stages: chaotic sequence generation, scrambling operation, dynamic DNA coding and diffusion stage.
In the cryptography system mentioned in this paper, only one 4D chaotic system is used, but we use different initial values to put the chaotic system in the scrambling and diffusion stages, and finally produce two different sets of chaotic VOLUME 9, 2021   ×N ). Through the analysis of literature [34] and [36], it is found that the time complexity are O (4×M ×N ) and O (6×M ×N ), so our algorithm has certain advantages in time complexity, which may be because the chaotic system in this paper is connected, and the diffusion operation is block diffusion operation.
Finally, by calculating the encryption time of many images (House, Pepper, Barbara, and Baboon) with the size of 256 × 256 and 512 × 512, it is found that the time range consumed is 1.114s-1.232s and 5.236s-5.342s, respectively. Therefore, our algorithm has certain advantages in real-time communication.

VI. CONCLUSION
In this paper, a new 4D chaotic system is applied to image encryption for the first time. It has been proved rich dynamical behaviors through the analysis of phase diagram, LEs and BDs, so it is suitable for chaotic image encryption. In the permutation process, by observing the adjustment process of IAVL, a scrambling algorithm based on IAVL is proposed. In this scrambling, not only the rows and columns perform the circular motion, but also the exchange operation between the columns, which greatly improves the scrambling effect. Then, we designed a complex dynamic DNA coding technology. On this basis, the intra-block and inter-block diffusion algorithm is introduced. In the block, DNA addition, subtraction and XOR operations are dynamically selected to change the value of the pixel; the horizontal and vertical addition operations are implemented between blocks to achieve the diffusion effect. Experimental test results and security analyses are fully vindicated that our encryption scheme shows certain performance advantages in the face of classic performance tests and is easy to implement. Therefore, it is feasible in the field of digital communication.

AUTHOR CONTRIBUTIONS
Yuwen Sha carried out experiments, data analyzed and manuscript wrote. Yinghong Cao and Jun Mou made the theoretical guidance for this article. Huizhen Yan and Xinyu Gao improved the algorithm. All authors reviewed the manuscript.

CONFLICTS OF INTEREST
No conflicts of interests about the publication by all authors.