Next Article in Journal
Which Multivariate Multi-Scale Entropy Algorithm Is More Suitable for Analyzing the EEG Characteristics of Mild Cognitive Impairment?
Previous Article in Journal
Random Walk Approximation for Stochastic Processes on Graphs
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Cryptanalysis of an Image Encryption Algorithm Based on Two-Dimensional Hyperchaotic Map

College of Automation, Guangdong University of Technology, Guangzhou 510006, China
*
Author to whom correspondence should be addressed.
Entropy 2023, 25(3), 395; https://doi.org/10.3390/e25030395
Submission received: 6 December 2022 / Revised: 26 January 2023 / Accepted: 15 February 2023 / Published: 21 February 2023
(This article belongs to the Section Information Theory, Probability and Statistics)

Abstract

:
This paper analyzes the security of an image encryption algorithm based on a two-dimensional hyperchaotic map. This encryption algorithm generated chaotic sequences through a combination of two one-dimensional chaotic maps and used them as the permutation and diffusion key. Then, the image was encrypted by using the structure of row–column permutation, forward-diffusion, and backward-diffusion. The proposer claimed that the above algorithm was secure. However, it was found through cryptanalysis that the algorithm cannot withstand the chosen plaintext attack. Although the forward-diffusion and backward-diffusion of the original algorithm use two different diffusion keys and there is a ciphertext feedback mechanism, the analysis of the diffusion by iterative optimization showed that it can be equivalent to global diffusion. In addition, the generation of chaotic sequences in the encryption process is independent of the plaintext image, so the equivalent diffusion and permutation key stream can be obtained by adjusting the individual pixel values of the chosen plaintexts. Aiming at the security loopholes in the encryption algorithm, the theoretical and experimental results are presented to support the efficiency of the proposed attack and suggestions for improvement are given. Finally, compared with the performance analysis of the existing cracking algorithm, our cryptanalysis greatly improved the cracking efficiency without increasing the complexity of the data.

1. Introduction

With the rapid development of computer and communication technology, multimedia information, such as images, has become the main carrier of network information with its characteristics of carrying large amounts of information. The following problem is how to ensure the security of image data in the process of transmission. In recent years, due to the ergodicity, unpredictability, and initial-value sensitivity of chaotic systems [1,2,3,4], people have combined them with cryptography and gradually applied them to the field of multimedia information security, which has improved the security of multimedia information transmission to a certain extent.
Since the permutation–diffusion encryption structure was proposed, researchers have designed many novel chaotic image encryption schemes based on this structure [5,6]. For example, DNA encoding and decoding technology combined with a chaotic system was used for image encryption [7,8,9,10]; chaotic image encryption schemes based on double S-boxes were proposed [11,12,13,14]; the image compression technology was applied to chaotic image encryption [15,16,17,18]. Furthermore, in addition to designing relatively new chaotic encryption algorithms, researchers are paying more and more attention to the security of the algorithm itself. Therefore, in order to resist various attacks, various methods have been proposed to improve the security of encryption algorithms [19,20,21,22]. In [23], a dynamic key chaotic image encryption algorithm related to the plaintext was proposed, which improved the plaintext sensitivity of the encryption algorithm. In [24], a chaotic system based on a PWLCM map and an image encryption algorithm of dynamic DNA were proposed, then the chaotic sequences were used to dynamically select corresponding DNA encoding and decoding rules, making the encryption process more flexible. In [25], an image encryption scheme based on the generalized Arnold transform and RSA algorithm was proposed, which improved security by introducing the RSA algorithm. Moreover, improving new chaotic systems is also a common means [26,27]. Neural networks have been favored by academia and industry because of the diversity of their dynamics. A chaotic image encryption algorithm improved by a neural network had strong practicability in the medical field [28,29]. No matter how complex the encryption algorithm is, its purpose is to combine the chaotic system to conduct a series of permutations and diffusions of image pixels to ensure the security of image transmission.
Currently, image encryption algorithms are also becoming more and more diversified. Cryptographic designers often claim that the proposed encryption algorithm has good security based on a series of statistical test results. However, strict cryptanalysis shows that some chaotic encryption algorithms still have certain security loopholes, causing them to be cracked by attackers [30,31,32,33]. In the process of analyzing the security of the encryption algorithm, attackers try various methods to crack the algorithm and gradually develop some classic cryptanalysis methods. In [34], an encryption scheme based on a random walk matrix and a hyperchaotic system was cracked by the chosen plaintext attack method, and relevant suggestions were given for its security loopholes to improve the anti-attack capability; in [35], an image encryption algorithm combining DNA coding and a spatiotemporal chaotic system was analyzed; its equivalent key can be obtained by the chosen ciphertext attack method according to its defects, and it recovered the plaintext image; in [36], when a chaotic image encryption algorithm based on information entropy was cryptanalyzed for the effectiveness of quantifiable security measures, the differential attack method can be used to recover the equivalent key of each basic operation of the encryption algorithm.
Among many cryptanalysis methods, the chosen plaintext attack is a commonly used method. For example, the equivalent key can be obtained by selecting the corresponding special plaintext in different encryption stages for the encryption scheme of a chaotic system combined with an image block, that is the whole encryption algorithm can crack the different stages one by one [37]. Aiming at the color image encryption scheme of chaos and DNA encoding, the chosen plaintext attack could also be used to disclose its equivalent secret key [38]. In 2022, an image encryption algorithm based on a two-dimensional hyperchaotic map was proposed [39]. The encryption algorithm included two rounds of permutation and two rounds of diffusion. The permutation key and diffusion key were generated through the new coupled two-dimensional hyperchaotic map. There was a ciphertext feedback mechanism in the two-round diffusion process. According to the statistical test results, the original paper claimed that the algorithm had high security. However, the loopholes in the encryption algorithm were analyzed, and the chosen plaintext attack was used to crack it; however, the efficiency of the cracking algorithm was very low, and it took nearly 2 h to crack a  256 × 256  image, which obviously does not meet the actual needs [40]. By analyzing the security loopholes of the original encryption algorithm, this paper proposes a new cracking method, which greatly improves the cracking efficiency without increasing the complexity of the data.
The rest of this paper is arranged as follows: Section 2 briefly describes the image encryption algorithm proposed in [39]. In Section 3, the original encryption algorithm is analyzed as a whole, and then, the plaintext attack method is used to crack its security. In Section 4, numerical simulation experiments are carried out based on the security analysis method proposed in this paper, and the attack complexity is discussed. Finally, improvement suggestions are given for the existing security loopholes. Section 5 compares the performance of the cracking algorithm in this paper with that in [40]. The last section summarizes the content of this paper.

2. Description of Original Image Encryption Algorithm

This section introduces the chaotic system used in the original encryption algorithm and its specific encryption process. In [39], an image encryption algorithm based on a two-dimensional hyperchaotic map was proposed. In the original encryption algorithm, a series of chaotic sequences was generated by given initial key parameters for subsequent encryption operations based on the proposed new two-dimensional hyperchaotic system. The modified chaotic sequences were firstly used to exchange the whole row and column of the pixel value of the image and, secondly, used to carry out forward-diffusion and backward-diffusion on the pixel values to achieve the combination of chaos and the encryption algorithm.

2.1. Two-Dimensional Hyperchaotic System

In the original algorithm, a new 2D hyperchaotic map was proposed by using two one-dimensional chaotic maps  sin ( h π x )  and  r sin ( π x ) , and its expression is as follows:
x ( n ) = sin ( h π sin ( y ( n 1 ) ) ) , y ( n ) = r sin ( π x ( n 1 ) y ( n 1 ) ) ,
where the state variables  x ( n ) ( 1 , 1 ) y ( n ) ( r , r ) ; when the control parameter is  h [ 3 , 7 ] r [ 2 , 6 ] , the system is in a chaotic state.

2.2. Description of the Original Encryption Algorithm

According to the original encryption algorithm in [39], the block diagram of image encryption is shown in Figure 1, and the detailed process is described in the following:
(1)
Selection of initial key parameters:
According to Figure 1, the original encryption algorithm includes four initial key parameters, h, r x ( 0 ) , and  y ( 0 ) , and the values were taken as  h = 5 r = 5 x ( 0 ) = 0.5 , and  y ( 0 ) = 0.5  for the image encryption.
(2)
Generation of permutation index sequences:
Substitute the initial key parameters into Equation (1) for m iterations to avoid transient effects. Then, iterate it  H × W  more times to obtain two chaotic sequences  X = { x ( i ) } i = 1 H × W  and  Y = { y ( i ) } i = 1 H × W , where H and W represent the height and width of the plaintext image and  N = max ( H , W ) .
Then, the first N sequences of the chaotic sequences X and Y are intercepted and quantified according to Equation (2) to obtain the permutation index sequences  R = { r ( i ) } i = 1 N  and  T = { t ( i ) } i = 1 N  for image row–column permutation.
r ( i ) = mod ( floor ( | x ( i ) | × 10 16 ) , H 2 ) , t ( i ) = mod ( floor ( | y ( i ) | × 10 16 ) , W 2 ) ,
where  floor ( · )  represents the rounding-down operation,  ·  represents the absolute operation, and  mod  represents the modular operation.
(3)
Generation of diffusion matrix:
Similarly, the chaotic sequences X and Y are quantified according to Equation (3) to obtain the integer sequences  X g = { x g ( i ) } i = 1 H × W  and  Y g = { y g ( i ) } i = 1 H × W , which make the values in the range of  [ 0 , 255 ] .
x g ( i ) = mod ( round ( 1000 ( | x ( i ) × 10 16 | floor ( | x ( i ) | × 10 16 ) ) ) , 256 ) , y g ( i ) = mod ( round ( 1000 ( | y ( i ) × 10 16 | floor ( | y ( i ) | × 10 16 ) ) ) , 256 ) ,
where  round ( · )  represents the rounding operation,  floor ( · )  represents the rounding-down operation,  ·  represents the absolute operation, and  mod  represents the modular operation.
In order to facilitate subsequent diffusion operations, the sequences  X g  and  Y g  need to be written as matrices with the same size as the plaintext image matrix by scanning it in the raster order (from left to right and then from top to bottom). Finally, two diffusion matrices  D 1 = { D 1 ( i , j ) } i = 1 , j = 1 H , W  and  D 2 = { D 2 ( i , j ) } i = 1 , j = 1 H , W  with a size of  H × W  are obtained, which are used for forward-diffusion and backward-diffusion, respectively.
(4)
Encryption process:
The gray image P with a size of  H × W  can be represented by a positive integer matrix with H rows and W columns, and its value range is  [ 0 , 255 ] . According to [39], the steps of the encryption algorithm are as follows:
Step 1. Row-column permutation:
For the permutation operation, the row permutation operation is carried out according to the previously generated sequences X and R, and the column permutation operation is carried out according to the sequences Y and T.
For the row permutation operation, from  i = 1  to N, when  x ( i ) 0 , the  r ( i ) -th row of the image matrix P is inserted into the  ( H r ( i ) + 1 ) -th row, and the  ( r ( i ) + 1 ) -th to the  ( H r ( i ) + 1 ) -th rows are moved up one row as a whole; when  x ( i ) < 0 , the  ( H r ( i ) + 1 ) -th row of the image matrix P is inserted into the  r ( i ) -th row, and the  r ( i ) -th to the  ( H r ( i ) ) -th rows are moved down one row as a whole. The row permutation operation is repeated N times, and finally, the matrix B is obtained after row permutation.
For the column permutation operation, from  i = 1  to N, when  y ( i ) 0 , the  t ( i ) -th column of the image matrix B is inserted into the  ( W t ( i ) + 1 ) -th column, and the  ( t ( i ) + 1 ) -th to the  ( W t ( i ) + 1 ) -th columns are shifted to the left as a whole; when  y ( i ) < 0 , the  ( W t ( i ) + 1 ) -th column of the image matrix B is inserted into the  t ( i ) -th column, and the  t ( i ) -th to the  ( W t ( i ) ) -th columns are shifted to the right as a whole. The column permutation operation is repeated N times, and finally, the matrix I is obtained after column permutation.
Step 2. Forward-diffusion and backward-diffusion:
For the diffusion operation, the forward-diffusion is carried out according to the generated diffusion key  D 1 , and  S = { S ( i , j ) } i = 1 , j = 1 H , W  is the matrix after the forward-diffusion. According to the generated diffusion key  D 2 , the backward-diffusion is carried out, and  C = { C ( i , j ) } i = 1 , j = 1 H , W  is the matrix after the backward-diffusion.
For the forward-diffusion, the following diffusion methods are adopted:
S ( i , j ) = mod ( I ( 1 , 1 ) + D 1 ( 1 , 1 ) , 256 ) if i = 1 , j = 1 , mod ( I ( 1 , j ) + D 1 ( 1 , j ) + S ( 1 , j 1 ) , 256 ) if i = 1 , 1 < j W , mod ( I ( i , 1 ) + D 1 ( i , 1 ) + S ( i 1 , 1 ) , 256 ) if 1 < i H , j = 1 , mod ( I ( i , j ) + D 1 ( i , j ) + S ( i , j 1 ) + S ( i 1 , j ) , 256 ) if 1 < i H , 1 < j W ,
where  i = 1 , 2 , , H  and  j = 1 , 2 , , W .
For the backward-diffusion, the following diffusion methods are adopted:
C ( i , j ) = mod ( S ( H , W ) + D 2 ( H , W ) , 256 ) if i = H , j = W , mod ( S ( H , j ) + D 2 ( H , j ) + C ( H , j + 1 ) , 256 ) if i = H , 1 j < W , mod ( S ( i , W ) + D 2 ( i , W ) + C ( i + 1 , W ) , 256 ) if 1 i < H , j = W , mod ( S ( i , j ) + D 2 ( i , j ) + C ( i , j + 1 ) + C ( i + 1 , j ) , 256 ) if 1 i < H , 1 j < W ,
where  i = H , H 1 , , 1  and  j = W , W 1 , , 1 .

3. Security Analysis of the Original Encryption Algorithm

3.1. Overall Analysis

In cryptanalysis, the entire encryption algorithm can be cracked if the initial key parameters or equivalent key are obtained. Generally, the difficulty of cracking the initial key parameters is greater than that of cracking the equivalent key. If only the equivalent key can be solved, there is no need to crack the initial key parameters, because this will not only increase the difficulty and workload of cracking, but may even fail to crack. For the open-loop system, the generation of the encryption sequence is independent of the plaintext, that is the equivalent key is independent of the plaintext. It only needs to crack the equivalent key, and the cracking is relatively simple; for the closed-loop system, the generation of the encryption sequence is related to the plaintext, that is the equivalent key is related to the plaintext, so that the encryption sequence corresponding to different plaintexts is different, and the plaintext is not known in advance, so cracking the equivalent key will lose its generality. In this case, only the initial key parameters can be cracked.
According to the block diagram of the encryption algorithm shown in Figure 1, the initial key parameters of the chaotic map are independent of the plaintext image. When the initial key parameters remain unchanged and different plaintext images are encrypted, the permutation sequences R and T used for the two rounds of row–column permutation and the two diffusion matrices  D 1  and  D 2  are all unchanged, so it is easy to find the equivalent permutation key and equivalent diffusion key of the original algorithm by the chosen plaintext attack, thus cracking the entire encryption algorithm, that is to say, by selecting some plaintext information  P 1 , P 2 , , P N  and the corresponding ciphertext information  C 1 , C 2 , , C N  that is beneficial to the cracking, then deducing the secret key or equivalent key (represented by the symbol K) according to the encryption algorithm  E K  through these plaintext–ciphertext pairs, or finding an algorithm to derive  P N + 1  from  C N + 1 = E K ( P N + 1 ) .
The whole encryption process can be equivalent to a round of global permutation and a round of global diffusion through the equivalent permutation key and the equivalent diffusion key. As shown in Figure 2, P is the plaintext gray image, C is the final ciphertext image, I is the image after global permutation,  K s  is the equivalent permutation key, and  K d  is the equivalent diffusion key.
After the above analysis, the original encryption algorithm has some defects in its structure. As shown in Figure 2, the forward-diffusion process is preprocessed by iterative optimization, and the iterative results are substituted into the backward-diffusion process to find the relationship between the two rounds of diffusion, so the equivalent diffusion key stream can be obtained by adjusting the individual pixel values of the chosen plaintext to crack the entire diffusion process. Then, on the basis of this analysis, the chosen plaintext attack is also used to crack the two rounds of the permutation process. The whole encryption algorithm can be finally cracked by carrying out cryptanalysis on each process of encryption.

3.2. Analysis of the Two-Round Diffusion Process of the Original Encryption Algorithm

3.2.1. Pre-Analysis of Diffusion Process

According to the above overall analysis, the key to cracking the two-round diffusion process of the original encryption algorithm is to find the equivalent diffusion key and make it equivalent to one round of global diffusion. Therefore, this section mainly pre-analyzes the diffusion process. According to Equation (4), when  1 < i H  and  i < j W , the pixel value  S ( i , j )  is related to  S ( i , j 1 )  and  S ( i 1 , j ) . Considering the characteristics of this kind of matrix, the following propositions are given.
Proposition 1. 
For the matrix  A = { A ( k , l ) } k = 1 , l = 1 i , j  of size  i × j , it satisfies that the values in the i-th row or j-th column are all 1, and the values of other positions are equal to the sum of the values in the position below and the position right, as shown in Figure 3a, that is
A ( k , l ) = 1 if k = i , 1 l j or 1 k < i , l = 1 , A ( k , l 1 ) + A ( k 1 , l ) if 1 k i 1 , 1 l j 1 ,
where k and l represent the row number and column number in the matrix A, respectively. Then, the element value  A ( k , l )  in the k-th row and l-th column of this matrix can be expressed as  C i k + j l j l , namely
A ( k , l ) = C i k + j l j l = ( i k + j l ) ( i k + j l 1 ) ( i k + 1 ) ( j l ) ! .
Since the distribution of element values in matrix A is symmetric, the element value  A ( k , l )  in the k-th row and l-th column of the matrix is equal to the element value  A ( l , k )  in the l-th row and k-th column of the matrix, namely
A ( k , l ) = A ( l , k ) = C i k + j l i k = ( i k + j l ) ( i k + j l 1 ) ( j l + 1 ) ( i k ) ! .
Proof. 
According to the definition of Pascal’s triangle, we can obtain the structure of Figure 3b. Matrix A is now rotated by  135  counterclockwise, which coincides with part of Figure 3b. At this time, the properties of Pascal’s triangle can be used to obtain the values of each position of the matrix. The following are some basic properties of Pascal’s triangle:
(1) Each number in Pascal’s triangle is equal to the sum of its left and right numbers in the previous line.
(2) The q-th number in row p of Pascal’s triangle is equal to the  ( p q + 1 ) -th number in row p.
(3) The q-th number in row p of Pascal’s triangle is  C p 1 q 1 , where  C p 1 q 1  represents the operations of permutation and combination in mathematics, namely
C p 1 q 1 = ( p 1 ) ( p 2 ) ( p q + 1 ) ( q 1 ) ! .
The positions referred to the above properties all correspond to the positions in Pascal’s triangle. Therefore, in order to obtain each value in matrix A, the corresponding relationship between the values in matrix A and Pascal’s triangle are required. Figure 4 shows the corresponding relationship between the values in matrix A and Pascal’s triangle. The left side represents the position of each element in matrix A, and the right side corresponds to the row number of Pascal’s triangle in Figure 4. Because the row and column descriptions of matrix A and Pascal’s triangle are different in the analysis process, therefore, to show the difference,  a ( , )  is used to represent the element values in Pascal’s triangle and  A ( , )  is used to represent the element values of matrix A.
Analyzing the corresponding relationship in Figure 4, it is seen that the row number of Pascal’s triangle corresponds to the sum of the row number and column number of the elements in matrix A. This sum is a fixed value. The corresponding fixed value of the first row of Pascal’s triangle is  ( i + j ) , and then, as the row increases, the sum value will decrease gradually with a tolerance of 1, so the element at position  ( k , l )  in matrix A is in row p ( p = i k + j l + 1 )  of Pascal’s triangle. The first element of the p-th row of Pascal’s triangle is  a ( i p + 1 , j ) ; the row number of the element a increases with a tolerance of 1, and the column number decreases with a tolerance of 1, Therefore, the element in the position  ( k , l )  of the matrix A corresponds to the q-th  ( q = j l + 1 )  position of Pascal’s triangle. It can also be seen from the symmetry of Pascal’s triangle that  A ( k , l )  is also equal to the value of the  ( i k + 1 ) -th position of the k-th row.
According to the one-to-one correspondence between the two positions in the above analysis and Property (3) of Pascal’s triangle, substitute  p = i k + j l + 1 q = j l + 1  or  q = i k + 1  into Equation (6) to obtain the value of position  ( k , l )  in matrix A as  C i k + j l j l  or  C i k + j l i k , namely
A ( k , l ) = C i k + j l j l = ( i k + j l ) ( i k + j l 1 ) ( i k + 1 ) ( j l ) ! ,
or
A ( k , l ) = A ( l , k ) = C i k + j l i k = ( i k + j l ) ( i k + j l 1 ) ( j l + 1 ) ( i k ) ! .
Proposition 1 is proven.    □
Proposition 2. 
In the original encryption algorithm, the two-round diffusion encryption represented by the forward-diffusion encryption Equation (4) and the backward-diffusion encryption Equation (5) can be equivalent to one-round global diffusion encryption, namely
C ( i , j ) = mod ( f 1 ( I , H , W ) + K d ( H , W ) , 256 ) if i = H , j = W , mod ( f 1 ( I , H , j ) + K d ( H , j ) + C ( H , j + 1 ) , 256 ) if i = H , 1 j < W , mod ( f 1 ( I , i , W ) + K d ( i , W ) + C ( i + 1 , W ) , 256 ) if 1 i < H , j = W , mod ( f 1 ( I , i , j ) + K d ( i , j ) + C ( i , j + 1 ) + C ( i + 1 , j ) , 256 ) if 1 i < H , 1 j < W ,
where  f 1 ( I , i , j )  represents the value related to plaintext image I, and its specific expression is as follows:
f 1 ( I , i , j ) = I ( 1 , 1 ) if i = 1 , j = 1 , l = 1 j I ( 1 , l ) if i = 1 , j = 2 , 3 , , W , k = 1 i I ( k , 1 ) if i = 2 , 3 , , H , j = 1 , k = 1 i l = 1 j C i k + j l i k I ( k , l ) if i = 2 , 3 , , H , j = 2 , 3 , , W ,
then  K d = { K d ( i , j ) } i = 1 , j = 1 H , W  is the equivalent diffusion key,  K d = f 2 ( D 1 , i , j ) + D 2 ( i , j )  represents the value related to the forward-diffusion key  D 1  and the backward-diffusion key  D 2 , and
f 2 ( D 1 , i , j ) = D 1 ( 1 , 1 ) if i = 1 , j = 1 , l = 1 j D 1 ( 1 , l ) if i = 1 , j = 2 , 3 , , W , k = 1 i D 1 ( k , 1 ) if i = 2 , 3 , , H , j = 1 , k = 1 i l = 1 j C i k + j l i k D 1 ( k , l ) i f i = 2 , 3 , , H , j = 2 , 3 , , W ,
Proof. 
For the forward-diffusion process, Equation (4) is preprocessed step by step and iteratively:
(1) When  i = 1 j = 1 , there is
S ( 1 , 1 ) = mod ( I ( 1 , 1 ) + D 1 ( 1 , 1 ) , 256 ) .
(2) When  i = 1 j = 2 , 3 , , W , there is
S ( 1 , j ) = mod ( I ( 1 , j ) + D 1 ( 1 , j ) + S ( 1 , j 1 ) , 256 ) = mod ( I ( 1 , j ) + D 1 ( 1 , j ) + I ( 1 , j 1 ) + D 1 ( 1 , j 1 ) + S ( 1 , j 2 ) , 256 ) = mod ( I ( 1 , j ) + D 1 ( 1 , j ) + I ( 1 , j 1 ) + D 1 ( 1 , j 1 ) + + I ( 1 , 1 ) + D 1 ( 1 , 1 ) , 256 ) = mod ( l = 1 j I ( 1 , l ) + l = 1 j D 1 ( 1 , l ) , 256 ) .
(3) When  i = 2 , 3 , , H j = 1 , there is
S ( i , 1 ) = mod ( I ( i , 1 ) + D 1 ( i , 1 ) + S ( i 1 , 1 ) , 256 ) = mod ( I ( i , 1 ) + D 1 ( i , 1 ) + I ( i 1 , 1 ) + D 1 ( i 1 , 1 ) + S ( i 2 , 1 ) , 256 ) = mod ( I ( i , 1 ) + D 1 ( i , 1 ) + I ( i 1 , 1 ) + D 1 ( i 1 , 1 ) + + I ( 1 , 1 ) + D 1 ( 1 , 1 ) , 256 ) = mod ( k = 1 i I ( k , 1 ) + k = 1 i D 1 ( k , 1 ) , 256 ) .
(4) When  i = 2 , 3 , , H j = 2 , 3 , , W , there is
S ( i , j ) = mod ( I ( i , j ) + D 1 ( i , j ) + S ( i , j 1 ) + S ( i 1 , j ) , 256 ) .
After substituting the expressions of  S ( i , j 1 )  and  S ( i 1 , j ) , there is
S ( i , j ) = mod ( I ( i , j ) + D 1 ( i , j ) + I ( i , j 1 ) + D 1 ( i , j 1 ) + S ( i , j 2 ) + S ( i 1 , j 1 ) + I ( i 1 , j ) + D 1 ( i 1 , j ) + S ( i 2 , j ) + S ( i 1 , j 1 ) , 256 ) .
Arrange the pixel values in the same matrix into the same row:
S ( i , j ) = mod ( I ( i , j ) + I ( i , j 1 ) + I ( i 1 , j ) + D 1 ( i , j ) + D 1 ( i , j 1 ) + D 1 ( i 1 , j ) + S ( i , j 2 ) + S ( i 2 , j ) + 2 S ( i 1 , j 1 ) , 256 ) .
The constant coefficients corresponding to the pixel values of each position obviously meet the properties in Proposition 1, and the coefficients are replaced by the elements of Pascal’s triangle:
S ( i , j ) = mod ( C 0 0 I ( i , j ) + C 1 1 I ( i , j 1 ) + C 1 0 I ( i 1 , j ) + C 0 0 D 1 ( i , j ) + C 1 1 D 1 ( i , j 1 ) + C 1 0 D 1 ( i 1 , j ) + S ( i , j 2 ) + S ( i 2 , j ) + 2 S ( i 1 , j 1 ) , 256 ) .
By analyzing the above iterative rule, the pixel value of matrix  S ( i , j )  can be cyclically iterated to  S ( 1 , 1 ) . According to the forward-diffusion formula, it can be known that  S ( 1 , 1 ) = mod ( I ( 1 , 1 ) + D 1 ( 1 , 1 ) , 256 ) , so the pixel value of matrix S can be eliminated in the end, and the iteration is as follows:
S ( i , j ) = mod ( C 0 0 I ( i , j ) + C 1 1 I ( i , j 1 ) + C 1 0 I ( i 1 , j ) + + C i k + j l i k I ( k , l ) + + C i + j 2 i 1 I ( 1 , 1 ) + C 0 0 D 1 ( i , j ) + C 1 1 D 1 ( i , j 1 ) + C 1 0 D 1 ( i 1 , j ) + + C i k + j l i k D 1 ( k , l ) + + C i + j 2 i 1 D 1 ( 1 , 1 ) , 256 ) .
At this point, the above equation can be summarized and simplified as follows:
S ( i , j ) = mod ( k = 1 i l = 1 j C i k + j l i k I ( k , l ) + k = 1 i l = 1 j C i k + j l i k D 1 ( k , l ) , 256 ) .
where  C i k + j l i k  represents the constant coefficient of the pixel value.
After the above preprocessing, the iterative result of the forward-diffusion process is determined by Equations (7)–(10), and the final iterative result is only associated with the plaintext image I and forward-diffusion key  D 1 . For the convenience of further derivation and processing, it is suggested to uniformly set them as
S ( i , j ) = mod ( f 1 ( I , i , j ) + f 2 ( D 1 , i , j ) , 256 ) .
where  f 1 ( I , i , j )  and  f 2 ( D 1 , i , j ) , respectively, represent the value related to the intermediate ciphertext image I and the value related to forward-diffusion key  D 1 . Their specific expression is as follows:
f 1 ( I , i , j ) = I ( 1 , 1 ) if i = 1 , j = 1 , l = 1 j I ( 1 , l ) if i = 1 , j = 2 , 3 , , W , k = 1 i I ( k , 1 ) if i = 2 , 3 , , H , j = 1 , k = 1 i l = 1 j C i k + j l i k I ( k , l ) if i = 2 , 3 , , H , j = 2 , 3 , , W ,
f 2 ( D 1 , i , j ) = D 1 ( 1 , 1 ) if i = 1 , j = 1 , l = 1 j D 1 ( 1 , l ) if i = 1 , j = 2 , 3 , , W , k = 1 i D 1 ( k , 1 ) if i = 2 , 3 , , H , j = 1 , k = 1 i l = 1 j C i k + j l i k D 1 ( k , l ) if i = 2 , 3 , , H , j = 2 , 3 , , W ,
In order to obtain the equivalent diffusion key, it is also necessary to substitute the forward-diffusion process into the backward-diffusion process, analyze the relationship between them, and convert the two-round diffusion to the one-round diffusion. By substituting Equation (11) into Equation (5), the following formula can be obtained as
C ( i , j ) = mod ( f 1 ( I , H , W ) + f 2 ( D 1 , H , W ) + D 2 ( H , W ) , 256 ) if i = H , j = W , mod ( f 1 ( I , H , j ) + f 2 ( D 1 , H , j ) + D 2 ( H , j ) + C ( H , j + 1 ) , 256 ) if i = H , 1 j < W , mod ( f 1 ( I , i , W ) + f 2 ( D 1 , i , W ) + D 2 ( i , W ) + C ( i + 1 , W ) , 256 ) if 1 i < H , j = W , mod ( f 1 ( I , i , j ) + f 2 ( D 1 , i , j ) + D 2 ( i , j ) + C ( i , j + 1 ) + C ( i + 1 , j ) , 256 ) if 1 i < H , 1 j < W ,
The analysis of the above formula shows that, in the iterative process, the intermediate value S was eliminated, and the entire global diffusion process is only associated with plaintext image I, ciphertext image C, and the two-round diffusion keys  D 1  and  D 2 . Since  D 1  and  D 2  are constants, then  f 2 ( D 1 , i , j ) + D 2 ( i , j )  is a constant. The related parts of the two-round diffusion keys  D 1  and  D 2  can be regarded as a whole, and the equivalent diffusion key  K d = f 2 ( D 1 , i , j ) + D 2 ( i , j ) , then Equation (14) can be simplified as
C ( i , j ) = mod ( f 1 ( I , H , W ) + K d ( H , W ) , 256 ) if i = H , j = W , mod ( f 1 ( I , H , j ) + K d ( H , j ) + C ( H , j + 1 ) , 256 ) if i = H , 1 j < W , mod ( f 1 ( I , i , W ) + K d ( i , W ) + C ( i + 1 , W ) , 256 ) if 1 i < H , j = W , mod ( f 1 ( I , i , j ) + K d ( i , j ) + C ( i , j + 1 ) + C ( i + 1 , j ) , 256 ) if 1 i < H , 1 j < W ,
According to the above analysis, there is an equivalent diffusion key  K d , and Equation (15) clearly indicates that there is a fixed relationship between output C and input I through the equivalent diffusion key  K d . Therefore, the two-round diffusion encryption represented by forward-diffusion encryption and backward-diffusion encryption in the original encryption algorithm can be equivalent to the one-round global diffusion encryption.    □

3.2.2. The Equivalent Diffusion Key

To further crack the diffusion process, the equivalent diffusion key  K d  of the diffusion process is reversely obtained according to Equation (15) as
K d ( i , j ) = mod ( C ( H , W ) f 1 ( I , H , W ) , 256 ) + 256 n if i = H , j = W , mod ( C ( H , j ) f 1 ( I , H , j ) C ( H , j + 1 ) , 256 ) + 256 n if i = H , 1 j < W , mod ( C ( i , W ) f 1 ( I , i , W ) C ( i + 1 , W ) , 256 ) + 256 n if 1 i < H , j = W , mod ( C ( i , j ) f 1 ( I , i , j ) C ( i , j + 1 ) C ( i + 1 , j ) , 256 ) + 256 n if 1 i < H , 1 j < W ,
where  i = H , H 1 , , 1 j = W , W 1 , , 1 , and  n N .
Further analysis shows that the equivalent diffusion key  K d  is subsequently used for backward-diffusion to obtain the plaintext image, which requires modulo to 256, so the influence of  256 n  can be ignored in Equation (16), namely
K d ( i , j ) = mod ( C ( H , W ) f 1 ( I , H , W ) , 256 ) if i = H , j = W , mod ( C ( H , j ) f 1 ( I , H , j ) C ( H , j + 1 ) , 256 ) if i = H , 1 j < W , mod ( C ( i , W ) f 1 ( I , i , W ) C ( i + 1 , W ) , 256 ) if 1 i < H , j = W , mod ( C ( i , j ) f 1 ( I , i , j ) C ( i , j + 1 ) C ( i + 1 , j ) , 256 ) if 1 i < H , 1 j < W ,
where  i = H , H 1 , , 1  and  j = W , W 1 , , 1 .
According to Equation (17), to obtain the equivalent diffusion key  K d , select an all-zero plaintext image  P 0 = { P 0 ( i , j ) } i = 1 , j = 1 H , W = 0  according to the chosen plaintext attack, then encrypt to the corresponding ciphertext image  C 0 = { C 0 ( i , j ) } i = 1 , j = 1 H , W , because the all-zero plaintext is not influenced by the permutation operation; after permutation encryption,  I 0  is still an all-zero matrix  I 0 = { I 0 ( i , j ) } i = 1 , j = 1 H , W = 0 . From Equation (12), we can know that  f 1 ( I 0 , i , j ) = 0  ( i = 1 , 2 , , H j = 1 , 2 , , W ) and  C 0  as a known condition, and then, substitute them into Equation (17) to find the equivalent diffusion key as
K d ( i , j ) = mod ( C 0 ( H , W ) , 256 ) if i = H , j = W , mod ( C 0 ( H , j ) C 0 ( H , j + 1 ) , 256 ) if i = H , 1 j < W , mod ( C 0 ( i , W ) C 0 ( i + 1 , W ) , 256 ) if 1 i < H , j = W , mod ( C 0 ( i , j ) C 0 ( i , j + 1 ) C 0 ( i + 1 , j ) , 256 ) if 1 i < H , 1 j < W ,
where  i = H , H 1 , , 1  and  j = W , W 1 , , 1 .
According to the above analysis, the algorithm to crack the equivalent diffusion key  K d  is shown in Algorithm 1.
Algorithm 1 The procedure of cracking the equivalent diffusion key  K d .
Input: 
P 0 C 0
Output: 
K d
1:
[ H , W ] = size ( P 0 )
2:
C 0 Encrypt ( P 0 ) K d zeros ( H , W )
3:
K d ( H , W ) mod ( C 0 ( H , W ) , 256 )
4:
for  j = W 1  to 1 do
5:
    K d ( H , j ) mod ( C 0 ( H , j ) C 0 ( H , j + 1 ) , 256 )
6:
end for
7:
for  i = H 1  to 1 do
8:
    K d ( i , W ) mod ( C 0 ( i , W ) C 0 ( i + 1 , W ) , 256 )
9:
end for
10:
for  i = H 1  to 1 do
11:
   for  j = W 1  to 1 do
12:
      K d ( i , j ) mod ( C 0 ( i , j ) C 0 ( i , j + 1 ) C 0 ( i + 1 , j ) , 256 )
13:
   end for
14:
end for
15:
return  K d

3.2.3. Cracking Diffusion Encryption Process Using Equivalent Diffusion Key

Based on the equivalent diffusion key  K d , backward-diffusion is carried out according to Equation (15) and the intermediate ciphertext image before diffusion is reversely calculated. The process of backward-diffusion is as follows:
f 1 ( I , i , j ) = mod ( C ( H , W ) K d ( H , W ) , 256 ) + 256 n if i = H , j = W , mod ( C ( H , j ) K d ( H , j ) C ( H , j + 1 ) , 256 ) + 256 n if i = H , 1 j < W , mod ( C ( i , W ) K d ( i , W ) C ( i + 1 , W ) , 256 ) + 256 n if 1 i < H , j = W , mod ( C ( i , j ) K d ( i , j ) C ( i , j + 1 ) C ( i + 1 , j ) , 256 ) + 256 n if 1 i < H , 1 j < W ,
where  i = H , H 1 , , 1 j = W , W 1 , , 1 , and  n N .
Further analysis showed that, in order to offset the influence of  256 n  in Equation (19), the modulo method of 256 was also adopted to obtain the single pixel of the intermediate ciphertext image I. Therefore, Equation (19) can be simplified as follows:
f 1 ( I , i , j ) = mod ( C ( H , W ) K d ( H , W ) , 256 ) if i = H , j = W , mod ( C ( H , j ) K d ( H , j ) C ( H , j + 1 ) , 256 ) if i = H , 1 j < W , mod ( C ( i , W ) K d ( i , W ) C ( i + 1 , W ) , 256 ) if 1 i < H , j = W , mod ( C ( i , j ) K d ( i , j ) C ( i , j + 1 ) C ( i + 1 , j ) , 256 ) if 1 i < H , 1 j < W ,
where  i = H , H 1 , , 1  and  j = W , W 1 , , 1 .
According to Equation (20), the sum of pixels  f 1 ( I , i , j )  related to the intermediate ciphertext image I before diffusion can be obtained by using the equivalent diffusion key  K d  for backward-diffusion. To recover the intermediate ciphertext image I before diffusion, the specific pixel value  I ( i , j )  of each position of the image needs to be obtained. According to the previous analysis process, the relationship between the sum of pixels  f 1 ( I , i , j )  related to the intermediate ciphertext and the pixel value  I ( i , j )  of each position is determined by Equation (12). Now, Equation (12) is used to obtain the pixel value  I ( i , j )  of the intermediate ciphertext. The process is as follows:
(1) When  i = 1 j = 1 , there is
I ( 1 , 1 ) = f 1 ( I , 1 , 1 ) = mod ( C ( 1 , 1 ) K d ( 1 , 1 ) C ( 1 , 2 ) C ( 2 , 1 ) , 256 ) .
(2) When  i = 1 j = 2 , 3 , , W , there is
I ( 1 , j ) = l = 1 j I ( 1 , l ) l = 1 j 1 I ( 1 , l ) = f 1 ( I , 1 , j ) f 1 ( I , 1 , j 1 ) = f 1 ( I , 1 , W ) f 1 ( I , 1 , W 1 ) if j = W , f 1 ( I , 1 , j ) f 1 ( I , 1 , j 1 ) if 1 < j < W .
That is, when  j = W ,
I ( 1 , W ) = mod ( C ( 1 , W ) K d ( 1 , W ) C ( 2 , W ) ( C ( 1 , W 1 ) K d ( 1 , W 1 ) C ( 1 , W ) C ( 2 , W 1 ) ) , 256 ) .
When  1 < j < W ,
I ( 1 , j ) = mod ( C ( 1 , j ) K d ( 1 , j ) C ( 1 , j + 1 ) C ( 2 , j ) ( C ( 1 , j 1 ) K d ( 1 , j 1 ) C ( 1 , j ) C ( 2 , j 1 ) ) , 256 ) .
(3) When  i = 2 , 3 , , H j = 1 , there is
I ( i , 1 ) = k = 1 i I ( k , 1 ) k = 1 i 1 I ( k , 1 ) = f 1 ( I , i , 1 ) f 1 ( I , i 1 , 1 ) = f 1 ( I , H , 1 ) f 1 ( I , H 1 , 1 ) if i = H , f 1 ( I , i , 1 ) f 1 ( I , i 1 , 1 ) if 1 < i < H .
That is, when  i = H ,
I ( H , 1 ) = mod ( C ( H , 1 ) K d ( H , 1 ) C ( H , 2 ) ( C ( H 1 , 1 ) K d ( H 1 , 1 ) C ( H , 1 ) C ( H 1 , 2 ) ) , 256 ) .
When  1 < i < H ,
I ( i , 1 ) = mod ( C ( i , 1 ) K d ( i , 1 ) C ( i , 2 ) C ( i + 1 , 1 ) ( C ( i 1 , 1 ) K d ( i 1 , 1 ) C ( i 1 , 2 ) C ( i , 1 ) ) , 256 ) .
(4) When  i = 2 , 3 , , H j = 2 , 3 , , W , it can be seen from Property (1) of Pascal’s triangle that
I ( i , j ) = k = 1 i l = 1 j C i k + j l i k I ( k , l ) k = 1 i 1 l = 1 j C i k + j l i k I ( k , l ) k = 1 i l = 1 j 1 C i k + j l i k I ( k , l ) = f 1 ( I , i , j ) f 1 ( I , i 1 , j ) f 1 ( I , i , j 1 ) = f 1 ( I , H , W ) f 1 ( I , H 1 , W ) f 1 ( I , H , W 1 ) if i = H , j = W f 1 ( I , H , j ) f 1 ( I , H 1 , j ) f 1 ( I , H , j 1 ) if i = H , 1 < j < W f 1 ( I , i , W ) f 1 ( I , i 1 , W ) f 1 ( I , i , W 1 ) if 1 < i < H , j = W f 1 ( I , i , j ) f 1 ( I , i 1 , j ) f 1 ( I , i , j 1 ) if 1 < i < H , 1 < j < W .
That is, when  i = H j = W ,
I ( H , W ) = mod ( C ( H , W ) K d ( H , W ) ( C ( H 1 , W ) K d ( H 1 , W ) C ( H , W ) ) ( C ( H , W 1 ) K d ( H , W 1 ) C ( H , W ) ) , 256 ) .
When  i = H 1 < j < W ,
I ( H , j ) = mod ( C ( H , j ) K d ( H , j ) C ( H , j + 1 ) ( C ( H 1 , j ) K d ( H 1 , j ) C ( H 1 , j + 1 ) C ( H , j ) ) ( C ( H , j 1 ) K d ( H , j 1 ) C ( H , j ) ) , 256 ) .
When  1 < i < H j = W ,
I ( i , W ) = mod ( C ( i , W ) K d ( i , W ) C ( i + 1 , W ) ( C ( i 1 , W ) K d ( i 1 , W ) C ( i , W ) ) ( C ( i , W 1 ) K d ( i , W 1 ) C ( i , W ) C ( i + 1 , W ) ) , 256 ) .
When  1 < i < H 1 < j < W ,
I ( i , j ) = mod ( C ( i , j ) K d ( i , j ) C ( i , j + 1 ) C ( i + 1 , j ) ( C ( i 1 , j ) K d ( i 1 , j ) C ( i 1 , j + 1 ) C ( i , j ) ) ( C ( i , j 1 ) K d ( i , j 1 ) C ( i , j ) C ( i + 1 , j 1 ) ) , 256 ) .
The pixel values  I ( i , j )  of each position of the intermediate ciphertext image I can be determined according to Equations (21)–(24). However, when the sum of pixels  f 1 ( I , i , j )  related to the intermediate ciphertext is obtained according to Equation (20), the influence of  256 n  is ignored for the convenience of calculation and derivation. Therefore, when restoring the pixel values at each position of the intermediate ciphertext, the modulo of 256 can be taken to offset the influence, and the range of each pixel value is guaranteed to be  [ 0 , 255 ] . When the value of P is determined, then I will be determined, and we can set the matrix  F = { F ( i , j ) } i = 1 , j = 1 H , W , where  F ( i , j ) = f 1 ( I , i , j ) . Therefore, the formula for calculating the pixel value  I ( i , j )  of each position of the intermediate ciphertext image can be optimized as follows:
I ( i , j ) = mod ( F ( 1 , 1 ) , 256 ) if i = 1 , j = 1 , mod ( F ( 1 , j ) F ( 1 , j 1 ) , 256 ) if i = 1 , 1 < j W , mod ( F ( i , 1 ) F ( i 1 , 1 ) , 256 ) if 1 < i H , j = 1 , mod ( F ( i , j ) F ( i 1 , j ) F ( i , j 1 ) , 256 ) if 1 < i H , 1 < j W ,
where  i = H , H 1 , , 1 j = W , W 1 , , 1 , then without the help of the sum of pixels  f 1 ( I , i , j )  related to the intermediate ciphertext, the pixel values of each position of the intermediate ciphertext I can be calculated according to the direct relationship  F ( i , j )  between the intermediate ciphertext image I and the ciphertext image C analyzed above.
According to the above analysis process, the equivalent diffusion key  K d  is used to crack the diffusion encryption process, as shown in Algorithm 2.
Algorithm 2 The procedure of cracking the diffusion process.
Input: 
C K d
Output: 
I
1:
[ H , W ] = size ( C )
2:
F zeros ( H , W ) I zeros ( H , W )
3:
F ( H , W ) mod ( C ( H , W ) K d ( H , W ) , 256 )
4:
for  j = W 1  to 1 do
5:
    F ( H , j ) mod ( C ( H , j ) K d ( H , j ) C ( H , j + 1 ) , 256 )
6:
end for
7:
for  i = H 1  to 1 do
8:
    F ( i , W ) mod ( C ( i , W ) K d ( i , W ) C ( i + 1 , W ) , 256 )
9:
end for
10:
for  i = H 1  to 1 do
11:
   for  j = W 1  to 1 do
12:
      F ( i , j ) mod ( C ( i , j ) K d ( i , j ) C ( i , j + 1 ) C ( i + 1 , j ) , 256 )
13:
   end for
14:
end for
15:
I ( 1 , 1 ) mod ( F ( 1 , 1 ) , 256 )
16:
for  j = 2  to W do
17:
    I ( 1 , j ) mod ( F ( 1 , j ) F ( 1 , j 1 ) , 256 )
18:
end for
19:
for  i = 2  to H do
20:
    I ( i , 1 ) mod ( F ( i , 1 ) F ( i 1 , 1 ) , 256 )
21:
end for
22:
for  i = 2  to H do
23:
   for  j = 2  to W do
24:
      I ( i , j ) mod ( F ( i , j ) F ( i 1 , j ) F ( i , j 1 ) , 256 )
25:
   end for
26:
end for
27:
return I

3.3. Cracking the Permutation Process

On the basis of cracking the equivalent diffusion key  K d , the structure of the two-round equivalent encryption algorithm shown in Figure 2 is degenerated to the one-round permutation encryption structure. It is noted that the two-round permutation encryption algorithm is only used to change the coordinate position of pixels without changing the pixel value at the coordinate position, which can be equivalent to one round of global permutation. Therefore, the equivalent permutation key  K s  can be solved with the help of the position difference of special plaintext–ciphertext pairs. According to the analysis, the chosen plaintext attack can be used to crack the equivalent permutation key  K s , namely by constructing  N c = log L ( H × W )  plaintext images and their corresponding ciphertext image, the symbol  ·  indicates the rounding-up operation, H and W are the height and width of the plaintext image, respectively, L is the total number of pixel values of all possible plaintext images, and for the 8-bit plaintext image,  L = 256 .

3.3.1. The Construction Method of  N c  Plaintext Images

The steps of constructing  N c  plaintext images by the chosen plaintext attack are as follows:
Step 1. Construct a special plaintext image  Q = { Q ( i , j ) } i = 1 , j = 1 H , W  with the same size as the original plaintext image  P = { P ( i , j ) } i = 1 , j = 1 H , W , and write the non-negative integers  0 , 1 , 2 , , and  H × W 1  sequentially by scanning in the raster order (from left to right and top to bottom), that is the pixel value of the special plaintext image Q is  Q ( i , j ) = ( i 1 ) × W + ( j 1 ) , where  i = 1 , 2 , , H  and  j = 1 , 2 , , W . Since the range of the pixel values is  [ 0 , L 1 ] , Q needs to be decomposed into  N c  sub-matrices with pixel values in the range of  [ 0 , L 1 ] .
Q = 0 1 W 1 W W + 1 2 W 1 ( H 1 ) × W ( H 1 ) × W + 1 H × W 1 .
Step 2. Calculate the number of special plaintext image required  N c = log L ( H × W ) , and build  N c  special plaintext images as  Q 1 Q 2 , ⋯,  Q N c .
Step 3. The pixel values of  N c  plaintext images  Q 1 Q 2 , ⋯,  Q N c  are written by using the constructed special plaintext image Q. According to the mode of raster scanning, the writing rule of the l-th plaintext image  Q l  is
Q l = mod ( Q / L l 1 , L ) ,
where  l = 1 , 2 , , N c L = 256 , and  ·  represents the rounding-down operation.

3.3.2. The Equivalent Permutation Key

Based on the special plaintext image constructed in Section 3.3.1, the steps to crack the equivalent permutation key are as follows:
Step 1. Create  N c  special plaintext images  Q l = { Q l ( i , j ) } i = 1 , j = 1 H , W  ( l = 1 , 2 , , N c ) according to the method in Section 3.3.1. According to the chosen plaintext attack, these  N c  special plaintext images are encrypted, respectively, and the corresponding ciphertext is  C l = { C l ( i , j ) } i = 1 , j = 1 H , W  ( l = 1 , 2 , , N c ).
Step 2.  N c  ciphertext images  C l = { C l ( i , j ) } i = 1 , j = 1 H , W  ( l = 1 , 2 , , N c ) are processed by the equivalent diffusion key  K d  for backward-diffusion to offset the effect of diffusion encryption, and  N c  intermediate ciphertext images  I l = { I l ( i , j ) } i = 1 , j = 1 H , W  ( l = 1 , 2 , , N c ) are obtained.
Step 3. Combine  N c  intermediate ciphertext images  I l = { I l ( i , j ) } i = 1 , j = 1 H , W  ( l = 1 , 2 , , N c ) into a permutation matrix  Q i n d e x , and obtain
Q i n d e x = l = 1 N c ( I l × L l 1 ) ,
where  l = 1 , 2 , , N c  and  L = 256 .
Step 4. By comparing the position difference with the same pixel value in the special plaintext matrix Q and the permutation-only matrix  Q i n d e x , the equivalent permutation key of the global permutation encryption link can be obtained.
According to the above cracking steps, the detailed cracking process of equivalent permutation key  K s  is shown in Algorithm 3.
Algorithm 3 The procedure of cracking the equivalent permutation key  K s .
Input: 
Q
Output: 
K s
1:
[ H , W ] = size ( C )
2:
N c = ceil ( log 256 ( H × W ) )
3:
K s zeros ( H , W )
4:
Q l mod ( floor ( Q / L l 1 ) , 256 )
5:
for  l = 1  to  N c  do
6:
    Q l Encrypt ( Q l )
7:
end for
8:
for  l = 1  to  N c  do
9:
    F l ( H , W ) mod ( C l ( H , W ) K d ( H , W ) , 256 )
10:
   for  i = W 1  to 1 do
11:
      F l ( H , W ) mod ( C l ( H , j ) K d ( H , j ) C l ( H , j + 1 ) , 256 )
12:
   end for
13:
   for  i = H 1  to 1 do
14:
      F l ( i , W ) mod ( C l ( i , W ) K d ( i , W ) C l ( i + 1 , W ) , 256 )
15:
   end for
16:
   for  i = H 1  to 1 do
17:
     for  j = W 1  to 1 do
18:
         F l ( i , j ) mod ( C l ( i , j ) K d ( i , j ) C l ( i , j + 1 ) C l ( i + 1 , j ) , 256 )
19:
     end for
20:
   end for
21:
    I l mod ( F l ( 1 , 1 ) , 256 )
22:
   for  j = 2  to W do
23:
      I l ( 1 , j ) mod ( F l ( 1 , j ) F l ( 1 , j 1 ) , 256 )
24:
   end for
25:
   for  i = 2  to H do
26:
      I l ( i , 1 ) mod ( F l ( i , 1 ) F l ( i 1 , 1 ) , 256 )
27:
   end for
28:
   for  i = 2  to H do
29:
     for  j = 2  to W do
30:
         I l ( i , j ) mod ( F l ( i , j ) F l ( i 1 , j ) F l ( i , j 1 ) , 256 )
31:
     end for
32:
   end for
33:
end for
34:
Q i n d e x l = 1 N c ( I l × 256 l 1 )
35:
K s compare ( Q , Q i n d e x )
36:
return  K s

3.3.3. Cracking Permutation Encryption Process by Using Equivalent Permutation Key

Based on the equivalent permutation key  K s  obtained in Section 3.3.2, the two-round permutation process is equivalent to one round of global permutation, and the attacker can recover the corresponding plaintext image from any given permutation image on the premise of unknown key parameters. The specific process is shown in Algorithm 4.
According to the whole process of cryptographic security analysis, for a plaintext image with a size of  H × W , using the chosen plaintext attack only requires  1 + log L ( H × W )  special plaintext images, and the corresponding ciphertext images can crack the encryption algorithm.
Algorithm 4 The procedure of cracking the permutation process by using equivalent permutation key  K s .
Input: 
I K s
Output: 
P
1:
[ H , W ] = size ( I )
2:
s e q _ P zeros ( 1 , H × W )
3:
s e q _ I reshape ( I , 1 , H × W )
4:
s e q _ K s reshape ( K s , 1 , H × W )
5:
for  i = 1  to  H × W  do
6:
    s e q _ P ( s e q _ K s ( i ) ) = s e q _ I ( i )
7:
end for
8:
P reshape ( s e q _ P , W , H )
9:
return P

4. Experimental Results

The experimental hardware platform was a PC equipped with an Intel(R) Core(TM) i7 processor; the main frequency was 2.59 GHz; the memory (RAM) was 16 GB; the operating system was the Windows10 Professional 64-bit operating system; the software was MATLAB R2020a. In order to be consistent with the experiment of the original encryption algorithm on the dataset, the key parameters were selected from the original encryption algorithm, namely  h = 5 r = 5 x ( 0 ) = 0.5 , and  y ( 0 ) = 0.5 . Meanwhile, the same images from the USC-SIPI image database [39] were selected in the experiment. Here, two plaintext gray images, 5.1.09 and 5.1.10, with a size of  256 × 256 , were selected as the test images. In order to facilitate a unified description, they were named according to the Description in the image database, namely Moon surface and Aerial. In addition, in order to verify the reliability of the cracking algorithm in this paper, test diagrams of different sizes should be selected. In this paper, Lena and cameraman with a size of  512 × 512  were selected for the experimental testing.

4.1. Experimental Results of Cracking Image by Chosen Plaintext Attack

According to the chosen plaintext attack method proposed in this paper, numerical experiments were carried out on the plaintext images with different sizes of  256 × 256  and  512 × 512 . First of all, for the diffusion process, no matter how big the image size is, according to the analysis, it only needs to select an all-zero plaintext image  P 0 = { P 0 ( i , j ) } i = 1 , j = 1 H , W = 0  and obtain its corresponding ciphertext image  C 0 = { C 0 ( i , j ) } i = 1 , j = 1 H , W  through encryption, as shown in Figure 5.
Secondly, for the permutation process, according to the special plaintext construction method proposed in Section 3.3.1, for images with a size of  256 × 256 , the number of plaintexts to be constructed is  N c = log 256 ( 256 × 256 ) = 2 . Therefore, to crack the permutation process of images with a size of  256 × 256 , it is necessary to select two special plaintext images  Q 1  and  Q 2  and obtain their corresponding ciphertext images  C 1  and  C 2  through encryption, as shown in Figure 6.
For a  512 × 512  image, the number of plaintexts that need to be constructed is  N c = log 256 ( 512 × 512 ) = 3 . Therefore, to crack the permutation process of  512 × 512  images, three special plaintexts  Q 3 Q 4 , and  Q 5  need to be selected, whose corresponding ciphertext is  C 3 C 4 , and  C 5 , as shown in Figure 7.
Finally, the equivalent permutation key and equivalent diffusion key were used to crack and recover the plaintext image from the ciphertext image. For the plaintext gray images Moon surface and Aerial with a size of  256 × 256 , the test results are shown in Figure 8. This includes the original gray image, the ciphertext image, the permutation-only image after cracking the diffusion process, and the equivalent cracking plaintext image.
For the plaintext gray images Lena and cameraman with a size of  512 × 512 , the corresponding plaintext image can also be completely recovered from the ciphertext image. The results of the cracking test are shown in Figure 9, including the original gray image, the ciphertext image, the permutation-only image after the cracking diffusion process, and the equivalent cracked plaintext image.

4.2. Suggestions for Improvement

According to the security analysis of this paper, the original encryption algorithm had security defects and could not withstand the chosen plaintext attack. The following suggestions are given to fix the loopholes of the original encryption algorithm in the process of cryptanalysis:
(1) The two-round diffusion process should avoid operation composition. The iterative analysis process of forward-diffusion and backward-diffusion is actually the process of operation compounding, which makes the two rounds of diffusion able to be equivalent to one round of global diffusion, and its equivalent diffusion key can be cracked by the analysis of only one plaintext image. In the design process of the encryption algorithm, the operation compounding should be avoided, so as to avoid the invalidation of the round number for diffusion.
(2) The permutation and diffusion structure of the original algorithm should be improved. Although the permutation and diffusion processes of the original encryption algorithm are relatively complex, the structure of the whole encryption algorithm is relatively simple, which makes the whole structure equivalent to a single-round permutation–diffusion structure. It is suggested to improve the complexity of the algorithm structure to make all parts closely connected, thereby improving the security of the encryption algorithm.

5. Comparison and Performance Analysis of Cracking Algorithms

According to the previous analysis, the attack method proposed in this paper can efficiently and quickly obtain the equivalent key and then effectively crack the original encryption algorithm. This paper made a comprehensive comparison of the chosen plaintext attack methods proposed in [40] and analyzed the differences in their performance.

5.1. Comparison of Cracking Diffusion Processes

In [40], for the diffusion part, according to the similarity of the two rounds of the diffusion formula structure, a conclusion is given: the pixel value after diffusion was obtained modulo 256 by the sum of the pixel value before diffusion and the element value of the equivalent key matrix, that is
C ( i , j ) = mod ( f p ( i , j ) + K ( i , j ) , 256 ) ,
where  f p ( i , j )  represents the variable related to the plaintext and its position and  K ( i , j )  represents the equivalent diffusion key related to the diffusion key.
According to Equation (28), all the values related to the diffusion key in the two-round diffusion formula can be extracted and made uniformly equivalent with an equivalent diffusion key. In this case, there is no quantity related to the diffusion key in the two-round diffusion formula, so the two-round diffusion process will be weakened into an ordinary equation operation. The diffusion formula after weakening is as follows.
For forward-diffusion,
S ( i , j ) = mod ( I ( 1 , 1 ) , 256 ) if i = 1 , j = 1 , mod ( I ( 1 , j ) + S ( 1 , j 1 ) , 256 ) if i = 1 , 1 < j W , mod ( I ( i , 1 ) + S ( i 1 , 1 ) , 256 ) if 1 < i H , j = 1 , mod ( I ( i , j ) + S ( i , j 1 ) + S ( i 1 , j ) , 256 ) if 1 < i H , 1 < j W ,
where  i = 1 , 2 , , H  and  j = 1 , 2 , , W .
For backward-diffusion,
C ( i , j ) = mod ( S ( H , W ) , 256 ) if i = H , j = W , mod ( S ( H , j ) + C ( H , j + 1 ) , 256 ) if i = H , 1 j < W , mod ( S ( i , W ) + C ( i + 1 , W ) , 256 ) if 1 i < H , j = W , mod ( S ( i , j ) + C ( i , j + 1 ) + C ( i + 1 , j ) , 256 ) if 1 i < H , 1 j < W ,
where  i = H , H 1 , , 1  and  j = W , W 1 , , 1 .
According to the above analysis, the whole diffusion process can be equivalent to the structure shown in Figure 10.
The equivalent processing method is obviously different from the equivalent processing method used in this paper. The equivalent structure in this paper is shown in Figure 2. The above equivalent processing method skillfully utilizes the similarity of the structure of the two rounds of diffusion formulas and combines the properties of the mathematical operations to extract the two diffusion keys into an equivalent diffusion key K, so as to crack the original encryption algorithm. However, if the structure of the two-round diffusion formula is not similar, the method will fail, so it is not universal. The method proposed in this paper does not need to extract the two equivalent keys, but combines the two rounds of the diffusion process by eliminating the intermediate ciphertext S, which is equivalent to the classical round of the permutation–diffusion structure, and the analysis of this kind of encryption algorithm can be widely applied.

5.2. Comparison of Cracking Permutation Process

In [40], the method of the chosen plaintext attack was adopted for the cracking of the permutation process. Firstly, according to the analysis, it can be known that, for an image with a size of  H × W  and the same L different pixel values,  N c log L ( H × W )  special plaintext–ciphertext pairs are required to obtain the equivalent diffusion key.
In order to illustrate the above process of selecting special information to crack the permutation key, a  2 × 2  matrix is used to demonstrate the process of obtaining the equivalent permutation key.
For the case of  H = W = L = 2 , a matrix with element values increasing from 0 should be constructed according to the L-base (binary here), then decomposed into  N c  special plaintext bit by bit. The corresponding ciphertext images should be obtained by permutation encryption, and the pixel values in plaintext–ciphertext pairs before and after permutation encryption are compared. Analyze and judge the possible source of pixel value of each position. Finally, it is necessary to take the intersection of all possible situations in the  N c  matrix to obtain the equivalent permutation key.
The above method to crack the equivalent permutation key has a big defect. When comparing the pixel values in plaintext–ciphertext pairs before and after permutation encryption and analyzing and determining the possible source of the pixel value at each position, all pixels of the entire image matrix need to be traversed repeatedly, which requires a large amount of memory resources and consumes a long time, which greatly reduces the entire cracking efficiency. According to the simulation experiment results in [40], it takes nearly 2 h to crack images with a size of  256 × 256 , and the time consumed increases exponentially with the increase of the image size.
In contrast, with the method proposed in this paper, it is unnecessary to repeatedly traverse all the pixel values in the image, so the equivalent permutation key can be obtained efficiently without increasing the number of special plaintexts, and it only takes 0.63178 s to crack an image of size  256 × 256 , while it takes 8.03338 s to crack an image of size  512 × 512 . The performance of the proposed attack method has higher superiority.

5.3. Comparison of Attack Complexity

The attack complexity mainly includes the time complexity and the data complexity. The following is a comparison of cracking methods from these two aspects.
In terms of the data complexity, according to the attack method proposed in this paper, the number of plaintext–ciphertext pairs required to crack the entire encryption algorithm is  1 + log 256 ( H × W ) , while the attack method in [40] requires at least the same number of plaintext–ciphertext pairs. Therefore, the data complexity of both decoding algorithms is  O ( log ( H × W ) ) .
In terms of the time complexity, according to the test for pictures of different sizes in [40], the same tests were also conducted for the cracking algorithm proposed in this paper. For the convenience of comparison, the test images in the USC-SIPI image dataset provided in [40] were uniformly used. In addition, in order to ensure the accuracy of the data, the experimental data in [40] are directly quoted here. At the same time, the experimental hardware platform with the same configuration (equipped with an Intel (R) Core (TM) i7 processor; the main frequency was 2.59 GHz; the memory was 16 GB) was used to crack images of different sizes many times, and multiple sets of test results were obtained. Finally, the average value of the test results was taken as the final test results. The running time is shown in Table 1.
The broken line graphs in Figure 11, respectively, show the growth trend of the running time of the two cracking methods. With the increase of the size of the test image, the running time of both cracking algorithms grew. However, the running time of this paper was generally far lower than that of the cracking algorithm in [40]. Therefore, the cracking algorithm proposed in this paper had a high running efficiency and could recover the plaintext image at a very fast speed without increasing the data complexity.

6. Conclusions

In this paper, the security of an image encryption algorithm based on a two-dimensional hyperchaotic map was analyzed in detail. Through the security analysis, it was found that the encryption algorithm cannot withstand the chosen plaintext attack. The key used in the two-round permutation and two-round diffusion of the original encryption algorithm was independent of the plaintext image. Through further theoretical derivation and analysis, it was found that there was an equivalent key for this algorithm structure, which can be simplified into the one-round global permutation and one-round global diffusion structure. Therefore, the method of the chosen plaintext attack was proposed to crack the algorithm. Theoretical analysis and numerical simulation results showed that, according to the chosen plaintext attack method proposed in this paper, for the plaintext gray image with a size of  H × W , only  1 + log 256 ( H × W )  special plaintext images and their corresponding ciphertext images needed to be selected to obtain the equivalent permutation and diffusion key, so as to realize the cracking of the original encryption algorithm. In the analysis method of this paper, the number of special plaintext images needed to crack the original encryption algorithm was small, and the attack complexity was not high, while the effectiveness of the attack algorithm was verified by the simulation test. Compared with the existing cracking algorithms, the chosen plaintext attack method in this paper consumed less time and was more efficient in cracking the original encryption algorithm without increasing the data complexity.

Author Contributions

Methodology, Q.J.; software, Q.J.; validation, S.Y. and Q.W.; writing—original draft preparation, Q.J.; writing—review and editing, Q.W.; supervision, S.Y. and Q.W.; project administration, S.Y.; funding acquisition, S.Y. and Q.W. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China (No. 62271157) and the Natural Science Foundation of Guangdong Province (No. 2022A1515010005).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Yu, S.; Lü, J.; Li, C. Some progresses of chaotic cipher and its applications in multimedia secure communications. J. Electron. Inf. Technol. 2016, 38, 735–752. [Google Scholar] [CrossRef]
  2. Li, C.; Luo, G.; Qin, K.; Li, C. An image encryption scheme based on chaotic tent map. Nonlinear Dyn. 2017, 87, 127–133. [Google Scholar] [CrossRef]
  3. ul Haq, T.; Shah, T. 4D mixed chaotic system and its application to RGB image encryption using substitution-diffusion. J. Inf. Secur. Appl. 2021, 61, 102931. [Google Scholar] [CrossRef]
  4. Wang, Q.; Yu, S.; Guyeux, C.; Wang, W. Constructing Higher-Dimensional Digital Chaotic Systems via Loop-State Contraction Algorithm. IEEE Trans. Circuits Syst. Regul. Pap. 2021, 68, 3794–3807. [Google Scholar] [CrossRef]
  5. Fridrich, J. Symmetric ciphers based on two-dimensional chaotic maps. Int. J. Bifurc. Chaos 1998, 8, 1259–1284. [Google Scholar] [CrossRef]
  6. Geetha, S.; Punithavathi, P.; Infanteena, A.M.; Sindhu, S.S.S. A literature review on image encryption techniques. Int. J. Inf. Secur. Priv. (IJISP) 2018, 12, 42–83. [Google Scholar] [CrossRef]
  7. Chai, X.; Gan, Z.; Yuan, K.; Chen, Y.; Liu, X. A novel image encryption scheme based on DNA sequence operations and chaotic systems. Neural Comput. Appl. 2019, 31, 219–237. [Google Scholar] [CrossRef]
  8. Chai, X.; Gan, Z.; Yang, K.; Chen, Y.; Liu, X. An image encryption algorithm based on the memristive hyperchaotic system, cellular automata and DNA sequence operations. Signal Process. Image Commun. 2017, 52, 6–19. [Google Scholar] [CrossRef] [Green Version]
  9. Zhu, S.; Zhu, C. Secure image encryption algorithm based on hyperchaos and dynamic DNA coding. Entropy 2022, 22, 772. [Google Scholar] [CrossRef]
  10. Wang, X.; Li, Y. Chaotic image encryption algorithm based on hybrid multi-objective particle swarm optimization and DNA sequence. Opt. Lasers Eng. 2021, 137, 106393. [Google Scholar] [CrossRef]
  11. Belazi, A.; Khan, M.; El-Latif, A.A.A.; Belghith, S. Efficient cryptosystem approaches: S-boxes and permutation–substitution-based encryption. Nonlinear Dyn. 2017, 87, 337–361. [Google Scholar] [CrossRef]
  12. Zhu, S.; Wang, G.; Zhu, C. A secure and fast image encryption scheme based on double chaotic S-boxes. Entropy 2019, 21, 790. [Google Scholar] [CrossRef] [Green Version]
  13. Farah, M.A.; Farah, A.; Farah, T. An image encryption scheme based on a new hybrid chaotic map and optimized substitution box. Nonlinear Dyn. 2020, 99, 3041–3064. [Google Scholar] [CrossRef]
  14. Wang, X.Y.; Sun, H.H.; Gao, H. An image encryption algorithm based on improved baker transformation and chaotic S-box. Chin. Phys. B 2021, 30, 060507. [Google Scholar] [CrossRef]
  15. Zhou, N.; Li, H.; Wang, D.; Pan, S.; Zhou, Z. Image compression and encryption scheme based on 2D compressive sensing and fractional Mellin transform. Opt. Commun. 2015, 343, 10–21. [Google Scholar] [CrossRef]
  16. Zhou, N.; Pan, S.; Cheng, S.; Zhou, Z. Image compression–encryption scheme based on hyper-chaotic system and 2D compressive sensing. Opt. Laser Technol. 2016, 82, 121–133. [Google Scholar] [CrossRef]
  17. Gong, L.; Qiu, K.; Deng, C.; Zhou, N. An image compression and encryption algorithm based on chaotic system and compressive sensing. Opt. Laser Technol. 2019, 115, 257–267. [Google Scholar] [CrossRef]
  18. Cheng, G.; Wang, C.; Xu, C. A novel hyper-chaotic image encryption scheme based on quantum genetic algorithm and compressive sensing. Multimed. Tools Appl. 2020, 79, 29243–29263. [Google Scholar] [CrossRef]
  19. Xu, C.; Sun, J.; Wang, C. A novel image encryption algorithm based on bit-plane matrix rotation and hyper chaotic systems. Multimed. Tools Appl. 2020, 79, 5573–5593. [Google Scholar] [CrossRef]
  20. Gan, Z.; Chai, X.; Han, D.; Chen, Y. A chaotic image encryption algorithm based on 3-D bit-plane permutation. Neural Comput. Appl. 2019, 31, 7111–7130. [Google Scholar] [CrossRef]
  21. Wang, S.C.; Wang, C.H.; Xu, C. An image encryption algorithm based on a hidden attractor chaos system and the Knuth–Durstenfeld algorithm. Opt. Lasers Eng. 2020, 128, 105995. [Google Scholar] [CrossRef]
  22. Xian, Y.; Wang, X.; Yan, X.; Li, Q.; Wang, X. Image encryption based on chaotic sub-block scrambling and chaotic digit selection diffusion. Opt. Lasers Eng. 2020, 134, 106202. [Google Scholar] [CrossRef]
  23. Wu, Z.; Pan, P.; Sun, C.; Zhao, B. Plaintext-related dynamic key chaotic image encryption algorithm. Entropy 2021, 23, 1159. [Google Scholar] [CrossRef] [PubMed]
  24. Tian, J.; Lu, Y.; Zuo, X.; Liu, Y.; Qiao, B.; Fan, M.; Ge, Q.; Fan, S. A novel image encryption algorithm using PWLCM map-based CML chaotic system and dynamic DNA encryption. Multimed. Tools Appl. 2021, 80, 32841–32861. [Google Scholar] [CrossRef]
  25. Jiao, K.; Ye, G.; Dong, Y.; Huang, X.; He, J. Image encryption scheme based on a generalized arnold map and RSA algorithm. Secur. Commun. Netw. 2020, 2020, 9721675. [Google Scholar] [CrossRef]
  26. Lin, H.; Wang, C.; Xu, C.; Zhang, X.; Iu, H.H. A memristive synapse control method to generate diversified multi-structure chaotic attractors. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2022. [Google Scholar] [CrossRef]
  27. Lin, H.; Wang, C.; Sun, Y.; Wang, T. Generating n-Scroll Chaotic Attractors From A Memristor-based Magnetized Hopfield Neural Network. IEEE Trans. Circuits Syst. II Express Briefs 2022, 70, 311–315. [Google Scholar] [CrossRef]
  28. Lin, H.; Wang, C.; Cui, L.; Sun, Y.; Xu, C.; Yu, F. Brain-like initial-boosted hyperchaos and application in biomedical image encryption. IEEE Trans. Ind. Inform. 2022, 18, 8839–8850. [Google Scholar] [CrossRef]
  29. Lin, H.; Wang, C.; Cui, L.; Sun, Y.; Zhang, X.; Yao, W. Hyperchaotic memristive ring neural network and application in medical image encryption. Nonlinear Dyn. 2022, 110, 841–855. [Google Scholar] [CrossRef]
  30. Wen, H.; Yu, S. Cryptanalysis of an image encryption cryptosystem based on binary bit planes extraction and multiple chaotic maps. Eur. Phys. J. Plus 2019, 134, 337. [Google Scholar] [CrossRef]
  31. Hu, Y.; Yu, S.; Zhang, Z. On the Cryptanalysis of a Bit-Level Image Chaotic Encryption Algorithm. Math. Probl. Eng. 2020, 2020. [Google Scholar] [CrossRef]
  32. Hu, G.; Xiao, D.; Wang, Y.; Li, X. Cryptanalysis of a chaotic image cipher using Latin square-based confusion and diffusion. Nonlinear Dyn. 2017, 88, 1305–1316. [Google Scholar] [CrossRef]
  33. Wu, J.; Liao, X.; Yang, B. Cryptanalysis and enhancements of image encryption based on three-dimensional bit matrix permutation. Signal Process. 2018, 142, 292–300. [Google Scholar] [CrossRef]
  34. Fan, H.; Lu, H.; Zhang, C.; Li, M.; Liu, Y. Cryptanalysis of an Image Encryption Algorithm Based on Random Walk and Hyperchaotic Systems. Entropy 2021, 24, 40. [Google Scholar] [CrossRef]
  35. Wen, H.; Yu, S.; Lü, J. Breaking an image encryption algorithm based on DNA encoding and spatiotemporal chaos. Entropy 2019, 21, 246. [Google Scholar] [CrossRef] [Green Version]
  36. Li, C.; Lin, D.; Feng, B.; Lü, J.; Hao, F. Cryptanalysis of a chaotic image encryption algorithm based on information entropy. IEEE Access 2018, 6, 75834–75842. [Google Scholar] [CrossRef]
  37. Ma, Y.; Li, C.; Ou, B. Cryptanalysis of an image block encryption algorithm based on chaotic maps. J. Inf. Secur. Appl. 2020, 54, 102566. [Google Scholar] [CrossRef]
  38. Chen, L.; Li, C.; Li, C. Security measurement of a medical communication scheme based on chaos and DNA coding. J. Vis. Commun. Image Represent. 2022, 83, 103424. [Google Scholar] [CrossRef]
  39. Gao, X. Image encryption algorithm based on 2D hyperchaotic map. Opt. Laser Technol. 2021, 142, 107252. [Google Scholar] [CrossRef]
  40. Zhang, C.; Chen, J.; Chen, D. Cryptanalysis of An Image Encryption Algorithm Based on a 2D Hyperchaotic Map. Entropy 2022, 24, 1551. [Google Scholar] [CrossRef]
Figure 1. The block diagram of the original encryption algorithm.
Figure 1. The block diagram of the original encryption algorithm.
Entropy 25 00395 g001
Figure 2. The block diagram of equivalent encryption algorithm.
Figure 2. The block diagram of equivalent encryption algorithm.
Entropy 25 00395 g002
Figure 3. Matrix A and its corresponding value. (a) Matrix A; (b) Pascal’s triangle.
Figure 3. Matrix A and its corresponding value. (a) Matrix A; (b) Pascal’s triangle.
Entropy 25 00395 g003
Figure 4. The corresponding relationship between the values in matrix A and Pascal’s triangle.
Figure 4. The corresponding relationship between the values in matrix A and Pascal’s triangle.
Entropy 25 00395 g004
Figure 5. All-zero plaintext image and its corresponding ciphertext image: (a) the all-zero plaintext image  P 0 ; (b) the corresponding ciphertext image  C 0  of  P 0 .
Figure 5. All-zero plaintext image and its corresponding ciphertext image: (a) the all-zero plaintext image  P 0 ; (b) the corresponding ciphertext image  C 0  of  P 0 .
Entropy 25 00395 g005
Figure 6. Select special plaintext images with a size of  256 × 256  and their corresponding ciphertext images: (a) the special plaintext image  Q 1 ; (b) the special plaintext image  Q 2 ; (c) the corresponding ciphertext image  C 1  of  Q 1 ; (d) the corresponding ciphertext image  C 2  of  Q 2 .
Figure 6. Select special plaintext images with a size of  256 × 256  and their corresponding ciphertext images: (a) the special plaintext image  Q 1 ; (b) the special plaintext image  Q 2 ; (c) the corresponding ciphertext image  C 1  of  Q 1 ; (d) the corresponding ciphertext image  C 2  of  Q 2 .
Entropy 25 00395 g006
Figure 7. Select special plaintext images with a size of  512 × 512  and their corresponding ciphertext images: (a) the special plaintext image  Q 3 ; (b) the special plaintext image  Q 4 ; (c) the special plaintext image  Q 5 ; (d) the corresponding ciphertext image  C 3  of  Q 3 ; (e) the corresponding ciphertext image  C 4  of  Q 4 ; (f) the corresponding ciphertext image  C 5  of  Q 5 .
Figure 7. Select special plaintext images with a size of  512 × 512  and their corresponding ciphertext images: (a) the special plaintext image  Q 3 ; (b) the special plaintext image  Q 4 ; (c) the special plaintext image  Q 5 ; (d) the corresponding ciphertext image  C 3  of  Q 3 ; (e) the corresponding ciphertext image  C 4  of  Q 4 ; (f) the corresponding ciphertext image  C 5  of  Q 5 .
Entropy 25 00395 g007
Figure 8. Cracking results for plaintext gray images of a size  256 × 256 : (a) the original gray image of the Moon’s surface; (b) the ciphertext image of the Moon’s surface; (c) the cracked Moon’s surface permutation image; (d) the cracked plaintext image of the Moon’s surface; (e) the original gray image of Aerial; (f) the ciphertext image of Aerial; (g) the cracked Aerial permutation image; (h) the cracked plaintext image of Aerial.
Figure 8. Cracking results for plaintext gray images of a size  256 × 256 : (a) the original gray image of the Moon’s surface; (b) the ciphertext image of the Moon’s surface; (c) the cracked Moon’s surface permutation image; (d) the cracked plaintext image of the Moon’s surface; (e) the original gray image of Aerial; (f) the ciphertext image of Aerial; (g) the cracked Aerial permutation image; (h) the cracked plaintext image of Aerial.
Entropy 25 00395 g008
Figure 9. Cracking results for plaintext gray images of a size  512 × 512 : (a) the original gray image of Lena; (b) the ciphertext image of Lena; (c) the cracked Lena permutation image; (d) the cracked plaintext image of Lena; (e) the original gray image of the cameraman; (f) the ciphertext image of the cameraman; (g) the cracked cameraman permutation image; (h) the cracked plaintext image of the cameraman.
Figure 9. Cracking results for plaintext gray images of a size  512 × 512 : (a) the original gray image of Lena; (b) the ciphertext image of Lena; (c) the cracked Lena permutation image; (d) the cracked plaintext image of Lena; (e) the original gray image of the cameraman; (f) the ciphertext image of the cameraman; (g) the cracked cameraman permutation image; (h) the cracked plaintext image of the cameraman.
Entropy 25 00395 g009
Figure 10. Diffusion structure after equivalence.
Figure 10. Diffusion structure after equivalence.
Entropy 25 00395 g010
Figure 11. The running time of the two cracking algorithms: (a) the cracking algorithm in [40]; (b) our cracking algorithm.
Figure 11. The running time of the two cracking algorithms: (a) the cracking algorithm in [40]; (b) our cracking algorithm.
Entropy 25 00395 g011
Table 1. The running time of the two cracking algorithms.
Table 1. The running time of the two cracking algorithms.
Image Size32 × 3264 × 64128 × 128256 × 256512 × 512
Running time in [40]/s850540720072,000
Running time in this paper/s0.083960.091880.138910.631788.03338
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Jiang, Q.; Yu, S.; Wang, Q. Cryptanalysis of an Image Encryption Algorithm Based on Two-Dimensional Hyperchaotic Map. Entropy 2023, 25, 395. https://doi.org/10.3390/e25030395

AMA Style

Jiang Q, Yu S, Wang Q. Cryptanalysis of an Image Encryption Algorithm Based on Two-Dimensional Hyperchaotic Map. Entropy. 2023; 25(3):395. https://doi.org/10.3390/e25030395

Chicago/Turabian Style

Jiang, Qinmao, Simin Yu, and Qianxue Wang. 2023. "Cryptanalysis of an Image Encryption Algorithm Based on Two-Dimensional Hyperchaotic Map" Entropy 25, no. 3: 395. https://doi.org/10.3390/e25030395

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop