A Secure Chaotic Block Image Encryption Algorithm Using Generative Adversarial Networks and DNA Sequence Coding

This paper proposes a block encryption algorithm based on a new chaotic system that combines generative adversarial networks (GANs) and DNA sequence coding. First, the new one-dimensional chaotic system that combines GANs with DNA sequence coding generates two more complex key stream sequences. Then, the two diﬀerent random sequences are combined with an improved Feistel network by utilizing the product of the block matrix to encrypt the image to scramble and diﬀuse the image. Finally, the security performance of this algorithm is quantitatively analysed. The simulation results show that the proposed chaotic system has a large key space, and the new algorithm yields adequate security and can resist exhaustive attacks and chosen-plaintext attacks. Therefore, this approach provides a new algorithm for secure transmission and protection of image information.


Introduction
With the rapid development of computer technology, when image information is transmitted, it is easy to leak or steal information, which could result in an unpredictable impact; thus, the security of image information transmission is becoming increasingly important. However, since the size of image datasets is much larger than the size of text datasets and the correlation between adjacent pixels is very strong, traditional encryption algorithms, such as the data encryption standard (DES) and advanced encryption standard (AES) [1,2], with a low encryption security and the risk of being cracked, might not be suitable for image encryption. erefore, image encryption and decryption technology has become one of the most important issues in the field of information security.
Many image encryption algorithms have been proposed by researchers. e common image encryption algorithms include the following: the pixel scrambling algorithm [3], which scrambles the position of each pixel in the image without changing the grey value of the pixel in the image. e histogram of the image does not change before and after the image changes, so it is easy to be decrypted; the pixel grey value diffusion algorithm [4], in which the grey value of each point in the image is used to change the grey value of each pixel in the original image by a certain transformation and the key can be easily analysed after the thief knows some part of the information in the plaintext; and the scrambling and diffusion combination algorithm [5], which has the advantage of not only changing the position of each pixel in the original image but also changing the grey value of the pixel, and the cryptosystem has a large key space and strong antiinterference ability.
e chaotic system has excellent aperiodicity, pseudorandomness, and highly sensitive initial values and is easy to reproduce, which is widely used in the field of image encryption [6]. Chaotic systems can be divided into low-dimensional and high-dimensional systems. e classical lowdimensional chaotic system includes a logistic chaotic system and a sine chaotic system, which has a simple structure and is easily implemented. High-dimensional chaotic systems include the Lorenz hyperchaotic system and Chen hyperchaotic system, which have complex nonlinear dynamic behaviour. e authors of [7] proposed the double-humped logistic map, which is used for pseudorandom number key generation (PRNG). e generalized parameter added to the map provides more control on the map chaotic range. e authors of [8] proposed a method of making a simple and effective chaotic system by using a difference of the output sequences of two identical existing one-dimensional (1D) chaotic maps. e authors of [9] proposed an improved classic quadratic chaotic map to enhance its chaotic properties. Compared with the classical quadratic map, the proposed quadratic map demonstrates a much larger maximal Lyapunov exponent. e authors of [10] proposed the new chaotic system, the tentlogistic system, which has a better chaotic performance and a wider chaotic range than the tent and logistic systems. e authors of [11] proposed a new one-dimensional chaotic map that can be used as a secure pseudorandom number generator in encryption systems. Nevertheless, low-dimensional chaotic systems have the shortcomings of a limited range of chaotic behaviours, a small space for generating chaotic sequences, and poor safety, which limit their application. Additionally, high-dimensional chaotic systems have multiple parameters, complex hardware design, large numbers of calculations, and other defects that are limiting factors. To solve problems such as poor performance of chaotic dynamics, small key space, and poor randomness of chaotic sequences, in this paper, we construct a new low-dimensional system. Analysis shows that the proposed system has a better chaotic performance and wider chaotic range than previously used systems. It can not only increase the randomness of the chaotic sequences but also expand the key space of cryptosystems, which is suitable for chaotic image encryption.
From the structure of image encryption based on a chaotic system, it mainly uses the scrambling and diffusion mechanism. e common chaotic encryption algorithms include those based on bit-level, pixel-level, one-time keys, deoxyribonucleic acid (DNA) rules, dynamic DNA coding, mathematical models, S-boxes scrambling, and diffusion. e authors of [12] proposed transforming an image into a bitmap block to perform a logical XOR operation and obtain a ciphertext image that can resist common attacks. e authors of [13] proposed a chaotic system to construct a complex key, and the pixel values and pixel positions of the block image were changed to implement encryption. Some encryption algorithms based on the combination of the Feistel network and DNA coding have been proposed. e authors of [14] proposed the scrambling transformation of image pixel positions and the diffusion of pixel values with a Hill permutation, Feistel transformation, chaotic scrambling, and dynamic DNA encoding, in which the F function was used for the Feistel transformation. e DNA sequence operation reduced the number of encryption rounds by using multiple scrambling and DNA encoding and decoding steps to achieve the effect of multiround encryption, which resulted in good security performance. e authors of [15] proposed an encryption algorithm based on the Feistel network and DNA encoding scrambling and a diffusion structure for image encryption, which can effectively solve strong plaintext sensitivity. e authors of [16] proposed image encryption based on a double chaotic pseudorandom generator. It uses four secret keys for encryption, which is highly secure. e authors of [17] presented an image encryption algorithm based on dynamic S-boxes and random blocks, in which a plaintext image is scrambled and diffused to implement an encrypted image. e authors of [18] presented a new 5D continuous hyperchaotic system that is combined with DNA dynamic encoding, scrambling, and diffusion to encrypt an image, and the algorithm can resist chosen-plaintext attacks. e authors of [19] presented a novel colour image encryption algorithm based on dynamic DNA encoding and a chaotic system, where DNA encoding and diffusion are used to diffuse the image information. e authors of [20] presented quantum image compression and an encryption algorithm with a Daubechies quantum wavelet transform (DQWT) and hyperchaotic Henon map. e algorithm has high encryption efficiency and good security. e authors of [21] presented an approach based on the quaternion discrete fractional Hartley transform (QD-FrHT) and an improved pixel adaptive diffusion encryption algorithm, which can increase the encryption capacity and reduce the consumption of keys. e authors of [22] presented an approach based on hyperchaotic system and a quantum cross-exchange operation to realize bit-level image encryption. e algorithm has high complexity and good security. e authors of [23] presented an approach based on a chaotic system and a two-dimensional linear canonical transform (2D-LCT) encryption algorithm, and the algorithm has good reliability. However, the above encryption algorithms have limited key spaces and involve simple superposition; thus, these algorithms have difficulty in resisting brute-force attacks and chosen-plaintext attacks and have poor security, which leads to algorithm cracking.
To solve the problems of low encryption efficiency, difficulties in resisting chosen-plaintext attacks, and low security, among others, in this paper, a new block image encryption algorithm is proposed that uses the one-time pad mechanism, double key stream mechanism, and improved Feistel structure to scramble and diffuse the pixel value and pixel position of the block image. Consequently, the block image parallel encryption is realized and the security performance and encryption efficiency of the algorithm are improved so that it can resist chosen-plaintext attacks and other encryption attacks.
Nonlinear complex networks and deep learning are new research directions and have been widely used, especially in the field of image processing, for almost two years. A nonlinear complex network has the characteristics of a large number of weight parameters, nonlinearity, and a complicated network structure, which provides ample key space and resistance for brute-force attacks and chosen-plaintext attacks. e authors of [24] presented a two-dimensional chaotic system along with a Boolean network. Matrix semitensor product theory and random position transformation are used to scramble and diffuse an image to realize encryption, providing high encryption efficiency and security. e authors of [25] presented an image block scrambling algorithm followed by the generation of the key stream by combining a Boolean network with a mixed linear-nonlinear coupled map; the image is encrypted by a matrix semitensor and key stream. e algorithm is secure, effective, and suitable for colour image encryption. e authors of [26] presented a new dispersion-keeping evaluation mechanism and two biobjective memetic genetic programming algorithms, which have good regression characteristics and can be applied to image encryption. e authors of [27] developed a Lorenz chaotic generation key stream matrix for image scrambling, and matrix semitensor product theory is applied to diffuse the image to generate a ciphertext image with improved encryption security. e authors of [28] developed PWLCM to generate a key stream and combined it with the nonlinear characteristics of the McCulloch-Pitts model to encrypt an image, which has a large key space and can resist common attacks. In the above described research, from the perspective of encryption algorithm security, the matrix semitensor product theory, Boolean network theory, and fractal sorting matrix are applied to image encryption, which has high security. In addition to the choice of algorithm, the structure of the key stream determines the performance of the encryption system. erefore, in this paper, from the point of view of key stream construction and the combination of generative adversarial networks (GANs), a new one-dimensional chaotic system, and DNA sequence coding, a double key stream with good randomness and complexity is constructed. At the same time, the nonlinear characteristics of the GANs and the parallel computing characteristics of DNA coding are used to solve the periodic problem caused by the limited precision of chaotic sequences, and the plaintext image is encrypted with the encryption algorithm. Moreover, it also provides a new idea for the combination of deep learning, GANs, DNA sequence coding, and image information security technology.
To summarize the above, a secure chaotic block image encryption algorithm using generative adversarial networks and DNA sequence coding is proposed. A one-dimensional, two-parameter chaotic system with a large key space and a better chaotic dynamic performance is proposed, in which GANs are combined with DNA sequence coding to generate better randomness and complexity in the fusion random sequence and DNA coding sequence as a double key stream. en, the matrix product is used to encrypt the plaintext block image pixel-level scrambling and diffusion as a ciphertext image based on an improved Feistel network, onetime pad mechanism, and double key stream. Moreover, the security of the algorithm is also analysed. e experimental results show that the proposed encryption algorithm based on the new chaotic system, GANs, and DNA sequence coding has a large secret key space, and it can resist common attacks with good security. e remainder of this paper is structured as follows. e new chaotic system and fusion random sequence are detailed in Section 2. e encryption algorithm is detailed in Section 3. In Section 4, the experimental results and a security analysis are presented. Finally, Section 5 presents some conclusions.

New Chaotic System and Fusion
Random Sequence 2.1. New Chaotic System. In nonlinear dynamic systems, a logistic system is a deterministic system of aperiodic nonconvergence, which is similar to a stochastic process and is extremely sensitive to the initial values of parameters. Compared with the pseudorandom sequences produced by the traditional linear system, the logistic system sequences have secure confidentiality [29]. e logistic system can be expressed as follows: where a ∈ [3.569946, 4] is the control parameter and i is the number of iterations. However, the logistic chaotic system has the problems of a small chaotic interval and discontinuous distribution of the chaotic sequence. Ramadan et al. [9] proposed that the improved quadratic chaotic system can be used, as shown in the following equation: where the control parameter a ∈ [0, ∞] except for the values 0.11, 1.11, 2.11, . . . to infinity; mod(·) is the modulus operator, of which the chaotic interval is large and the chaotic sequence is evenly distributed, but the chaotic system control parameters are few. To obtain better chaotic dynamic performance, the chaotic interval and control parameters are used to make it more suitable for chaotic image encryption. A new chaotic system that combines logistical chaotic with improved quadratic chaotic systems is proposed, as shown in the following equation: where the control parameter a ∈ [0, ∞] for the values 0.11, 1.11, 2.11, . . . to infinity; b ∈ [0, 4] and mod(·) is the modulus operator, which has a wider range of values and better chaotic behaviour.

Bifurcation Diagram.
Bifurcation diagrams are widely used in chaotic behaviour analysis [30]. e iteration step size is set to 0.5, and the number of iterations is 150. Additionally, the proposed chaotic system parameters are selected as a, b ∈ [0, 2], and the bifurcation diagrams of the logistic chaotic system, improved quadratic chaotic system, and new chaotic system with different control parameters of a, b are shown in Figure 1.
We can see from Figure 1 that the bifurcation diagram of two different control parameters of the new chaotic system is uniformly distributed so that the new chaotic system adapts to the requirements of image cryptography.

Lyapunov Exponent.
e Lyapunov exponent is a mathematical tool used to characterize the chaotic behaviour of a nonlinear dynamic system [31]. When the exponent is Mathematical Problems in Engineering positive, the system exhibits chaotic behaviour, and the proposed chaotic system control parameters are set to a, b ∈ [0, 4]. e Lyapunov exponent spectrum of the logistic chaotic system, improved quadratic chaotic system, and new chaotic system is shown in Figure 2. e Lyapunov exponents of the logistics chaotic system, improved quadratic chaotic system, and new chaotic system and exponents from references [7][8][9][10][11] are listed in Table 1. Figure 2 and Table 1 show that all kinds of chaotic systems listed above have different positive Lyapunov exponents. However, the new chaotic system has the largest Lyapunov exponent, which means that it yields more chaotic behaviour than the other systems.

NIST Test of New Chaotic Sequence.
To test the complexity and randomness of chaotic sequences generated by new chaotic systems, the National Institute of Standards and Technology (NIST) is used to test chaotic sequences [32]. e measure of sequence randomness is the P value algorithm, which provides the probability that the randomness of the sequence is better than that of a truly random sequence. All test results were determined by P value; if P < 0.01, then the sequence is not random and complex. If P ≥ 0.01, the sequence is random and complex. According to the requirements of the NIST test software, 10 groups of 10 6 bits of new system (3) sequences are selected for testing. e test results are shown in Table 2. Table 2 shows that the new chaotic system sequence has passed all NIST tests; therefore, it has good complexity and randomness characteristics.

Complexity Analysis of the Chaotic System.
To better verify the randomness and complexity of the chaotic sequence generated by the new chaotic system compared with the relevant literature, spectral entropy, 0-1 sequencing, and approximate entropy [32] are used for analysis, as shown in Table 3. Table 3 shows that the value of the new chaotic system sequence proposed is greater than those in other studies,  showing better randomness and complexity. erefore, it is suitable for image encryption algorithms.

Fusion Sequence.
In recent years, deep learning technology has made breakthrough developments, showing obvious advantages in various fields. Generative adversarial networks (GANs) are based on a generation model framework and were proposed by Goodfellow, who was inspired by the zero-sum game of using two people to train a network by confrontation [33]. GANs are used in image segmentation and image reconstruction and have good nonlinear and data reconstruction effects. At present, the GANs are one of the most important models in the field of computers. e GANs generate the required data samples through the competition between the generation model and the discriminant model. Compared with the traditional model, the combination of GANs and a chaotic system has unique advantages: (1) the training speed of the model is improved and then improves the efficiency of the training model; (2) compared with other models, it can produce clearer and more real samples; (3) more flexibility improves the expansion ability of the model; and (4) the complex nonlinear characteristics, which can effectively eliminate the problem of periodic chaotic sequences and increase the key space, improve the resistance to brute-force attacks of the encryption system and key. erefore, the fusion pseudorandom sequence with a larger key space and stronger randomness can be generated by combining the generative adversarial networks with a chaotic system.

Chaotic system
Control parameter a Control parameter b Reference [7] 0.6843 -Reference [8] 1.2944 -Reference [9] 3.9992 -Reference [10] 0.6992 -Reference [11] 3.8964 -Logistic 0.6031 -Proposed 4.4604 4.8930 In this paper, a new fusion pseudorandom sequence is generated by using the nonlinear characteristics of a chaotic system and GANs. e chaotic sequence is trained to eliminate the problem of periodic chaotic sequences. In GANs, both the generator and the discriminator use a fully connected layer, for which the generator is a single-layer fully connected network and the discriminator is a threelayer fully connected network. e rectified linear unit (ReLU) activation function is used in the generative model. e chaotic sequence is set as the real value of the model, and the normal distribution noise is set as the input value. Additionally, the hidden layer uses the tan h activation function, and the output does not have an activation function. e generation of fusion random sequences is characterized by high randomness and complexity, which is used to construct the encryption key stream and improves the security of the encryption system. A block diagram of the fusion sequences is shown in Figure 3. e sequence generation process consists of the following steps: Step 1: the secure SHA-512 is selected in this paper to convert the plaintext information into 512-bit hash values and then generate initial values and control parameters for the chaotic system; this approach increases the correlation between the plaintext and key, which can increase resistance to plaintext attacks. We input the image (size of M × N ) and select the generated 512-bit hash value as an array of , which is divided into 64 blocks. Each block contains a total of 8 bits k � [k 1 , k 2 , . . . , k 64 ], which are integers in the interval [0, 255], before being converted into decimal digits. en, the initial values and control parameters of the new chaotic system are obtained as shown in (10).
Step 2: the proposed chaotic system iteratively generates the three chaotic sequences f 1 , f 2 , and f 3 for three sets of initial values: Step 3: f 1 , f 2 , and f 3 are sent to the discriminator as real data. A random noise signal in the range [0, 1] has a normal distribution as input to the generator. e generator and discriminator are trained to generate random sequences y 1 , y 2 , and y 3 .
Step 4: y 1 , y 2 , and y 3 are applied to generate fusion random sequences fusion(i) and i � 1, 2, . . . , M × N. e process is shown as follows: When i � 1, When i ≥ 2, where mod(·) is the modulus operator.

Test of Fusion Sequence.
To better test the randomness and complexity of the fusion random sequence, we test the proposed fusion random sequence and the proposed chaotic sequences generated with different initial values and control parameters of x 1 , a 1 , and b 1 (represented by 1); x 2 , a 2 , and b 2 (represented by 2); and x 3 , a 3 , and b 3 (represented by 3) and the fusion random sequence (represented by "fusion"). e test results are compared with the approximate entropy values of the random sequences in Table 4. Table 4 shows that the proposed fusion sequences have the largest value of the spectral entropy, 0-1 test, and approximate entropy. erefore, the proposed approach can significantly improve the complexity of random sequences and is beneficial to applications such as encryption.

Encryption Algorithms
In this section, we introduce a new encryption structure. Many block encryption structures are essentially based on the Feistel network structure, but in the current Feistel network, the encryption and decryption function structures are not sufficiently complicated, and the security is imperfect. ese algorithms use only a single key, have low functional complexity, struggle to resist chosen-plaintext attacks, and provide weak security, so they are not applied to image encryption. To solve these problems, an image encryption and decryption algorithm based on improved Feistel network image pixel-level scrambling and a diffusion encryption algorithm are proposed in this paper. In the new chaotic system, GANs and DNA sequence coding are used to construct the double key stream that uses the nonlinear characteristics of the generative adversarial networks and the parallel computing characteristics of DNA coding to solve the periodic problem caused by the limited precision of chaotic sequences. At the same time, the double key stream makes the encryption algorithm more resistant to attacks, which is combined with the improved Feistel network scrambling and diffusion mechanism encryption of the image to achieve local and overall encryption and obtain better encryption security. e process employed by the  Mathematical Problems in Engineering image encryption and decryption algorithms is depicted in Figure 4. e specific steps of the encryption algorithm are as follows: Input: the inputs are the plaintext image P and the initial values of the parameters. Output: the output is the ciphertext image C.
Step 2: generate key streams 16 encoded according to the DNA coding rules in Tables 5 and 6 [34,35], and convert into a decimal sequence. We downloaded the DNA sequence with the ID number NZ_LOZQ01000042 from the GenBank database. According to DNA coding rule 1 from Tables 5  and 6, each DNA nucleotide in the DNA sequence is converted into a binary sequence code, each 8-bit binary sequence code is converted into a decimal number to obtain a decimal DNA sequence, and a 16-round random sequence DNA key as the other part of the double keys is constructed. e DNA key is calculated through 16 rounds in total, and each round is different. e process is shown as follows: dnakey � dnacoding convert decimal(GenBank database), where dnacoding convert decimal(·) converts a DNA code to a decimal number, ⊕ is the XOR operation, dnaadd(·) is the nucleotide addition operation, and dnasub(·) is the nucleotide subtraction operation.
Step 3: the plaintext matrix P has a size of M × N. is matrix is divided into two matrices: the left subblock L i and right subblock R i , where i � 1, 2, . . . , M × (N/2).
Step 4: we obtain the iterative pseudorandom sequences generated as key matrices K 1 (i) and  Figure 5. e one-round improved Feistel network encryption process is shown in Algorithm 1.
where C is the final ciphertext image and bit xor(·) is XOR operation. e decryption algorithm involves the inverse of the above process; notably, the inputs are the ciphertext image C, and cs is obtained by inverse diffusion of ciphertext image C.
e output is the plaintext image P. e K 1 (i) and K 2(j) (i) are still combined to form the key stream with the improved Feistel network decryption algorithm to iteratively decrypt the ciphertext image for 16 rounds and obtain a plaintext image P. e block diagram of the decryption algorithm for the improved Feistel network is shown in Figure 6.

Experimental Results and Security Analysis
To verify the validity of the above encryption algorithm, a simulation experiment was conducted on an Intel i7-8565U   A Step 5: let C with size M × N represent the ciphertext image corresponding to plaintext image P.
Step 6: we transform the pixel sequence cs(i), i � 1, 2, . . . , M × N of csimage and carry out the diffusion operation to obtain the final ciphertext image C: ALGORITHM 1: Image encryption process.
(1) Read cs,  Figure 7. In addition, we also give the encryption and decryption results for the colour images Couple (256 × 256) and Ship (256 × 256) in Figures 8  and 9.
As seen from Figures 7-9, the encrypted image is random noise, and no effective information can be obtained, which shows the effectiveness of the proposed algorithm.

Histogram Analysis.
A histogram shows the distribution of pixel values in an image. e ideal histogram of a ciphertext image is uniformly distributed [6]. e histogram values of the plaintext and ciphertext Lena images are shown in Figure 10. Figure 10 shows that the histogram distribution of the plaintext image is nonuniform, and the histogram distribution of the encrypted ciphertext image is uniform, so the proposed encryption algorithm is resistant to statistical attacks.
In addition, we use the variance of the histogram to quantitatively evaluate the uniformity of the ciphertext image. e smaller the variance is, the more uniform the histogram distribution is, which is defined as follows: where X � x 0 , x 1 , . . . , x 255 is the set of frequency values, x i and x j are the number of pixels whose pixel values are equal to i and j, respectively, and n is the grey level of the image. Table 7 shows the variance histograms of the plaintext and ciphertext images. As seen from Table 7, the variance in the plaintext image histogram is very large, while the variance in the ciphertext image histogram is smaller than that of the plaintext image histogram. However, the histogram variance in the proposed algorithm is smaller than that of other algorithms, which is safe and effective.
To quantitatively test the histogram variance of ciphertext image and analyse the uniformity of encrypted image, we calculate the histogram variance in encrypted images by changing only one key value, as shown in Tables 8 and 9.
As seen from Tables 8 and 9, the histogram variance of the ciphertext image is sensitive to the key. erefore, it further shows that the proposed algorithm can resist statistical attacks.

Correlation between Adjacent Pixels.
In general, the correlation coefficient of adjacent pixels in a plaintext image is close to 1, making the image vulnerable to statistical attacks; therefore, the adjacent pixels in a ciphertext image should have correlations close to 0, which means that the encryption algorithm must resist statistical attacks and provide good security [36]. e formulas of the correlation coefficients can be defined as follows: where E(x) and D(x) are the expectation and variance in variable x, respectively. First, 10,000 pairs of adjacent pixels in the plaintext image Lena are selected randomly, and the corresponding ciphertext image is obtained based on operations in three directions: horizontal, vertical, and diagonal. e correlation between the plaintext and ciphertext images in each direction is shown in Figure 11. e correlation values of the plaintext image and the correlation values of the ciphertext images of the proposed algorithm and those in references [12,[14][15][16][17][18][19] are shown in Table 10. Table 10 shows that the correlation between adjacent pixels in the plaintext image is higher than the values reported in references [12,[14][15][16][17][18][19]. e correlation values of ciphertext images in the proposed algorithm are smaller than the correlation values of the ciphertext images in references [12,[14][15][16][17][18][19]. erefore, the proposed algorithm can effectively resist statistical attacks.
It can be seen from Table 10 that the results of the correlation of two adjacent pixels of the ciphertext image are significant, while those of the proposed algorithm are lower than the existing ones, so the encryption effect is rather good.

Grey Level Co-Occurrence Matrix (GLCM) Analysis.
To further evaluate the spatial distribution characteristics of image encryption pixels, the GLCM matrix of adjacent pixels can be used [37]. e characteristic value calculation of the GLCM matrix is as follows.

Contrast.
e contrast reflects the clarity and depth of the texture groove of the image. e deeper the texture groove is, the greater the contrast and the clearer the effect, which is defined as follows: where P(i, j) represents the pixel value of the GLCM matrix and M and N are the row and column of the pixel value, respectively.

Energy.
Energy reflects the uniformity of the image grey distribution and texture thickness. Large energy values indicate a more uniform and regular texture pattern of the image, which is defined as follows: where P(i, j) represents the pixel value of the GLCM matrix and M and N are the row and column of the pixel value, respectively.

Correlation.
Correlation is used to measure the similarity of the GLCM of the image in the direction of row or column, so the value reflects the local grey correlation, and the greater the value is, the greater the correlation is. It is defined as follows: where P(i, j) denotes the coordinate values in the GLCM matrix and M and N are the row and column of the pixel value, respectively.

Homogeneity.
Homogeneity reflects how closely the elements in the GLCM are distributed along the GLCM diagonal, and smaller values of homogeneity reflect higher security of a ciphertext image. Homogeneity is defined as follows: where P(i, j) denotes the coordinate values in the GLCM matrix and M and N are the row and column of the pixel value, respectively. e characteristic values of the GLCM matrix adjacent pixels for the Lena ciphertext image, plaintext image, and related literature encryption algorithm are shown in Table 11. e two-dimensional histograms of the GLCM matrix of adjacent pixels in four different directions for the Lena plaintext image and ciphertext image obtained by the proposed algorithm are shown in Figures 12 and 13.
It can be seen from Table 11 and Figures 12 and 13 that the characteristic value of the GLCM matrix for the ciphertext image and the two-dimensional histogram of the ciphertext image indicates that the spatial distribution of adjacent pixels in the encrypted image is uniform; therefore, the adjacent pixels have sufficient random characteristics.

Entropy Analysis.
Entropy is suitable for quantitative evaluations of the encryption effects of image encryption algorithms [38], which can measure the distribution of image grey values. e more uniform the grey distribution is, the greater the image information entropy. Additionally, little information in a plain image can be obtained from the grey distribution of a ciphertext image by an attacker, so the encryption algorithm has high security. Entropy is mainly divided into global entropy and local entropy. Global entropy is defined as follows: where P i is the probability of the image pixel value and L is the image grey level. e ciphertext image global entropy is close to 8, suggesting that it is unlikely that the algorithm will divulge information. e global entropy values for the plaintext and ciphertext images obtained by the proposed algorithm and in references [12][13][14][15][16][17][18][19] are listed in Table 12. Table 12 shows that the global entropy of the algorithm proposed in this paper is close to 8, which indicates that it can resist statistical attacks.
On the basis of global entropy, local entropy, which overcomes the shortcomings of global entropy such as inaccuracy, inconsistency, and low efficiency, is proposed. Local entropy is an improvement of global entropy. First, nonoverlapping blocks are selected randomly, and then, the average global entropy of small image blocks is calculated. According to the algorithm described in the literature, 40 nonoverlapping blocks with a size of 32 × 32 are tested. e    Table 9: Percentage of variances difference of histograms compared among all keys in the proposed algorithm. Ciphertext

16
Mathematical Problems in Engineering corresponding theoretical value of local entropy is 7.8087, which is defined as follows: where B j is a nonoverlapping image block. Table 13 lists the local entropy test results of the proposed encryption algorithm and related literature. Table 13 shows that the value of the proposed encryption algorithm in this paper is the closest to the theoretical value, so the ciphertext image obtained by the proposed encryption algorithm has good security.

4.5.
Key Space Analysis. In the key space K � x 1 , x 2 , x 3 , a 1 , b 1 , a 2 , b 2 , a 3 , b 3 of the proposed algorithm, the range of x 1 , x 2 , and x 3 is [0, 1], and the range of a 1 , a 2 , a 3 ∈∈[0, ∞], b 1 , b 2 , b 3 ∈∈[0, 4]. If a dual-precision representation is used up to 14 digits after the decimal point, the total key space can reach 10 42 , that is, the key length is approximately log 2 (10 42 ) ≈ 140 bits. Generally, an algorithm key length of 128 bits is considered safe [39], so the key space of the proposed algorithm is large enough to effectively resist exhaustive attacks.

Differential Analysis (Plaintext Sensitivity).
A plaintext image and one with a small change are applied for encryption and to determine how a small change in the original image affects the encrypted image. is kind of attack is called a differential attack. To ensure the security of an image encryption scheme against a differential attack, two quantitative measures are used, including the number of pixels change rate (NPCR) and unified averaged changed intensity (UACI). Values of UACI > 33.4% and NPCR > 99.6% ensure that an image encryption algorithm is immune to differential attacks [40].  Images with only one pixel value difference are tested with the encryption algorithm. e number of changed image pixels is a percentage of the total number of pixels, which is represented by the NPCR. For two images with only one pixel value difference, after the same encryption algorithm is run, the degree of image pixel change is represented by the UACI. Two images with only one pixel value difference are encrypted as C 1 and C 2 , where H(i, j) is the image pixel difference value and M, N is the image size.
In the Lena plaintext image, the pixel value of the coordinates (120, 120) changes from "156" to "155". A comparative analysis of the NPCR and UACI values of the proposed algorithm and those from references [12,14,16,18,19] is shown in Table 14.
It can be seen from Table 14 that the proposed encryption algorithm is very sensitive to tiny changes in the plain image; even if there is only a one-bit difference between two plain images, the decrypted images will be completely different.
To quantitatively analyse the differential attack of the proposed algorithm, in the Lena plaintext image, random selection of the pixel value of the coordinates (120, 120), (140, 140), and (150, 150) and a change in a one-bit pixel value are performed on the plaintext images to obtain im1, im2, and im3. e ciphertext image is encrypted by the proposed encryption algorithm. e NPCR and UACI values of im1, im2, and im3 for five encryption rounds are compared with reference [19] and are listed in Tables 15 and  16.
As seen from Tables 15 and 16, after the first two rounds of encryption, the values of NPCR and UACI are close to the theoretical values, so the proposed algorithm has good security.

Key Sensitivity Analysis.
e security of a cryptosystem is highly related to key sensitivity, and a chaotic system is highly sensitive to initial conditions. at is, a slight change in the key will lead to the failed decryption of the encrypted image [37]. For example, the encryption key obtained from the Lena plaintext image is shown in Tables 17 and 18. e key stream is generated by the encryption key. On decryption, Key 1, Key 2, Key 3, Key 4, Key 5, Key 6, Key 7, Key 8, and Key 9 in Tables 13 and 14 are obtained by slightly changing the initial value of the Lena plaintext image, which is carried out to generate fusion pseudorandom sequences as the key stream to decrypt the ciphertext image. e result is shown in Figure 14. Figure 14 shows that the decryption key is slightly transformed, and the decrypted image is completely different from the plaintext image, which indicates that the algorithm is very sensitive to the key.
To quantitatively analyse the key sensitivity, we use the initial key, Key 0, in Tables 17 and 18 and slightly Figure 15, and the difference value is shown in Table 19.
As seen from Figure 15 and Table 19, when the key is slightly changed, the difference value of the ciphertext image obtained is very large. erefore, the proposed encryption algorithm in this paper is highly sensitive to the key.

Classical Types of Attacks.
In cryptography, the attack algorithms for passwords are commonly plaintext attacks, chosen-ciphertext attacks, known plaintext attacks, and known ciphertext attacks [41,42]. e security of the encryption algorithm should depend only on the security of the key. e encryption algorithm itself does not need to be kept secretly. e only secret that needs to be kept secretly is the key shared by both sides of communication. Cryptanalysis is based on this. According to the amount of information the attacker can obtain, there are four types of attacks on a cryptographic system: (1) Ciphertext-only attack: the attacker observes only the ciphertext and tries to recover the corresponding plaintext.  (2) Known plaintext attack: the attacker knows one or more plaintext ciphertext pairs encrypted with the same key and attempts to recover the plaintext corresponding to other ciphertexts.
(3) Chosen-plaintext attack: the attacker can select plaintext and obtain the corresponding ciphertext, which is similar to obtaining the use right of the encryptor. Its goal is to determine the plaintext corresponding to other ciphertexts.
(4) Chosen-ciphertext attack: the attacker can select ciphertext and obtain the corresponding plaintext, and its purpose is still to recover the plaintext corresponding to other ciphertexts.
A chosen-plaintext attack is the most threatening kind of cryptosystem attack. A secure encryption system must be able to resist a chosen-plaintext attack. In a chosen-plaintext attack, the attacker can arbitrarily select a certain number of plaintexts in advance, which allows the attacked encryption algorithm to obtain the ciphertext. e goal of the attacker is to obtain the key information through this process so that the attacker can more effectively crack the encryption algorithm and related keys. In the worst case, the key for decryption is obtained by the attacker.
is paper mainly analyses the security of the improved Feistel network for a chosen-plaintext attack. We choose an allzero matrix as the plaintext and obtain the ciphertext matrix based on encryption algorithm Step 4, as shown below:     Figure 15: Continued. (d2) Figure 15: Continued.

Mathematical Problems in Engineering 21
where [(0)] is the all-zero subblock plaintext matrix. From (29) and (30), if [(0)] subblocks are chosen to form the plaintext matrix for encryption, the ciphertext matrix can still be obtained, but the keys K 1 (i) and K 2(j) (i) and the [(0)] subblock ⟶ mod(K 1 (i) × [(0)] × K 2(j) (i), 256) operation are utilized in the matrix product. K 1 (i) and K 2(j) (i) are transformed and added to the all-zero matrices so that the attacker cannot obtain the encryption algorithm and key-related information through the relationship between the plaintext matrix and the ciphertext matrix. Moreover, [(255)] is chosen with all 255 subblocks as the plaintext matrix, and the ciphertext matrix is obtained based on encryption algorithm Step 4, as shown below: From (31) and (32), if [(255)] subblocks are chosen as the plaintext matrix for encryption, the ciphertext matrix can still be obtained, but [(255)] utilizes the Hadamard product with keys K 1 (i) and K 2(j) (i) in mod(K 1 (i) × [(255)] × K 2(j) (i), 256), and keys K 1 (i) and K 2(j) (i) cannot be separated. erefore, the attacker still cannot obtain the encryption algorithm and key-related information. us, the algorithm proposed in this paper can resist chosen-plaintext attacks.
In addition, it can be seen from equations (4)-(9) that the encrypted key stream depends not only on the initial state value of the chaotic system but also on the plaintext image. When different plaintext images are encrypted, the corresponding key stream is different. Since the information obtained is related to the selected image, the attacker cannot obtain useful information by encrypting some special images. erefore, the encryption scheme can resist the ciphertext-only attack, known as the plaintext attack and chosen-ciphertext attack.

Time Complexity Analysis.
e complexity of the image encryption algorithm mainly refers to the time complexity. e time complexity of the encryption algorithm mainly includes running time and the big 0 complexity analysis algorithm [43]. erefore, this paper analyses the complexity of the encryption algorithm in these two aspects. e experimental environment consists of an Intel Core i7, 2.  Table 20.
From the results shown in Table 20, it can be seen that the encryption speed of the proposed encryption algorithm is acceptable by comparison with other encryption algorithms.    [16] 1.6721 MN Reference [14] 3.8034 4 * MN Reference [12] 5.3850 8 * MN Reference [13] 10.0800 6 * MN Reference [17] 3.8650 3 * MN Reference [18] 3.5813 3 * MN Reference [19] 2.0800 MN where I 0 (i, j) is the plaintext image pixel value, I e (i, j) is ciphertext image pixel value, M and N are the row and column of the image, respectively, and I max is the maximum pixel value of the image. For the image, the smaller the value of PSNR is, the greater the difference between plaintext image and ciphertext is, and the better encryption effects. e Lena ciphertext images obtained by the proposed encryption algorithm and the encryption algorithm of related literature are compared, as shown in Table 21.
It can be seen from Table 21 that the PSNR of the ciphertext image of the proposed encryption algorithm is lower than that of the algorithms in other literature. erefore, the proposed encryption algorithm has a good effect.

Robustness Analysis.
In practice, the transmission of information is prone to multiple disturbances and attacks, so image encryption algorithms must be strongly robust. e robustness analysis of the image encryption algorithm includes antinoise attacks and clipping attacks. To test the antinoise attack performance of the proposed encryption algorithm in this paper, Gaussian noise of different intensities is added to the encrypted ciphertext image in Figure 16.
It can be seen that the decrypted image can still be distinguished, so it can be seen that the proposed encryption algorithm in this paper can resist the noise attack.
In practical applications, after the attacker intercepts the ciphertext image, he may use a cutting attack to destroy the image. To simulate this type of image data loss, an anticlipping attack experiment was performed. Taking 256 × 256 Lena image as the experimental subject, Figure 17 shows the experimental results.
It can be seen that the proposed encryption algorithm can still restore most of the original image information under different proportions of clipping attacks, so it has a certain ability to resist cutting attacks.

Conclusions
A new chaotic system is proposed in this paper and is combined with GANs and DNA encoding operations to generate fusion random sequences and DNA random sequences. ese two types of random sequences are utilized as the key stream and combined with an improved Feistel network scrambling and diffusion mechanism and one-time pad mechanism to encrypt images, achieve local encryption and overall encryption, thereby obtaining better encryption security. e experimental simulation results indicate that the proposed encryption algorithm has a large key space and high sensitivity, and it can resist exhaustive attacks. e pixel values of the encrypted image are evenly distributed, and the correlation between adjacent pixel values is weak, indicating that the algorithm can effectively resist statistical analysis attacks. erefore, the proposed algorithm can be applied in image encryption protection and it also provides a new idea for the combination of deep learning, GANs, DNA sequence coding, and image information security technology.
In future work, we plan to construct the parallel mechanism of key stream generation, which makes the training time of the generative adversarial networks model shorter and storage space smaller, to improve the overall efficiency of the encryption system. In addition, further development of the algorithm to be universally adaptable remains ongoing.

Data Availability
All the data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.