A Novel Chaotic Image Encryption Scheme Armed with Global Dynamic Selection

Due to the equivalent keys revealed by a chosen-plaintext attack or a chosen-ciphertext attack, most of the existing chaotic image encryption schemes are demonstrated to be insecure. In order to improve security performance, some scholars have recently proposed the plaintext-related chaotic image encryption scheme. Although the equivalent effect of a one-time pad is achieved, an additional secure channel is required to transmit the hash values or other parameters related to the plaintext before the ciphertext can be decrypted at the receiving end. Its main drawback is that an absolutely secure channel is needed to transmit the information related to the plaintext, which is not feasible in practical applications. To further solve this problem, this paper proposes a chaotic image encryption scheme based on global dynamic selection of a multi-parallel structure. First, a chaotic sequence is employed to dynamically select DNA encoding rules. Secondly, the permutation with a multi-parallel structure is performed on the DNA-encoded matrix, and the DNA decoding rules are dynamically selected according to another chaotic sequence. Finally, the diffusion rules obtained by the ciphertext feedback mechanism are introduced to determine the dynamic diffusion. Compared with the existing local dynamic encryption schemes, the main advantage of this scheme is that it can realize global dynamic selection, so as to ensure that there is no equivalent key, and it can resist the chosen-ciphertext attack or chosen-plaintext attack and does not need an additional secure channel to transmit parameters related to plaintext, which is practical. A theoretical analysis and numerical experiments demonstrate the feasibility of the method.


Introduction
With the development of today's science and technology, all aspects of people's lives have undergone informatization [1,2]. As a medium in the information age, images can directly convey the message that people want to express [3]. Information technology has an increasing impact on personal privacy, medicine, and social interaction. Once the important information in the image is intercepted or tampered with by the attackers, the damage caused cannot be ignored [4,5]. Therefore, it is very important to protect the safe transmission and reception of image data. In order to ensure the security of digital images, researchers have proposed many image encryption methods based on different technologies [6][7][8].
Generally speaking, image encryption algorithms are mainly divided into two operations: permutation and diffusion [9]. Permutation changes the position of pixels, and its main purpose is to break the correlation between the adjacent pixels of an image. Diffusion changes the pixel value of each pixel in a specific way to achieve the purpose of protecting image information. In essence, diffusion is the operation of changing the pixel value [10,11]. Chaotic systems have the characteristics of pseudo-randomness, initial value sensitivity, parameter sensitivity, and unpredictability [12], which can be applied in the field of image encryption [13,14]. The chaotic sequence generated by the chaotic system iteratively participates in the permutation and diffusion, so as to improve the security of the cryptographic system. Due to the characteristics of chaotic systems and the high adaptability of image encryption technology, chaotic image encryption technology has gradually attracted the attention of researchers [15,16].
With the deepening of research on chaotic image encryption technology, chaotic image encryption algorithms are mainly divided into three categories [17,18]. The first type is encryption by a self-synchronous stream cipher, which does not require an additional secure channel and is practical [19][20][21][22][23]. The second type is encryption related to plaintext; this scheme has no equivalent key, and it is difficult to crack, but the premise is that additional parameters, such as the hash value, need to be assumed to be transmitted through an additional secure channel, which is not practical. Although Chai et al. improved on this basis by embedding key parameters into the cipher image and transmitting it together with the latter cipher image, it can not resist cropping attacks well [24]. The third type is a hybrid encryption that combines other technologies, such as local dynamic encryption, which does not consider the equivalent key and other situations and has difficulty resisting chosenplaintext or chosen-ciphertext attacks. For example, Xian proposed a fractal sorting matrix and its application in chaotic image encryption [25]. The pixel positions in each round of permutation are the same, and the diffusion is orderly, which reduces the dynamics and randomness of the scheme. These make the scheme less secure [26][27][28].
In order to make the chaotic image encryption scheme dynamic and flexible, some encryption links with parallel structures are considered in permutation and diffusion [29][30][31][32]. In 2018, Yin proposed a chaotic image encryption scheme based on a breadth-first search and dynamic diffusion [33]. In 2019, Li proposed a chaotic image encryption method with orbit perturbation and dynamic state variable selection mechanisms [34]. In the same year, Meysam proposed a chaotic image encryption scheme based on a polynomial combination of chaotic maps and dynamic function generation [35]. In 2021, Wu proposed a plaintextrelated dynamic key chaotic image encryption method [36]. These schemes use local dynamic selection to improve flexibility and multi-selectivity in the encryption [37][38][39].
In order to further improve the flexibility of a chaotic image encryption scheme, this paper proposes a chaotic image encryption scheme based on global dynamic selection to realize the dynamic selection of bit-level, pixel-level, and image-level encryption by designing a multi-parallel structure. First, DNA encoding rules are dynamically selected according to the chaotic sequence. Then, the DNA-encoded matrix is dynamically permuted. Next, the DNA decoding rules are dynamically selected according to the chaotic sequence. Finally, dynamic diffusion is performed by the diffusion rules obtained by different locations. The main feature of this scheme is that it can realize global dynamic selection, so as to ensure that this scheme cannot crack the equivalent key and can resist chosen-plaintext attacks and chosen-ciphertext attacks. Our scheme does not need to use an additional secure channel to transmit parameters related to plaintext, so it is practical. The simulation results and the performance analysis show that the designed scheme has high security and good performance indicators.
The remainder of this research work is organized as follows. The overall framework of the scheme and the basic theory of 2D-LSM, DNA coding, dynamic permutation, and dynamic diffusion are given in Section 2, while the security of the scheme is analyzed theoretically in Section 3. Simulation experiments and performance analysis are detailed in the Section 4. This article ends with a Conclusion section in which the contributions are summarized (Section 5).

Chaotic Image Encryption Scheme
This paper proposes a chaotic image encryption scheme based on global dynamic selection. Its design idea is to build a multi-parallel structure, and its main feature is to realize dynamic selection through the multi-parallel structure design in encryption. First of all, all encryption processes in this scheme are called "global". Secondly, for an image to be encrypted, the orders of magnitude of each encryption process are the bit level, pixel level, and image level, respectively, i.e., processing an image at the bit level, pixel level, and image level can also be called global. Dynamic means that when encrypting the same order of magnitude, the encryption rules executed on the same process will change instead of being fixed. Specifically, at the bit level, it is realized through the DNA encoding process and the DNA decoding process. For every two adjacent bits, their rules of DNA encoding and DNA decoding are different. The pixel level is completed by dynamic diffusion, and the diffusion equation performed by every two adjacent pixels is different. The image level is realized by dynamic permutation; for the same image, the first round and the second round of the permutation are determined by the calculated permutation rule value. The permutation rule value is not fixed, and each number corresponds to a rule. The so-called parallel structure means that within the same encryption process, there are multiple available encryption rules. For example, in dynamic diffusion, each pixel will have two diffusion methods, but the specific implementation of the diffusion method can only be known after the diffusion rules are determined. However, encryption with a non-parallel structure often has only one rule to perform encryption, and the encryption method has been fixed. By designing a parallel structure, each encryption process has multiple parallel encryption rules, and the specific process rules in encryption are selected by the chaotic sequence, permutation rule value, and diffusion rule value.
Different from the existing schemes, the main feature of this scheme is that, even if it is not related to the plaintext, the equivalent key cannot be cracked within a limited number of years. The existing dynamic encryption is mainly local dynamic encryption. Local dynamic encryption realizes dynamic selection in some processes of encryption. We propose an encryption scheme with global dynamic selection to achieve dynamic selection in all processes of encryption. At the same time, it also realizes dynamic selection from the three aspects of the bit level, pixel level and image level for the first time. In the process of DNA encoding and DNA decoding, DNA encoding and decoding rules are selected according to the chaotic sequence to realize dynamic selection at the bit level. In the dynamic permutation, according to the permutation rule value, the permutation method is dynamically selected to realize the dynamic permutation at the image level. In dynamic diffusion, the diffusion equation of each pixel is selected through the diffusion rule value to achieve dynamic selection at the pixel level.
As the number of encryption rounds increases, the permutation method and diffusion equation performed by the first round and the second round of encryption will change due to the permutation rule value and the diffusion rule value. The encryption rules executed in different rounds are different. This reflects the characteristics of dynamic selection. The global dynamic selection feature of the scheme is reflected in two aspects:

1.
All elements of an image can be classified into bit level, pixel level, and image level. This scheme dynamically selects a specific encryption from these three levels to encrypt the image.

2.
Using the chaotic sequence and the designed multi-parallel structure, the design concept of dynamic selection is reflected in the encryption rules that need to be selected and executed for each process.

Scheme Description
The block diagram of the proposed image encryption scheme is shown in Figure 1. Without loss of generality, an encrypted object can be reduced to an image P of size L = M × N, represented by a two-dimensional (2D) eight-bit integer matrix P = {p(i, j)} M,N i=1,j=1 ; the final cipher image obtained after encryption through this scheme is C = {c(i, j)} M,N i=1,j=1 . Each piece of two-dimensional image data can also be written as a one-dimensional (1D) array scanned in raster order (left to right, top to bottom). For example, P = {p(i)} L i=1 . In Figure 1, the single-throw switch K 1 is turned on first, and, after entering the plain image P, K 1 is disconnected, and the double-throw switch K 2 is connected to position one. The image, after the first round of encryption, is fed back to the input for the second round of encryption. Then, connecting K 2 to position two outputs the cipher image. In Figure 1, I, S, E, D, R S , and R D are the DNA-encoded matrix, permutation matrix, DNA-decoded matrix, diffusion matrix, permutation rule value, and diffusion rule value of the encrypted image. In this scheme, the sub-block diagram of "2D-LSM" is a two-dimensional chaotic system proposed by Hua et al. [17], and the mathematical expression of the iteration function is: where h(i), w(i) ∈ [0, 1]. The system is in a chaotic state when α,β ∈ [1, 100]. This chaotic system has a total of four key parameters {h(0), w(0), α, β}, The system is iterated by the first set of initial key parameters {h 1 (0),w 1 (0), α 1 , β 1 } to obtain the chaotic sequences A and B. The system is iterated by the second set of initial key parameters {h 2 (0),w 2 (0), α 2 , β 2 } to obtain X and Y. This scheme realizes bit-level dynamic selection through sub-block diagrams of "Dynamic DNA encoding I" and "Dynamic DNA decoding E". The process of DNA encoding is to divide each eight-bit binary pixel of image P into four two-bit binary bit pairs, according to the corresponding value in A. The DNA encoding rule to be executed is dynamically selected to realize the DNA encoding from the number matrix to the symbol matrix. The DNA-encoded matrix I is obtained. The process of DNA decoding is the opposite of that of DNA encoding. According to the corresponding value in B, the decoding rule is dynamically selected to decode each of the four symbols into an eight-bit binary pixel, and the DNA decoding matrix E is obtained.
The sub-block diagram of "Dynamic permutation S" realizes the dynamic selection of different permutation methods for the DNA-encoded matrix I and introduces the permutation rule value R S to select and execute four different permutation methods. R S is determined by the symbol values of the four corners of the matrix I, and the matrix after dynamic permutation is denoted as S.
Through the sub-block diagram "Dynamic diffusion D", the dynamic diffusion of pixels in different positions of the DNA-decoded matrix E is realized. According to the diffusion rule value R D , select the specific execution rule from two different diffusion rules, and the image after diffusion is D. R D is obtained by feedback from the DNA-decoded matrix E, chaotic matrix X and diffusion matrix D. D is obtained by substituting the feedback of the DNA-decoded matrix E, the chaotic matrix Y, and the diffusion matrix D into the diffusion equation determined by R D .
K 1 is a single-throw switch, which is used to cut off or connect the plaintext input encryption system; K 2 is a double-throw switch, which is used to connect the feedback loop when K 2 is at one and to connect the ciphertext output branch when K 2 is at two. The ciphertext output branch is used to output the final encrypted cipher image.

The Encryption Process
This section will introduce the encryption process of this scheme, and the detailed process is as follows: (1) Initialization: Iterate the 2D-LSM chaotic system 800 times from the initial conditions h 1 (0), w 1 (0) with the control parameters {α 1 , β 1 } to avoid the transient effect in the initial iteration, and then iterate it 4L more times to obtain the two state sequences where f ix(·) is the rounding down function, mod(·) is the modulo operation, and i = 1, 2, · · · , 4L. Iterate the 2D-LSM chaotic system 800 times from the initial conditions h 2 (0), w 2 (0) with the control parameters {α 2 , β 2 } to avoid the transient effect in the initial iteration, and then iterate it L more times to obtain two state sequences can also be written as two-dimensional eight-bit integer matrices, , by scanning them in raster order. Quantize them to two eight-bit integer sequences where f ix(·) is the rounding down function, mod(·) is the modulo operation, and i = 1, 2, . . . , M; j = 1, 2, . . . , N.
(2) DNA encoding: The switch K 1 is closed, so that each pixel p(i)(i = 1, 2, . . . , L) in P corresponds to four two-bit binary pairs. Then, use the a(4i − 3), a(4i − 2), a(4i − 1), a(4i) column encoding rules in Table 1 to transform them into DNA symbols. Because one pixel corresponds to four symbols, the matrix P will be reshaped into a symbol matrix j=1,k=1 with M rows and 4N columns, consisting only of "ATCG".
(3) Dynamic permutation: Calculate the permutation rule value R S according to the pixel position value of the DNA-encoded matrix and perform the corresponding permutation to obtain the permutation image S. The expression of R S is where the DNA symbol is converted into binary according to "A = 00, G = 01, C = 10, T = 11". Then, the addition operation of Equation (4) is performed, and mod(·) is the modulo operation.
Since the Modulo 4 operation is performed when calculating R S , R S satisfies R S ∈ 0, 1, 2, 3. The matrix of M × N(M = 4, N = 4) illustrates the permutation according to R S .
When R S = 0, transpose the symbol matrix I, as shown in Figure 2. When R S = 1, from i = 1 to f ix(M/2), the i-th and M + 1 − i-th of the symbol matrix I exchange the entire row, as shown in Figure 3. When R S = 2, from i = 2 to f ix(N/2), the i-th and f ix(N/2) + i − 1-th of the symbol matrix I exchange the entire column, as shown in Figure 4. When R S = 3, from i = 2 to f ix(M/2), the i-th and f ix(M/2) + i − 1-th of the symbol matrix I exchange the entire row, as shown in Figure 5.
(4) DNA decoding: Select the rules in Table 1 for dynamic DNA decoding of the permutation image S according to the corresponding values in sequence B, decode S in the raster scanning order, combine the four symbols into one pixel, and obtain a DNA-decoded matrix E = {e(i, j)} M,N i=1.j=1 with M rows and N columns. (5) Dynamic diffusion: According to the DNA-decoded matrix E, the chaotic matrix X, and the diffusion matrix D, dynamically calculate the diffusion rule value R D = r(i, j) (i = 1, 2, . . . , M; j = 1, 2, . . . , N) at different positions of E, where the mathematical expression of r(i, j) is where r(i, j) ∈ {0, 1}, mod(·) is the modulo operation, and ⊕ is the exclusive OR operation. The diffusion rule value R D determines the diffusion rule performed by the pixel at different positions of E, and the diffusion image is Figure 6 shows how to obtain the diffusion rule value R D = r(i, j)(i = 1, 2, . . . , M; j = 1, 2, . . . , N) for an image of 3 × 3.
is obtained as follows: where , and a, b, c ∈ {0, 1, 2 . . . , 255}.  (6) Disconnect K 1 , connect K 2 to position one, and use the diffusion image D as the input image for the next round of encryption. (7) The second round of encryption: Repeat steps (3)-(6) to make K 2 connect to position two. Then, the final cipher image C can be obtained.
The decryption process is the inverse process of encryption, and decryption can be completed by operating the above steps in reverse order. The main steps of decryption are given here.
(1) Inverse dynamic diffusion: Record the inverse diffusion rule value as N). According to the inverse diffusion rule value R −1 D , choose the inverse diffusion equation at different positions to obtain E, The matrix E = {e(i, j)} M,N i=1.j=1 , before diffusion, is obtained as shown in Equation (7). where and a, b, c ∈ {0, 1, 2 . . . , 255}.
(2) Inverse DNA diffusion: The pixels in E are dynamically decoded according to the corresponding values in sequence B in the raster scanning order, and the corresponding four binary pairs are converted into the DNA symbol matrix S by the b(4i−3), b(4i−2), b(4i−1), b(4i) column coding rules in Table 1.
(4) Inverse DNA encoding: According to the corresponding value in sequence A, the DNA coding rule in Table 1 is dynamically selected to reverse encode I to obtain the DNA-decoded matrix P.
During encryption, both the permutation rule value R S and the diffusion rule value R D will change with the number of rounds to achieve the purpose of dynamic rule selection, so as to flexibly use different permutation rules and diffusion rules. When the image is encrypted, different permutation rules will be implemented for different encryption rounds, so as to realize dynamic permutation at the image level. In dynamic diffusion, the diffusion rule value of each pixel will also change dynamically with the pixel position, and the diffusion rule value of each round will also change dynamically with the number of encryption rounds, achieving dynamic diffusion from the pixel level. For different images to be encrypted, R S depends on the special location pixels of the input image to be encrypted after DNA encoding and the different images to be encrypted by different permutation rule values. The diffusion rule value R D is mainly determined by the image before diffusion E. The permutation image S and the chaotic matrix X, and the diffusion rule value R D will also change as the number of rounds of encryption changes the DNA-decoded matrix E and the permutation image S.
Setting the number of feedback rounds to one can not only reflect the characteristics of dynamic diffusion rules changing with the number of rounds but also reflect the dynamic selection and the multi-parallel structure. Too many rounds will definitely affect the encryption efficiency. In this scheme, as the number of rounds changes, fewer rounds can be used to achieve the core advantages of the scheme, namely the dynamic, parallel structure and the dynamic diffusion rule matrix R D . Through the global dynamic selection feature, the combination of encryption methods for any one-bit pair change is 2 9 , and the combination of encryption methods for any pixel change is 2 27 . This is the main difference between the parallel structure proposed in this paper and the existing non-parallel structure.

Equivalent Key Analysis
The core of the scheme's security lies in the ciphertext feedback mechanism and dynamic selection characteristics. Through these two characteristics, the cost of finding special plaintext pairs that are conducive to cracking is significantly higher. This section theoretically analyzes the ciphertext feedback mechanism and dynamic selection characteristics in this encryption scheme to illustrate the effect of the ciphertext feedback mechanism and the dynamic selection feature on the security of the scheme.

Analysis of Ciphertext Feedback Mechanism in Diffusion
The expression of the ciphertext feedback mechanism reflected in the diffusion is shown in Equation (6). In order to better study the effect of the ciphertext feedback mechanism, let the image before diffusion be E ={e(i, j)} M,N i=1,j=1 , and the image after diffusion be D ={d(i, j)} M,N i=1,j=1 . Transform Equation (6) into where and a, b, c ∈ {0, 1, 2 . . . , 255}.
Supposing that the diffusion images in the first round are D 1 = d 1 (i, j) and D 1 = d 1 (i, j), the diffusion images in the second round are D 2 = d 2 (i, j) and D 2 = d 2 (i, j), and the final cipher images are C = c (i, j) = D 2 and C = c (i, j) = D 2 , respectively.
For the first round of encryption, ∆d 1 (i, j) = d 1 (i, j) ⊕ d 1 (i, j) is unpredictable at (i = q, q + 1, . . . , M; j = l, l + 1, . . . , N), but in the second round of encryption, d 1 (i, j) and d 1 (i, j) are used as the input images, and the unpredictability of d 1 (i, j) and d 1 (i, j) is transmitted to other positions of the image by DNA encoding, dynamic permutation, and DNA decoding, applying the unpredictability of a single pixel to all pixels in the image. In addition, the input images D 1 and D 1 in the second round are uncontrollable for the attacker, and it is difficult to directly select a special plaintext pair to obtain a partially controllable ∆d(q, l) = c (q, l) ⊕ c (q, l) = d 2 (q, l) ⊕ d 2 (q, l) = 0 by chosen-plaintext attack, so that the equivalent key Y = {y(i, j)} M,N i=1,j=1 cannot be cracked.
. For the ciphertext feedback mechanism of the first round of the diffusion rule ∆R D1 = r(i, j)(i = 1, 2, . . . , M; j = 1, 2, . . . , N), the expression is as follows: The diffusion rule value difference ∆R D1 = r 1 (i, j)(i = 1, 2, . . . , M; j = 1, 2, . . . , N) can be simplified to is the extracted ciphertext-related factor. To better study the effect of ciphertext feedback mechanisms in this process, it is assumed that there are different where the subscript 1 represents the first round of encryption, i.e., ∆G 1 = G 1 ⊕ G 1 = 0. G 1 (i, j). The diffusion rules corresponding to G 1 (i, j) and Specifically, suppose G 1 (i, j) and G 1 (i, j) exist, and ∆G 1 (q, l) = G 1 (q, l) ⊕ G 1 (q, l) = 0, where q ∈ {0, 1, 2, . . . , M} and l ∈ {0, 1, 2, . . . , N}. After the ciphertext feedback mechanism, the unpredictability of (q, l) is passed to the next pixel of (q, l), and so on, eventually making the value of the number of diffusion rules that need to be exhausted are in the range of (M ≥ i ≥ q, In the second round of encryption, the ciphertext-related factors in the corresponding diffusion rules of C and C are respectively. Since the unpredictability of C and C also makes G 2 (i, j) and G 2 (i, j) unpredictable, this makes the second round of the permutation rule R D2 = r(i, j) (i = 1, 2, . . . , M; j = 1, 2, . . . , N) more unpredictable. Based on this, and because of the dynamic nature of r(i, j), r(i, j) in each location is unpredictable, the attacker needs to exhaust all cases. For a M × N-size image, the second round of the diffusion rule value R D2 needs to be exhausted 2 M×N , and the total number of exhaustive times for R D1 and R D2 in the case of two rounds of encryption is 2 M×N According to the development of the limit of exhaustive attacks based on Moore's Law, the limit of exhaustive attacks in 2022 is 2 87 , and the limit of exhaustive attacks in 2050 will be 2 109 [39]. For the existing effective image size, it is easy to satisfy that 2 M×N is larger than 2 109 , and there are 256 × 256, 512 × 512, and 1024 × 1024, which are far greater than the 2 109 required for the key space.

Key Space Analysis
Any chaotic image encryption scheme has a key space larger than 2 100 to ensure that it can withstand brute force attacks. The key space mentioned here means that the chaotic digital image system uses a key with a specified length.
In this scheme, the 2D-LSM system is in a chaotic state within the parameter range from h(i), w(i) ∈ [0, 1] to α, β ∈ [1, 100]. With a finite precision of 10 −15 , there are S h = 10 15 , S w = 10 15 , S α = 9.9 × 10 16 , and S β = 9.9 × 10 16 , and the calculation formula for a set of parameter key spaces is as follows: Because two sets of key parameters are set, the overall key space of this scheme is S = 9.801 × 10 63 2 = 9.61 × 10 129 ≈ 2 421 , which is much larger than 2 100 , which meets the key space requirements of the encryption scheme.

Simulation Experiments and Performance Analysis
The experimental hardware platform is a PC, and the processor is Ryzen 5 5600 G AMD, The benchmark frequency is 3.90 GHz, the memory size is 16 G, the hard disk is a 128G SSD, and the HDD is 1 T. The software environment is the Windows 10 operating system and Matlab R2019a.
In this section, to demonstrate the security of our scheme, a grayscale image of the size 256 × 256 is used as the plain image. The initial keys are The original plain image encrypted with the number of feedback rounds is one to illutrate the encryption performance indicators. The relevant experimental results are shown in Figure 8

Histogram Analysis
An image histogram is a frequency statistic for each grayscale level in an image. The histogram shows the distribution of grayscale in the image. For the distribution of pixel intensity in the image, the histogram of the cipher image obtained by a secure encryption scheme should be as flat and uniform as possible. A more evenly distributed histogram means a better ability to resist statistical attacks, as shown in Figure 9. The plain images of Lena, Cameraman, and Peppers with their histograms and the ciphertexts with their corresponding histograms are shown in Figure 9. It can be seen that the grayscale distribution of their original image has many peaks and valleys, but, in the encrypted grayscale image, the grayscale distribution is very uniform. Therefore, it can be confirmed that the scheme we designed has the performance of resisting statistical attacks.

Correlation Analysis
Since adjacent pixels of common images are highly correlated in horizontal, vertical, and diagonal directions, this indicates that adjacent pixels often have similar and predictable features. An ideal image encryption scheme should have sufficiently low correlation coefficients in the horizontal, vertical, and diagonal directions to resist statistical attacks.
To highlight the influence of the encryption scheme proposed in this paper on eliminating the high correlation of planar images, their correlation in the horizontal, vertical and diagonal directions was calculated by where and N is the number of randomly chosen adjacent pixel pairs along the horizontal direction, vertical direction, and diagonal direction in both the plain image and its cipher image. u i and v i are the i-th items of the two adjacent pixel sequences u and v. Figure 10 demonstrates the adjacent pixel correlation plots of the arbitrarily chosen 2000 sets of nearby pixels in Lena, Cameraman, and Peppers along the horizontal, vertical, and diagonal orders. It can be observed that, in each figure, the X-axis indicates the three images, while the Y-Z plane plots the values of the adjacent pixels. The adjacent pixel pairs of the plain images are mostly on or close to the diagonal lines, indicating that these adjacent pixels exhibit strong correlations. However, the adjacent pixel pairs for all cipher images are distributed quite randomly across the Y-Z phase plane, demonstrating that they exhibit weak correlations. This indicates that our proposed scheme can efficiently decorrelate the high correlations of the plain images. Figure 10. Histograms of Lena, Cameraman, and Peppers: (a) horizontal adjacent pixel pairs of three plain images, (b) vertical adjacent pixel pairs of three plain images, (c) diagonal adjacent pixel pairs of three plain images, (d) horizontal adjacent pixel pairs of three cipher images, (e) vertical adjacent pixel pairs of three cipher images, (f) diagonal adjacent pixel pairs of three cipher images. In each figure, the X-axis denotes the index of the three images, while the Y-Z plane plots the pixel pairs. The correlation distribution results are shown in Table 2, where we calculate the correlation coefficients of adjacent pixels in the horizontal, vertical, and diagonal directions of Lena, Cameraman, and Peppers and images 4.2.05, 4.2.06, and 4.2.07 with 512 × 512, and it can be clearly seen that the correlation coefficient of the original image is close to 1, while the correlation coefficient of the encrypted image is close to 0 in all directions.

NPCR and UACI Tests
A differential attack is a common security attack model. In the broadest sense, it refers to an attack for tracing how differences in information input can affect the resultant difference at the output and exploiting such properties to recover the secret key (cryptography key). An image encryption scheme exhibits high performance in resisting differential attacks if it possesses the characteristics of diffusion and the avalanche effect. The above characteristics indicate that a slight change in the plaintexts can spread over all of the data in the ciphertexts.
Therefore, the number of pixel change rates (NPCR) and a unified average changing intensity (UACI) are proposed to better measure the diffusion and avalanche effect characteristics in an encryption scheme. Security (resistance to differential attacks) is associated with high UACI/NPCR values. The calculation formula is as follows U ACI(T 1 , where two images of the same size are denoted as T 1 and T 2 , the size of the image is L = M × N, T 1 (i, j) and T 2 (i, j) are the pixel values of the corresponding coordinates (i, j) in the images, and Sign(·) is the sign function as Given the significance level λ, the critical NPCR score N * λ is obtained as where G indicates the largest allowed pixel value, and φ −1 (λ) is the inverse cumulative density function of the standard normal distribution N(0, 1). The critical U ACI scores (U * − λ , U * + λ ) with the given λ can be obtained using where µ u = G + 2 3G + 3 and σ 2 u = An encryption algorithm can pass the test if the calculated UACI value is within the range (U * − λ , U * + λ ). Using Equation (19) to calculate the median value of the confidence interval, compare the average value of UACI calculated by different images of the the same size. The closer tō U * λ , the more stable the UACI isŪ * In Table 3, the NPCR and UACI values of multiple encrypted images of different sizes in our scheme are compared with those in other schemes. The numbers in bold indicate the best indicators in the comparison scheme, and the numbers with underlines indicate that they failed the test. We find that the average NPCR and UACI values of our encrypted 256 × 256 images are 99.6084 and 33.4645, respectively. The NPCR value of reference [38] is 99.5818, which is the closest to the theoretical value, but its pass rate in the NPCR index is only 5/6. By giving priority to the pass rate, our NPCR value is closest to the theoretical value 99.5693 of the 256 × 256 image in Table 3, and the corresponding UACI value is also closest to the median value of the confidence intervalŪ * λ = 33.46355.   [38] is 99.6037, which the closest to the theoretical value, its pass rate in the NPCR index is only 3/4. By giving priority to the pass rate, our test value is closer to the theoretical NPCR value of 99.5994 for this size, and the corresponding UACI is also closest to the median of the confidence intervalŪ * λ = 33.46355. In summary, our scheme has a high pass rate for NPCR and UACI indicators when encrypting images of different sizes, and the average values of NPCR and UACI obtained under different sizes of images are closer to the theoretical values. It shows that our scheme has a strong ability to resist differential attacks. Therefore, it can be verified that this scheme can resist differential attacks, and it also has certain advantages compared to other schemes.

Global Shannon Entropy and Local Local Shannon Entropy
Global Shannon entropy is an important indicator that reflects the random characteristics of image information. It is generally believed that the larger the global Shannon entropy, the stronger the uncertainty of the image (the greater the amount of information) and the less visible information. It is used to measure the distribution of image pixels. Their global Shannon entropy can be calculated as where G indicates the largest allowed pixel value, and p(i) represents the probability of the occurrence of the pixel value i. The theoretical value of the global Shannon entropy H intended for an eight-bit grayscale random image is nearer to eight. Here, the images with sizes of 256 × 256, 512 × 512, and 1024 × 1024 are selected, and the results are shown in Table 4. Table 4. Global Shannon entropy of plain images and cipher images.

Cipher Images
For an image of the size 256 × 256, the best rates of [14,25] are 2/6 and 1/6; the best rate of our proposed scheme is 3/6. For an image of the size 512 × 512, the best rates of [14,25] are 1/18 and 11/18; the best rate of our proposed scheme is 13/18. For an image of the size 1024 × 1024, the best rates of [14,25] are 2/4 and 4/4; the best rate of our proposed scheme is 4/4. In total, [14] has a best rate of 5/28, [25] has a best rate of 16/28, and our scheme has a best rate of 21/28. The test results show that our proposed scheme has a better performance in the global Shannon entropy test, and the best rate is relatively good.
Local Shannon entropy is an important indicator to reflect the randomness of local regions [13]. It is generally believed that the confidence interval of a local Shannon entropy is [7.9019014, 7.9030373]. The local Shannon entropy in this interval indicates that the image shows strong randomness in the local area.
Here, we define the local Shannon entropy measure for 30 local image blocks with 1936 pixels as H 30,1936 where S i is one of the randomly select non-overlapping image blocks with 1936 pixels within the image S. H(S i )(i = 1, 2, · · · , 30) is computed by Shannon entropy via Equation (20). The image sizes images are 256 × 256, 512 × 512, and 1024 × 1024, respectively, and the results are shown in Table 5.

Cipher Images
It can be seen that the pass rates of [5,25] are both 2/6, and the pass rate of our proposed scheme is 5/6 for an image of the size 256 × 256. The pass rates of [5,25] are 13/18 and 18/18, and the pass rate of our proposed scheme is 17/18 for an image of the size 512 × 512. The pass rates of [5,25] are 3/4 and 4/4, and the pass rate of our proposed scheme is 4/4 for an image of the size 256 × 256. In total, ref. [5] has a pass rate of 20/28, ref. [25] has a pass rate of 24/28, and our scheme has a pass rate of 26/28.The comparison results show that our proposed scheme has a better overall performance in the local information entropy test, a relatively better pass rate, higher randomness, less visible information, and a better encryption performance.

Sensitivity Analysis
A cryptographic system with a good security performance must be key-sensitive, that is, a small change in the key will cause significant differences between the encrypted images and the decrypted images. Modify only minor changes to β 1 = 4 + 10 −15 for key susceptibility testing.
During the encryption, the Lena image is encrypted using the original key and a slightly changed key, respectively. The original Lena image is shown in Figure 11a, the cipher image with the original key is shown in Figure 11b, the cipher image with a slightly changed key is shown in Figure 11c, and the difference between the two cipher images is shown in Figure 11d. It indicates that a slight change in the plain image can spread over all of the data in the cipher images. (c) (d) Figure 11. Key sensitivity test for image encryption: (a) plain image of Lena, (b) encrypted image with the original key, (c) encrypted image with a slightly changed key, (d) cipher image with horizontal adjacent pixel distribution.
During the decryption, the same cipher image of Lena is decrypted with the correct key and with a slightly changed key, respectively. The original image is featured in Figure 12a, the encrypted image with the original key is featured in Figure 12b, the decrypted image with a slightly changed key is featured in Figure 12c, and the image decrypted by the original key is featured in Figure 12d.

Conclusions
We propose an image chaos encryption scheme based on global dynamic selection, the main work of which includes the following aspects: