Chaotic Image Encryption Algorithm Based on Dynamic Spiral Scrambling Transform and Deoxyribonucleic Acid Encoding Operation

This article proposes a dynamic spiral scrambling algorithm, which is combined with the random pixel value filling operation, Deoxyribonucleic Acid (DNA) operation and used in image encryption. The random pixel value filling operation is to generate some random values and fill them around the plain-image. These values can influence all the pixels after the confusion and diffusion operations. The proposed dynamic spiral scrambling algorithm dynamically combines the chaotic sequences with the plaintext image, and scrambles the pixel values of the plaintext image, this operation makes the scrambling algorithm not fixed, and position changes are highly sensitive to the chaotic sequences, any slight change will get a completely different result. Then, this article combines Deoxyribonucleic Acid (DNA) coding and manipulation to further confuse pixel values. Finally, the average entropy is 7.9974, the average NPCR is 99.6067 and the average UACI is 33.4544, experimental results and various security analyses show that the algorithm has good encryption effects and can resist common attacks such as select plaintext attacks, cropping, and noise attacks.


I. INTRODUCTION
Nowadays, with the rapid development of internet technology and computer technology, the communication on the network is becoming more and more frequent. At present, it has become one of the most important means for humans to express information. As images are more and more widely used, the security of information transmission is receiving more and more attention, digital image encryption has become a hot topic for many scholars. The initial value sensitivity of chaotic systems, characteristics of pseudorandomness, ergodicity, parameter sensitivity and unpredictability [1], which can be well combined with image encryption, therefore, the combination of chaotic systems and image encryption to form an encryption algorithm based on chaotic image cryptosystems has become one of the hot The associate editor coordinating the review of this manuscript and approving it for publication was Sun Junwei . topics in the field of computer science [2]- [9]. Since the emergence of chaos theory, people's research on chaotic systems has gradually increased from low-dimensional to high-dimensional, and has changed from a static model to a dynamic model. In recent years, spatiotemporal chaos has been favored by scholars for its complex dynamic behavior. A lot of researches have been done on one-dimensional chaotic map, like Logistic chaotic map, Tent chaotic map, two-dimensional chaotic map, like Cat chaotic map, three-dimensional chaotic map, like Lorenz chaotic map, and spatiotemporal chaotic system, like Logistic-Dynamics Coupled Map Lattices (LDCML) spatiotemporal chaotic system [10], all indicate that cryptography based on chaos theory has become a popular research direction for researchers [11]- [14]. With the deepening of scholars' research, many chaotic systems and image encryption algorithms based on chaos theory have been proposed and achieved good results [15]- [23]. VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ The encryption algorithm is mainly composed of two stages of scrambling and diffusion. In short, ''scrambling'' changes the position of the pixel value, let it is not in the original position, diffusion is divided into pixel-level and bit-level diffusion, through some specific methods, like parallel diffusion method, diffusion using matrix semi-tensor product, and so on [24]- [28], the pixel value of the plaintext image is changed. An image encryption scheme based on a combination of hybrid genetic algorithms and Deoxyribonucleic Acid(DNA) sequences has broadened scholars horizons, through DNA encoding, decoding and pairing rules [29]- [31], the diffusion effect of pixel value is better, and by blurring the information in the original plaintext further can enhances the security of the image.
This article combines two-dimensional-logical adjusted sine map(2D-LASM), one-dimensional Logistic chaotic map, DNA coding method, sorting scrambling and random pixel value addition, hash function, a dynamic spiral scrambling transform is proposed to encrypt and decrypt images. This article uses 2D-LASM and one-dimensional Logistic chaotic map can quickly generate chaotic sequences fully meet the needs of this article without causing a lot of waste, and use two different chaotic maps to generate the key, which makes up for the shortcomings of a single one-dimensional chaotic map that is easy to be cracked, therefore, this article chooses 2D-LASM and one-dimensional Logistic chaotic map. The image scrambling algorithm is a classic encryption method, such as the classic Arnold transform, but the mapping is periodic, after a certain number of iterations, the original image is restored, the encryption process has a certain degree of security risks. Another example is the classic Zigzag scrambling method, although the position of the pixel values can be scrambled, there are certain disadvantages, for example, after the Zigzag scrambled matrix, the positions of the leading and trailing pixel values have not actually changed. Based on these shortcomings, this article proposes a dynamic spiral scrambling transform method for image encryption and decryption, this method can scramble all the pixel values in the matrix in one operation. The experimental results also show that the algorithm has good encryption performance and good performance in resisting various common attacks and statistical analysis.
The structure of the rest of this article is as follows: the second chapter briefly introduces the chaotic system, scrambling and diffusion methods used in this article, the third chapter is the detailed steps of the encryption algorithm in this article, and the fourth chapter is the simulation results of the experimental program and its safety analysis, the fifth chapter makes a simple analysis of the encryption and decryption performance of color images. Finally, the sixth chapter gives a brief summary of the entire article.

A. CHAOS SYSTEM
In this article, 2D-LASM and one-dimensional Logistic chaotic map are selected to generate the chaotic sequences used for encryption and decryption. After selecting appropriate parameters and initial values, chaotic maps can generate random chaotic sequences with good performance. The generated chaotic sequences are extremely sensitive to initial state and system parameters.
The definition of a Logistic chaotic map is: The definition of a 2D-LASM [16] is: Among them, the control parameter µ is between (0, 4) and x n is between (0, 1). A lot of previous studies have shown that in the one-dimensional Logistic chaotic map, when µ ∈ (3.5699456, 4], the Logistic chaotic map exhibits chaotic state, in order to achieve chaotic state, in practical application, the value range of µ should in (3.5699456, 4]. The generated chaotic sequence is aperiodic and non-converged, which is very sensitive to the initial value. To avoid the period window, the µ used in this article is in (3.89, 4]. Another chaotic map is 2D-LASM, for details, refer to ''(2)'', when µ 1 in [0. 37, 0.38]

B. SPIRAL SCRAMBLING TRANSFORMATION
The essence of the algorithm is to combine the chaotic sequences to change the pixel values position of the plaintext images. The general process of the algorithm is as follows. Firstly, the pixel value is selected according to the chaotic sequences generated by the chaotic maps. The selected pixel values are random. In a round of loops, each time a pixel value of a random position of the original plain image is selected, it is sequentially stored in a new one-dimensional matrix. After the end of the first round of the loop, the panning operation is performed, and then the second round of the loop is started, the operation is the same as the first round until all the pixel values of the original plaintext image are selected, finally, reduce it to a two-dimensional matrix of m × n. The algorithm is described as follows: For plain text image P[m, n]: Step 1. Perform random pixel value filling operation on the original image to prepare for the next ''spiral scrambling transform''. The matrix size after the operation is M × N , the added value will affect all the ciphertext after the subsequent scrambling and diffusion operation, it can improve the algorithm security. If the original image is a non-square image, the shorter side is padded with random pixel values. In order to change the position of all pixel values at once, the operation further changes M and N into odd numbers, and transforms them into square images with odd edges.
Step 2. Select the pixel value of the middle point. Refer to ''(3)'' and ''(4)'', take the pixel value at position i, j, that is P(i, j). M and N are the length and width of the image after performing the ''pixel value filling operation''.
Step 3. According to the chaotic sequence A 1 , the layers i 1 to be selected next is determined.
Step 4. Determining the entrance i 2 at which the pixel value selection operation starts according to another chaotic sequence A 2 .
Step 5. According to the binary bits 0 and 1 obtained by the chaotic sequence A 3 , it is determined whether the direction of the selected pixel value is clockwise or counterclockwise.
Step 6. After i 1 , i 2 and i 3 are determined, the pixel value is selected from the original matrix in a spiral manner.
Step 7. After the first round of the loop, the panning operation is started.
Step 8. Enter the second round of the cycle, the operation is the same as the first round.
Step 9. Each time a pixel value is selected, it is stored in a one-dimensional matrix B.
After the first spiral scrambling transformation operation is completed, the matrix B is obtained, and then the matrix B is sorted and scrambled according to the chaotic sequences, further confusing the pixel values. The semi-ciphertext image P 3 is obtained after the sorting and scrambling operation is completed.

C. DNA CODING METHOD AND OPERATION
Different DNA sequences have different nucleotides [32], [33]. Nucleotides contain four bases: A (adenine), G (guanine), C (cytosine), T (thymine). The bases are paired in pairs, A (adenine) and T (thymine) are complementary, G (guanine) and C (cytosine) are complementary. In the binary code, there are only 0 and 1, 0 and 1 are complementary, 00 and 11 are complementary, 01 and 10 are complementary. Therefore, A, G, C, and T can be used to encode 00, 11, 01, and 10 in binary. There is a total of 24 coding schemes, however, due to the complementary rules, only 8 encoding schemes are available. The eight coding schemes are shown in Table 1. In the process of encrypting the image, the original pixel gray value is converted into an 8-bit binary number, and the gray value of each 8-bit pixel can be represented by four encoded DNA sequences. For example, a pixel grayscale value of 201, a binary sequence representation of 11001001, encoding it according to the DNA encoding rules on the table, can result in eight combinations: TACG, TAGC, ATCG, ATGC, CGTA, CGAT, GCTA, and GCAT. In addition, the encryption algorithm also performs addition, subtraction, and XOR operations on the base pairs of DNA. Addition, subtraction, and XOR operations are listed in Table 2 to Table 4, respectively.

III. ENCRYPTION ALGORITHM
The encryption algorithm proposed in this article consists of three parts. Firstly, the plain image is first scrambled by using the dynamic spiral scrambling transform. Then, according to the chaotic sequences, it is sorted and scrambled again, and the pixel values are further confused. Finally, the encoding, decoding, addition, subtraction and XOR operation of DNA combined with the chaotic sequences to change the pixel values, these operations can make the system have better encryption effect and higher security. Assume that for a plaintext image P of size m × n, where m is the number of rows and n is the number of columns. The specific process of encryption is divided into the following steps.

A. KEY AND SYSTEM INITIAL VALUE GENERATION
The hash function is irreversible and anti-collision, can effectively resist known plaintext attacks, select plaintext/ciphertext attacks, so in this article, the Secure Hash Algorith-512(SHA-512) is selected [34], [35], the SHA-512 VOLUME 8, 2020 algorithm connects the plaintext and the ciphertext, it can better guarantee the encryption effect and security performance of the system, so that the initial key K is not static, but is constantly changing.
In order to improve the security of the system, a combination of two chaotic maps is used to generate the chaotic sequences. these chaotic sequences are used 3 times, and the total number of used sequences is 8 groups. The initial key K is converted into a decimal between 0 and 0.5 to obtain a key, bring it into the 2D-LASM to get x 0 , taking the other value in the initial key K as µ 0 , and the initial value µ of the one-dimensional Logistic is obtained by taking equation, for details, refer to ''(5)''. Iterate 200 times to obtain the first chaotic sequence A 1 , use the last value of A 1 as the initial value of the next iteration, and continue the iterative operation until all the chaotic sequences required by the system are obtained. The chaotic maps used in this article are detailed in equation, refer to ''(1)'' and ''(2)''.
In this article, the scrambling operation of the matrix is divided into two parts. Firstly, the plain image is scrambled by the dynamic spiral scrambling transform to obtain a matrix B, and then the matrix B is sorted and scrambled with a chaotic sequence to further confuse the pixel values.

1) DYNAMIC SPIRAL SCRAMBLING TRANSFORM
It can be seen from the foregoing operation that if the original image is a ''non-square non-odd edge'' matrix, it is operated to become a ''square odd edge'' matrix, so that the dynamic spiral operation algorithm can change the position of all pixel values in the matrix at once. The specific scrambling operation steps are as follows: Step 1. Starting from 1, a one-dimensional matrix h is generated in order, where the value is (1, i−1), and the elements in the one-dimensional matrix are sorted and scrambled according to the chaotic sequence A 6 . The value in the one-dimensional matrix h 1 is used to determine the number of layers i 1 selected by the spiral. The value of i is shown in the formula, refer to ''(3)'' Step 2. After determining the number of layers, the chaotic sequence A 7 is rounded, and is controlled between [1], [4] to select the entrance for starting the pixel value selection, the upper, left, lower, and right, entrances are numbered as 1, 2, 3, 4 respectively.
Step 3. After determining the selected entrance, according to the chaotic sequence A 5 , it is controlled within the range of (0, 255], and then converted into a binary number, according to 0 and 1 to determine the direction of pixel value selection, this article stipulates that 0 represents select the pixel value clockwise, and 1 to select the pixel value in the counterclockwise direction.
Step 4. A simple example of the loop operation is as follows. From the middle to the outside, set the number of layers to 0, 1, 2, 3×, first select the pixel value of the innermost layer, that is, the 0th layer, and store it in the first position of the one-dimensional matrix B, then select the number of layers i 1 according to the A 6 sorted by the chaotic sequence, assuming that i 1 is 2, that is, selecting the elements of the second layer, and then selecting the entrance i 2 according to A 7 , assuming that i 2 is 4 here. Finally, the direction i 3 of the selected element is determined according to A 7 , assuming that i 3 is 0 here, that is, clockwise selection. After selecting one layer, the next pixel value selection operation is started until each value in A 6 is traversed, and the first round of the loop ends. The 7 × 7 two-dimensional matrix is taken as an example. The selection operation is as shown in the Fig. 1. In this figure, the innermost green color is counted as the 0th layer, and the outward yellow grid is counted as the first layer. Blue is the second layer, brown is the third layer. . . and so on.
(3) Assume that i 1 is 1, i 2 is 2, and i 3 is 0. The operation of selecting pixel values is as FIGURE 1.
Step 5. After the end of the first loop, the remaining pixel values are transformed. Careful attention can be paid to the FIGURE 2. The blank area in the upper left corner is exactly the same as the shape of the blue selected area in the lower right corner. The pixel value of the blank area in the upper left corner is shifted to the blue area to cover the original pixel value, and the pixel value of the blank area in the lower left corner is translated to the orange area to cover the original pixel value, and the pixel value of the blank area in the upper right corner is shifted to the green area. Overwrite the original pixel value, and then shift the pixel value of the blank area in  the lower right corner to the upper left corner to cover the original pixel value.
Step 6. After the end of the panning operation, the operation of selecting the pixel values in the step 2, step 3, step 4, is performed again.
Step 7. The gray value of the selected pixel is stored in the one-dimensional matrix B in order, and the initial confusion of the plaintext image is completed, and finally the semiciphertext image P 2 of M × N is obtained.

2) SORT SCRAMBLING OPERATION
Next, the semi-ciphertext image P 2 is further confused by sorting and scrambling. The chaotic sequence A 2 sorts and scrambles the semi-ciphertext image P 2 to obtain P 3 .
First convert image P 2 into a one-dimensional sequence Sort() is a sorting function that sorts M × N decimals in the chaotic sequence A 2 from small to large. After the sorting is completed, the sorted position is obtained. The obtained positions are arranged, and the corresponding subscript of each element in A 2 in A 2 is stored as the sequence D. It is easy to know that D is an unordered scramble of the integer sequence from 1 to M ×N . The elements in P 2 are established from the first element P 1 to P Di , from the first to the end, and the positions are exchanged one by one, and then converted into the M × N image P 3 . So far, all the scrambling parts are completed. Figure 4 simply shows the steps of sorting scrambling.

C. DNA REPLACEMENT AND DNA MANIPULATION
The scrambling operation of transforming only the pixel value position is not sufficient to ensure the security of the encryption. The statistical analysis and other analysis methods can still obtain a lot of effective information in plaintext, in order to crack the encrypted image, so it is necessary to diffuse the pixel values. Changing the pixel values in the image can more effectively hide the plaintext information and better resist attacks, this article uses DNA encoding, decoding, addition, subtraction and XOR operations to solve the problem.
The DNA manipulation used in this article is divided into the following steps: First, the original image is encoded according to the chaotic sequence, and the DNA sequence C 1 is obtained, then the other two chaotic sequences are encoded to generate two other DNA sequences C 2 and C 3 . The DNA sequences C 1 , C 2 and C 3 complete a series of addition, subtraction and XOR operations to obtain the DNA sequence Z 1 to be decoded, finally decode the processed DNA sequence to complete the replacement process [30], [34], [35]. The specific operation process is as follows.
According to the chaotic sequence A 1 generated in the foregoing, the original image is encoded, the DNA sequence Z 1 after the operation is decoded according to A 2 , the DNA sequence to be operated is generated according to A 3 and A 4 , and the coding rule is generated according to the formula and used for DNA operation, the formula refer to ''(10)''. The sequences e 1 , e 2 , e 3 and the sequence d 1 used for decoding have values ranging from 0-7 to select which of the eight encoding methods of DNA.
Converting each pixel value of the scrambled image P 3 into binary, each original pixel value corresponds to the converted eight-bit binary bit, then encoding P 3 according to e 1 , and the encoded semi-ciphertext DNA sequence C 1 is obtained.
Chaotic sequences A 3 and A 4 are processed according to the formula, refer to ''(10)-(11)'', and their values range from 0 to 255. They are also converted into octet binary values, then encoded A 3 and A 4 according to the chaotic sequences e 2 and e 3 to obtain DNA sequences C 2 and C 3 .
After the DNA sequences C 1 , C 2 and C 3 are obtained, the addition, subtraction and XOR operations of the DNA are started. There is a total of 9 possible operation between the three DNA sequences, see the details, refer to ''(13)''. The chaotic sequence A 5 × 9 is rounded up to obtain a 5 , and its value is between 1 -9, which is used to select the 9 different situations, each operation corresponding to different e 1 , e 2 , e 3 , according to e 1 , e 2 , e 3 to determine different sequence rules. Addition, subtraction and XOR operation results in the result Z 1 .
The nine addition, subtraction, and XOR operation rules in DNA manipulation are as follows.
Finally, Z 1 is decoded according to d 4 , and the decoded binary sequence is obtained, converted into a decimal pixel value, and then restored to an image P 4 of M × N size.
At this point, the encryption process is all over. The decryption process is the reverse process of the encryption process, similar to the encryption process, and will not be described here. The encryption process is as FIGURE 5.

IV. EXPERIMENTAL RESULTS AND SAFETY ANALYSIS A. EXPERIMENTAL RESULTS
The plaintext images selected in this article are five images of ''Lenna'', ''Plane'', ''Pepper'', ''Black'' and ''White'', the size of the image is 256 × 256. FIGURE 6 -10 gives the plaintext images, the encrypted images and the decryption images of the above five grayscale images.

B. SECURITY ANALYSIS 1) KEY SECURITY ANALYSIS
The initial key K generated by SHA-512 in this article is 128-bit char type data, and the generated key is related to the plaintext image, then a series of operations on the key K are performed to generate the initial value of chaotic systems, the one-dimensional Logistic chaotic map and 2D-LASM  are iterated 200 times to make the system reach a state of full chaos, so as to obtain the key used for encryption. The key space of the algorithm is large enough and has a high correlation with the plaintext image. Even with a very small change to the initial key, the final result can change a lot. The following is a test of key sensitivity, after the image is encrypted, it is decrypted with the correct key, the correct original plaintext image can be obtained, only the first bit of the key is changed very slightly, by decrypting the ciphertext image, the correct original plaintext image cannot be obtained. FIGURE 11 shows the decryption test results of the correct key and the wrong key respectively. The experimental results show that although the key change is small, the result obtained by the decryption algorithm is completely different. The initial key is extremely sensitive. Let's take ''Lenna'' as an example: Correct key K : 7290ac041911f857e18384f8733337c0258057723bb56a dfad3549ad3bffc5d7f70066becfa8ddc20fbb32d2c618 8f1a24c4b766be65bf729e05646462ba349e Error key K : 6290ac041911f857e18384f8733337c0258057723bb56a dfad3549ad3bffc5d7f70066becfa8ddc20fbb32d2c618 8f1a24c4b766be65bf729e05646462ba349e

2) VARIOUS STATISTICAL ANALYSIS
After the image encryption program is completed, it is very important and necessary to perform statistical analysis. When cracking the ciphertext image, the attacker can sometimes use the statistical analysis method to find the ciphertext digital image, statistical anomaly, revealing the existence of hidden information, in order to achieve the purpose of cracking the encrypted image, in which the analysis of image histogram and the analysis of adjacent pixel correlation are two very important statistical characteristics in image encryption algorithm indicators, so we need to analyze them.

a: HISTOGRAM AND ITS ANALYSIS
The horizontal axis of the histogram represents the pixel value, the vertical axis represents the sum of the number of the pixel values in the figure, the distribution of pixel values in plaintext images is usually uneven. The ciphertext image processed by the encryption algorithm, the more uniform the distribution of pixel values, the better the performance against statistical analysis attacks, encrypted images are more secure. As shown in FIGURE 12 -13, the three images of ''Lenna'', ''Plane'' and ''Pepper'' are displayed before and after encryption, and the encrypted three histograms can be seen. The histogram distribution is uneven before encryption, the histograms of the three images after encryption are uniform.

b: ADJACENT PIXEL CORRELATION
In the unencrypted plaintext image, there is a strong correlation between adjacent pixels, which makes the security performance insufficient. In order to resist the attack of statistical analysis, the correlation between adjacent pixels must be reduced. The following formula is used to calculate the correlation between the plain image and the adjacent pixels of the ciphertext image, refer to ''(14)-(17)''. In this article, 3000 pairs of pixels are selected in the plaintext image and ciphertext image of ''Lenna'', the results are compared in three related directions: horizontal, vertical and diagonal. FIGURE 14 and FIGURE 15 show the correlation between adjacent pixels in the horizontal direction, vertical direction and diagonal direction of the ''Lenna'' image before and after encryption. It can be seen that the image before encrypting has a strong correlation in three directions, but that the pixel value distribution of the ciphertext image encrypted by the encryption algorithm in three directions is very uniform, and the correlation is greatly reduced.   cov(x, y)

c: INFORMATION ENTROPY AND LOCAL INFORMATION ENTROPY
Information entropy is an abstract concept in mathematics, which reflects the degree of ordering of information. The information entropy of a system is higher, it means that the system is more disordered. Conversely, the information entropy of a system is lower, it means that the system is more orderly. The value of information entropy can be calculated by the equation, refer to ''(18)''.
where p(s i ) represents the probability of occurrence. The closer the information entropy is to 8, the more disordered the pixel values of the encrypted image are, and the better the encryption effect is. Table 7 shows the information entropy of the three images ''Lenna'', ''Plane'' and ''Pepper''. The experimental results show that the information entropy of the image encrypted by the encryption algorithm is closer to 8, which can better resist statistical attacks.

3) RESISTANCE DIFFERENTIAL ATTACK ANALYSIS
Differential attacks are a choice of chosen plaintext attacks. The encryption algorithm can be attacked by comparing the VOLUME 8, 2020     propagation of the plaintext image after the encryption. The minimal change is made to the plaintext, so that the plaintext image before encryption and the ciphertext image after the encryption operation are obtained, and then the acquired data of the two images before and after the encryption are analyzed to obtain the key. Therefore, a good encryption algorithm should be able to resist differential attack analysis, that is, even if the change of plaintext is extremely small, the ciphertext will be greatly changed, so that it can resist the differential attack well. Here, the Number of Pixels Change Rate (NPCR) and the Unified Average Changing Intensity (UACI) are calculated. The detail is in equation, refer to '' (19)''.
where C 1 , C 2 represent two different images. M × N represents the size of image. If C 1 (i, j) = C 2 (i, j), then D (i, j) = 1, otherwise, D (i, j) = 0. In addition, Wu et al. establish a mathematical model for ideal encryption images and propose statistical hypothesis of NPCR and UACI [36]. The hypothesis of NPCR with α -level significance is where µ N = F/(F + 1) and it is the ideal value of NPCR.
where F denotes the largest supported pixel value, and M ×N is the size of image. φ −1 (α) is the inverse cumulative density function of the standard normal distribution. On the other hand, the hypothesis of UACI with α-level significance is where µ U = F (F + 2) / (3F + 3) and it is the ideal value of UACI. When UACI (C 1 , C 2 ) = (UACI * − , UACI * + ), we reject H 0 ,otherwise, we accept H 0 . The critical value UACI * − and UACI * + is defined as Eq. (23).
Here, we set α = 0.05. Then, we choose 22 grayscale images from the USC-SIPI database: 6 images of size 256 × 256, 16 images of size 512 × 512, and other commonly used images. For the images in the USC-SIPI database, we calculate the pass rate and compare it with other references, for the images of size 256 × 256, N * α = 99. It can be seen from Table 9 and Table 10 that the pass rate of this article is 100%, while the pass rate of references VOLUME 8, 2020 is lower than 100%. The comparison of the average values in Table 11 also shows that the algorithm in this article has NPCR and UACI values closer to the ideal value. So the encryption algorithm proposed in this article has better ability to resist differential attacks.

4) RESISTANCE TO CROPPING ATTACKS AND NOISE ATTACKS
In many image encryption systems, the cropping attack and the noise attack need to be tested to verify that the algorithm has robustness against cropping and noise attacks. Because the attacker cannot correctly decrypt the encrypted image during the information transmission process. In this case, the attacker usually uses the means of interfering communication to achieve the effect of preventing the recipient from decrypting, thereby achieving the purpose of the attack.
In the experiment, this article takes ''Lenna'' as an example, and cuts 1/16, 1/8, 1/4, 1/2 respectively. The image recognition performance after decryption operation is good, and the image after noise attack can also be recognized after decryption. These images can be restored to recognizable plaintext images, the experimental results show that the algorithm is very resistant to cropping attacks and noise attacks. Different levels of cropping and noise attacks and their recovery results are shown in FIGURE [16][17][18][19], and FIGURE 20.     the χ 2 , the more uniform the pixel distribution. Table 12 lists χ 2 values of all cipher images are much lower than that of plain images.

6) PSNR ANALYSIS
The full name of PSNR is Peak Signal to Noise Ratio, which is an evaluation index of the quality of the full   reference image. PSNR is often used to calculate the degree of difference between the ciphertext image and the ciphertext image after cropping. Objectively evaluate the degree of error between images based on corresponding pixel values. That is, based on error-sensitive image quality evaluation. The PSNR algorithm is simple and the inspection speed is fast, but the difference value it presents is sometimes not proportional to the subjective feeling of the person. The results of the PSNR are shown in Table 12.
In equation (26), P max is the maximum gray value of the plain text image, and P max = 255. P(i, j) is the pixel value of (i, j) after the plain text image is encrypted. C(i, j) is the pixel value of (i, j) after cropping the ciphertext.
As you can see from Table 13, the algorithm proposed in this article has a smaller PSNR. It shows that there is a great difference between plaintext and ciphertext., so the algorithm proposed in this article has higher security.

7) ENCRYPTION SPEED
The proposed algorithm is implemented in matlab 2017 and deployed on the computer with the Intel Core i5-5200 CPU, VOLUME 8, 2020  Table 14 shows the key generation time, encryption time, decryption time of this algorithm and its comparison with other references.

8) KEY SPACE
The key space should be large enough to make brute-force attack infeasible. In the proposed algorithm, The initial values y ∈ (0, 1), z ∈ (0, 1), the parameter µ ∈ ( So the key space of this algorithm is greater than 2 100 , the key space is large enough to resist brute-force attack.

9) TIME COMPLEXITY
This algorithm will make unconventional images into regular images through ''random pixel value filling operation'', so the time complexity of this algorithm is O(max(M , N ) × max(M , N )), M and N are the length and width of the image respectively.

10) NIST TEST
NIST test includes 15 tests. It can be used to estimate the randomness of a binary sequence. Each test gives a significance level α (α = 0.001), The probabilistic value (P-value) is obtained after statistical results. If P-value ≥ α, the sequence is random. If P-value < α, the sequence is non-random. For an ideal encryption algorithm, the P-value of the cipher image should be greater than α. Table 15 lists NIST test of plain and cipher image of ''Lenna''.

V. COLOR IMAGE PERFORMANCE ANALYSIS
In this chapter, the encryption algorithm of color image is briefly introduced and experimented, and some simple security analysis is also carried out.

A. COLOR IMAGE ENCRYPTION AND DECRYPTION RESULTS
The color image encryption process is actually the same as the gray image process. The color image is decomposed into three gray images of R, G, and B. The three gray images are encrypted separately, and then decrypted. Synthesize the three images, that is, the color image after the encryption is successful. In this article, the ''Fruits'' are used as an example to perform the encryption and decryption operations. The encryption and decryption results are shown in FIGURE 21-24.

B. COLOR IMAGE PERFORMANCE ANALYSIS
The performance analysis of a color image is to decompose the color image into three images of R, G, and B.
After analyzing the performance of these three images, the following is a histogram analysis, correlation analysis, anti-cutter, noise attack analysis of three images of R, G, and B.

1) COLOR IMAGE STATISTICAL ANALYSIS a: HISTOGRAM ANALYSIS
Here, the color image is decomposed into three images of R, G, and B. The histograms of the R image before and after encryption, the histogram of the G image, and the histogram of the B image are given respectively. It is found that the histograms of the first three images are obviously uneven. The histograms of the cipher text after encryption are obviously even. See details in FIGURE 25 and FIGURE 26.

b: CORRELATION ANALYSIS
Here, the color image is decomposed into three images: R, G, and B. The horizontal correlation of the R image before encryption, the vertical correlation of the G image, and the diagonal correlation of the B image are given. It can be seen that the pixel distribution of the first three images is very compact and the correlation between the pixel values is strong. At the same time, the horizontal correlation of the encrypted image R image, the vertical correlation of the G image, and B are also given. The diagonal correlation of the image, it can be seen from the figure that the       The cropping and noise attack analysis of color images are to perform a cropping or noise attack on the three images R,    G, and B respectively, and then combine the three ciphertext images after the attack into a color image. We chose to crop 1/8 and perform a 0.05 salt and pepper noise attack on it. The decryption results after the attack are shown in FIGURE 29 and FIGURE 30.

d: NPCR AND UACI FOR COLOR IMAGES
As shown in Table 16, the NPCR and UACI of the R, G, and B components of the encrypted color image were tested, and the test data showed good results. e: χ 2 TEST OF COLOR IMAGE As shown in Table 17, the R, G, and B components of the encrypted color image were tested for χ 2 and compared with the data before encryption. The data in the table shows that the encrypted data is greatly reduced. The data showed good results.

VI. CONCLUSION
This article proposes a dynamic spiral scrambling algorithm based on chaotic system, which can be implemented from special to general. According to different plaintexts, each encryption operation generates different key, and the scrambling operations on the plaintext images are not the same, at the same time, this article combines with the random pixel value filling operation, different random pixel values will be generated during each encryption process, and these random pixel values will affect other pixel values during the encryption process. In theory, this makes the cracking more difficult. The experimental results also show that the algorithm can encrypt and decrypt black and white images, grayscale images and even color images, and the analysis of the experimental results also shows that the algorithm not only has good effects in encryption, but also resists common attacks. It also has good performance. It can prove the performance of the algorithm through key sensitivity test, histogram analysis, correlation analysis and differential attack. At present, the algorithm is still in the theoretical stage. The experimental results and various security analysis show that the algorithm has good encryption effect and can resist common attacks, such as clear-text attack, cropping, noise attack, etc. The algorithm can be used for image encryption.