Next Article in Journal
DiffFSRE: Diffusion-Enhanced Prototypical Network for Few-Shot Relation Extraction
Previous Article in Journal
Planetary Energy Flow and Entropy Production Rate by Earth from 2002 to 2023
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Efficient Image Cryptosystem Utilizing Difference Matrix and Genetic Algorithm

1
School of Mathematical Sciences, Hebei Normal University, Shijiazhuang 050024, China
2
Department of Mathematics and Computer Science, Hengshui University, Hengshui 053000, China
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Entropy 2024, 26(5), 351; https://doi.org/10.3390/e26050351
Submission received: 7 March 2024 / Revised: 11 April 2024 / Accepted: 19 April 2024 / Published: 23 April 2024

Abstract

:
Aiming at addressing the security and efficiency challenges during image transmission, an efficient image cryptosystem utilizing difference matrix and genetic algorithm is proposed in this paper. A difference matrix is a typical combinatorial structure that exhibits properties of discretization and approximate uniformity. It can serve as a pseudo-random sequence, offering various scrambling techniques while occupying a small storage space. The genetic algorithm generates multiple ciphertext images with strong randomness through local crossover and mutation operations, then obtains high-quality ciphertext images through multiple iterations using the optimal preservation strategy. The whole encryption process is divided into three stages: first, the difference matrix is generated; second, it is utilized for initial encryption to ensure that the resulting ciphertext image has relatively good initial randomness; finally, multiple rounds of local genetic operations are used to optimize the output. The proposed cryptosystem is demonstrated to be effective and robust through simulation experiments and statistical analyses, highlighting its superiority over other existing algorithms.

1. Introduction

With the increasing transmission of multimedia information over the internet, it has become essential to protect against unauthorized access. Digital images are a widely used data format for storing more vivid information. Image encryption mainly involves converting a meaningful image into a meaningless one through two fundamental techniques, namely, scrambling and diffusion, thereby rendering it inaccessible to unauthorized individuals. Scrambling involves the modification of the positioning or ordering of pixels within an image. On the other hand, diffusion modifies pixel values to achieve a randomized effect. These techniques can be applied independently or combined to create more complex encryption schemes.
Numerous image encryption algorithms have been put forward recently, with chaos-based ones garnering significant attention in this field due to their distinctive properties [1,2,3]. Chaotic systems are nonlinear dynamical systems that exhibit complex and unpredictable behavior, making them suitable for cryptographic systems due to their ergodicity, sensitivity to initial conditions, non-periodicity and non-convergence. However, attackers can exploit regions of regularity or low chaos within these systems to break encryption schemes, particularly if they possess knowledge of the plaintext used in encryption or can select it. Therefore, chaotic systems are frequently employed in conjunction with other technologies to enhance their level of security, such as DNA [4,5,6,7], genetic operations [8,9,10], compressive sensing [11,12,13], fractal sorting matrix [14], bit matrix [15], combinatorial design structures [16,17,18,19,20,21,22,23], and others.
Most concepts in combinational design theory are directly defined on finite sets, which can compensate for the limitations of applying chaos theory to cryptography. To date, many combinational design structures have been implemented in the field of cryptography, including Latin squares [16,17,18], orthogonal arrays [19], Latin cubes [20,21,22], Hadamard matrices [24], etc. Latin squares are commonly utilized in image encryption thanks to their distinctive properties of dispersion, uniformity, and abundance. These algorithms initially employ Latin squares to generate 1D maps for scrambling, then perform XOR operations directly on 2D images. However, they suffer from the drawbacks of low scrambling efficiency and susceptibility to specific attacks. The utilization of orthogonal Latin squares enables the direct construction of a 2D map, resulting in an enhanced scrambling efficiency [25]. Orthogonal arrays can be utilized to select appropriate rows for generating a pair of orthogonal Latin squares, albeit at the cost of requiring a relatively large storage space. Latin cubes are particularly useful in encryption, especially when dealing with more complex scenarios. Therefore, here we adopt another typical combinatorial design structure: the difference matrix. With its discreteness and approximate uniformity, it requires only a small storage space, making it an ideal candidate to serve as a pseudo-random sequence. Moreover, each difference matrix possesses a crucial property in that selecting any nonzero row generates a Latin square, while choosing any two non-zero rows produces a pair of orthogonal Latin squares. Therefore, a difference matrix can provide multiple pseudo-random sequences and a variety of scrambling methods, making it highly suitable for image encryption.
In recent years, the utilization of genetic algorithms (GA) in encryption technology has emerged as a prominent research frontier within the realm of image encryption. GAs are a type of optimization algorithm that operate on the principle of natural selection and evolution. Advantages such as simplicity, robustness, intrinsic parallelism, and self-adaptation have made them a popular choice in various fields, including cryptography, combinatorial optimization, and more. In 2012, Abdullah et al. put forward a hybrid model combining a GA and a chaotic function [8]. It employed the correlation coefficient as the fitness function. This approach has weaknesses against certain attacks, however, primarily due to its reliance on plaintext images and the utilization of identical chaotic sequences to encrypt different images. Thus far, various enhanced genetic algorithms have emerged for image encryption by leveraging the optimization capabilities of GAs to generate high-quality ciphertext images [26,27,28,29], optimizing chaotic sequences [30], and employing genetic operations directly for encryption [10,31,32]. Additionally, some approaches have integrated novel technologies along with GAs to improve the security and efficiency of the resulting cryptosystem [33,34,35]. In 2018, Pashakolaee et al. put forward a novel image encryption algorithm (IEA) named Hyper-chaotic Feeded GA (HFGA) [26]. This algorithm mainly uses a GA in combination with a hyperchaotic system to optimize cryptographic images and provide a secure decryption mechanism for authorized recipients. In the same year, Mozaffari proposed a parallel IEA on the basis of bit-plane decomposition [27]. In this approach, a GA was utilized to perform permutation and replacement steps through crossover and mutation operations. The resulting algorithm enables parallel processing of multi-bit-plane encryption, thereby enhancing the encryption speed and rendering it suitable for real-time applications. In 2019, Premkumar et al. put forward a secure composite 3D chaos-based image encryption algorithm utilizing a GA [31]. The algorithm was implemented by arithmetic crossover, multi-point crossover, and permutation of combinatorial mutation operators. In 2021, Zhang put forward a new IEA integrating genetic mutation and MLNCML [34]. The proposed encryption scheme employs DNA mutation and crossover operations by chaotic sequences. By integrating chaotic systems into the DNA operations, the scheme can effectively counter man-in-the-middle attacks, which are prevalent in traditional DNA addition and subtraction operations. In 2022, Qobbi proposed a novel encryption scheme combining a 2D logical mapping and genetic manipulations [10]. The algorithm’s security was guaranteed through the use of CBC with genetic manipulations. In 2022, Liang proposed an image cryptosystem combining the Fibonacci-Q matrix and GA [29]. The four-layer encryption framework employed to bolster the encryption security of this cryptosystem consists of diffusion, scrambling, diffusion, and optimization. In 2023, Bhowmik put forward an IEA employing a modified chaotic system integrated with DE and GA [30]. The GA was used to generate a unique key-string that was employed for the transposition process in the confusion stage. In summary, GAs represent a meta-heuristic optimization technique that can be applied to enhance the behavior of chaotic sequences or to improve the stochastic properties of ciphertext images during the encryption process. By introducing a GA into image encryption, it is possible to achieve a highly secure and efficient method for encrypting images.
To realize the advantageous properties of a difference matrix together with the optimization capabilities of a GA, we propose an efficient image cryptosystem utilizing both techniques. Difference matrices can serve as generators for Latin squares or pseudo-random sequences, while GA operations of crossover and mutation are employed to generate new individuals. This is followed by local optimization to achieve overall image optimization. The proposed cryptosystem first generates a difference matrix, which is then utilized for initial encryption. Subsequently, genetic operations are employed to cross and mutate the encrypted image blocks, followed by multiple rounds of optimal preservation to enhance the randomness of the final ciphertext image. The novel contributions of this research are summarized below.
  • We introduce a novel combinatorial structure for image encryption consisting of a difference matrix. It can be utilized to generate Latin squares or serve as a pseudo-random sequence while maintaining simplicity and requiring only a small amount of memory.
  • The above structure is used to generate a novel row-scrambling method using a pair of orthogonal Latin squares.
  • We define the formula for a single-point mutation. New individuals are then generated through crossover and mutation operations. Multiple rounds of local optimization using the optimal preservation strategy are used to further enhance the output.
  • Our simulation results demonstrate the effectiveness of this cryptosystem in both encryption and decryption processes, exhibiting both robustness and practicality against conventional attacks.
The remaining sections of this paper are organized as follows: Section 2 presents a concise overview of the definitions for the difference matrix and the GA; Section 3 is dedicated to presenting the detailed processes for encryption and decryption; our simulation results and security analyses are presented in Section 4; finally, Section 5 serves to summarize this article.

2. Basic Definitions and Related Concepts

2.1. Difference Matrix

Let ( G , + ) be an A b e l group of order n. An ( n , k ; 1 ) -difference matrix is a k × n matrix D = ( d i j ) with entries from G such that for any 1 i < j k ,  the multiset
{ d i s d j s : 1 s n }
(called the difference list) contains every element of G exactly once [36]. Removing any row from an ( n , k ; 1 ) -difference matrix results in an ( n , k 1 ; 1 ) -difference matrix.
Example 1.
D = 0 0 0 0 1 2 0 2 1 is a ( 3 , 3 ; 1 ) -difference matrix over Z 3 .
A Latin square of order n (defined on an n-set S) is an n × n array in which each cell contains a single symbol; thus, each symbol occurs exactly once in each row and column. Two Latin squares of order n A = ( a i j ) and B = ( b i j ) are orthogonal if every ordered pair in S × S occurs exactly once in the juxtaposition array C = ( ( a i j , b i j ) ) .
Theorem 1
([36]). An ( n , k ; 1 ) -difference matrix over an Abel group G gives rise to k 1 mutually orthogonal Latin squares of order n.
Theorem 2
([37]). The multiplication table for the finite field F q is a ( q , q ; 1 ) -difference matrix.
Theorem 2 demonstrates that each nonzero row in a difference matrix can be used to generate a Latin square through the use of the addition operation. In addition, any two rows in a difference matrix can be used to generate a pair of orthogonal Latin squares.
Example 2.
Let F 4 be a field of order 4. Supposing that x is a primitive root of F 4 and that the primitive polynomial is x 2 + x + 1 , let g 0 = 0 , g 1 = 1 , g 2 = x , and g 3 = x + 1 ; then, F 4 = { g 0 , g 1 , g 2 , g 3 } .
First, by utilizing Theorem 2 to generate the multiplication table of F 4 , we can obtain a (4,4;1)-difference matrix M t with M t ( i , j ) = g i × g j . Subsequently, this matrix can be converted into digital format:
M t = 0 0 0 0 0 1 x x + 1 0 x x + 1 1 0 x + 1 1 x M t = 0 0 0 0 0 1 2 3 0 2 3 1 0 3 1 2 .
By selecting two nonzero rows from the difference matrix M t , namely, r o w 1 = 2 and r o w 2 = 3 , we can form two Latin squares L m 1 and L m 2 using the addition operation in F 4 :
L m 1 = 0 1 2 3 1 0 3 2 2 3 0 1 3 2 1 0 , L m 2 = 0 2 3 1 1 3 2 0 2 0 1 3 3 1 0 2 .
We use L m 1 and L m 2 to construct the juxtaposition array L m 12 , where each ordered pair occurs only once. Thus, it can be inferred that L m 1 and L m 2 are orthogonal:
L m 12 = 00 12 23 31 11 03 32 20 22 30 01 13 33 21 10 02 .

2.2. Logistic Map

The logistic map signal, which is one of the most well-known signals exhibiting chaotic behavior, can be described as follows (1):
x n + 1 = μ x n ( 1 x n ) , n = 0 , 1 , 2 , . . .
where x n is a real number between [ 0 , 1 ] and μ is a system parameter. When 3.573815 < μ 4 , the sequence { x n | n = 0 , 1 , 2 , . . . } has chaotic properties. Sensitivity to initial values and non-periodicity are the characteristics required by cryptography for keys and chaotic sequences.

2.3. Genetic Algorithm (GA)

Based on the principle of natural selection, John Holland first proposed GA as an optimization algorithm utilizing random search techniques in 1975. By selecting the most fit individuals and recombining their genetic information via crossover and mutation operations, a GA evolves a population of candidate solutions to generate new individuals. This process continues until satisfactory solutions are obtained or the algorithm reaches a predetermined stopping criterion. Thanks to their robustness, flexibility. and effectiveness in finding optimal solutions, GAs have been widely used in multiple optimization problems across different domains [38,39].

2.3.1. Selection

A GA mainly evaluates individuals according to their fitness, with commonly employed methods including sorting selection, roulette wheel selection, etc. Occasionally, to prevent the loss of the best individuals, a strategy of optimal preservation is implemented whereby the fittest members of the population are directly carried over into the next generation without undergoing selection, crossover, or mutation.

2.3.2. Crossover Operation

The crossover operation is a fundamental genetic operator in a GA that combines the genetic material of two or more parent individuals to generate new offspring. This process mimics the sexual reproduction found in nature, in which genes are inherited from parents. Various types of crossover operators exist within genetic algorithms, such as single-point, double-point, and multi-point crossovers, uniform crossover, arithmetical crossover, and many others. The crossover operation formula used in our proposed cryptosystem is presented below (2):
n s 1 = f l o o r ( p s 1 / 2 c ) × 2 c + p s 2 ( m o d 2 c ) , n s 2 = f l o o r ( p s 2 / 2 c ) × 2 c + p s 1 ( m o d 2 c ) ,
where c denotes a crossover point, which is the index at which the genetic material of the two parent solutions is swapped; p s 1 and p s 2 represent two parent solutions, usually expressed as integers; n s 1 and n s 2 indicate two offspring solutions; and f l o o r and m o d represent the down round and module integer functions, respectively. We use (2) to formulate the crossover function ( n s 1 , n s 2 ) = crossover ( p s 1 , p s 2 , c ) , which can be directly applied later. An illustrative example of the crossover operation is presented in Table 1.

2.3.3. Mutation Operation

Mutation is another crucial genetic operator in GAs, introducing random changes to an individual’s genetic material to create new candidate solutions. This operator plays a vital role in maintaining population diversity, preventing premature convergence, and enhancing the algorithm’s local search capability. Various mutation operators are utilized in genetic algorithms, such as basic bit mutation, uniform mutation, Gaussian mutation, and others. In this paper, we define the rule of the mutation operation as follows (3):
g m = f l o o r ( p m / 2 c ) × 2 c + 2 c 1 p m ( m o d 2 c )
where c is a mutation point, p m denotes a parent solution, and g m represents a newly generated solution. We use (3) to formulate the mutation function g m =mutation( p m , c ) for direct application in subsequent steps. An illustrative example of the mutation operation is presented in Table 2.

3. The Proposed Cryptosystem

We now introduce several symbols that are utilized in the rest of this paper. The symbol n represents a prime power, Q denotes an n × n grayscale image, C signifies the corresponding ciphertext image, and K 1 refers to the initial encryption key. This cryptosystem is comprised of the following three parts. In Algorithm I, a difference matrix M defined on a finite field is generated using K 1 . Algorithm II is utilized to perform the initial encryption, which consists of three layers: large-scale mutation, scrambling, and diffusion. This results in the formation of the initial encrypted image C i n i . In Algorithm III, both crossover and mutation operations are applied block-by-block to C i n i , and the final ciphertext image C is obtained over multiple iterations through the optimal preservation strategy. The encryption diagram of this cryptosystem is shown in Figure 1.

3.1. Generation of a Difference Matrix M

We generate a difference matrix M on a finite field. Initially, K 1 is utilized to produce an n-length chaotic sequence, which is employed to construct a finite field of order n. Subsequently, the difference matrix M is generated.
Algorithm I: The generation of M
Input:  K 1 = ( μ 0 , k e y 0 , k e y 1 ) .
Output: An ( n , n ; 1 ) -difference matrix M.
Step 1: Generate a logistic sequence of length 1000 + n using (1) with system parameter μ 0 and initial value x 0 = k e y 0 . The sequence obtained by excluding the initial 1000 values is denoted as X = { x i | i = 0 , 1 , 2 , . . . , n 1 } . Use the function
[ f x , l x ] = s o r t ( X )
to sort X in ascending order and obtain a new sequence f x , and corresponding index subscript vector l x .
Step 2: Redefine the addition and multiplication operations on l x , then construct a finite field F 1 = { g 0 , . . . , g n 1 } [23]. generate an ( n , n ; 1 ) -difference matrix M with M ( i , j ) = g i × g j .

3.2. Generation of the Initial Ciphertext Image

This section describes the generation of the initial ciphertext image C i n i . First, a new encryption key is generated by adopting the information of the plaintext image. Then, a new n-length chaotic sequence is generated to construct the second finite field according to the method of generating a finite field from a sequence, as described in Algorithm I. Subsequently, a pair of orthogonal Latin squares is generated by selecting two nonzero rows from M. Finally, C i n i is generated through three steps: large-scale mutation, scrambling, and diffusion.
Algorithm II: Generate the initial ciphertext image C i n i .
Input: An n × n grayscale image Q, K 1 = ( μ 0 , k e y 0 , k e y 1 ) , M and a public parameter a.
Output: The initial ciphertext image C i n i .
Step 1: Read Q and calculate the sum of all the pixel values, denoted as s u m Q . Letting
s = f l o o r ( m o d ( s u m Q , 256 ) / 256 × 10 2 ) / 10 2 ,
compute k e y 1 _ n e w = ( k e y 1 + s ) / 2 . Using μ 0 as the system parameter and k e y 1 _ n e w as the initial value, generate the second n-length chaotic sequence, then form the second finite field F 2 using the method in Algorithm I.
Step 2: Obtain an ( n , n 1 ; 1 ) -difference matrix by removing the zero row of matrix M. Select rows m o d ( s u m Q , n 1 ) and m o d ( s u m Q + a , n 1 ) to generate two n × n orthogonal Latin squares L m 1 and L m 2 via F 2 . By transforming these squares into row vectors, denoted as L 1 and L 2 , respectively, two index indicators i n d 1 and i n d 2 can be constructed based on their uniformity using the following formula:
i n d k = m o d ( L k , 8 ) + 1 , k = 1 , 2 .
Step 3: Large-scale mutation. Transform Q into a row vector P 1 . Based on the parity of s u m Q , distinct index indicators can be selected to sequentially mutate each element of P 1 and generate a new row vector P 2 using the mutation formula provided below.
P 2 ( i ) = m u t a t i o n ( P 1 ( i ) , i n d 2 m o d ( s u m Q , 2 ) ( i ) ) , i = 0 , 1 , 2 , . . . , n 2 1 .
Step 4: Image scrambling. Utilize the orthogonality of L 1 and L 2 to scramble P 2 and L t (The row vector formed by the transposition of M), resulting in the scrambled row vector P 3 and an approximately uniform vector L T .
P 3 ( i ) = P 2 ( L 1 ( i ) × n + L 2 ( i ) + 1 ) , i = 0 , 1 , 2 , . . . , n 2 1 . L T ( i ) = L t ( L 2 ( i ) × n + L 1 ( i ) + 1 ) , i = 0 , 1 , 2 , . . . , n 2 1 .
Step 5: Image diffusion. The initial ciphertext image C i n i is formed using L 1 , L 2 and L T as pseudo-random sequences for auxiliary diffusion.
t e m p = m o d ( L 1 ( i ) + L 2 ( i ) + L T ( i ) , 256 ) , C i n i ( i ) = P 3 ( i ) t e m p C i n i ( i 1 ) , i = 0 , 1 , 2 , . . . , n 2 1 ,
where t e m p represents a temporary variable, C i n i ( 1 ) = 0 and ⊕ represents an XOR operation.

3.3. Optimization Process Using GA

In this section, we use a GA to optimize C i n i in order to enhance the randomness of the final encrypted image. First, owing to the inherent randomness of GAs, multiple indexes are determined in order to restore the original plaintext image. Then, local crossover and mutation operations on C i n i blocks are used to construct a large number of encrypted images, which significantly increases the level of randomness. Finally, after multiple rounds of genetic operations and using the optimal preservation strategy, the final encrypted image C and secondary key K 2 are generated.
Algorithm III: The optimization process using GA.
Input:  C i n i , i n d 1 , i n d 2 , L T , the number of crossover blocks N c , the number of mutation blocks N m , and the number of iterations N u m .
Output: The final encrypted image C and the secondary key K 2 .
Step 1: Process L T as follows to acquire the third index indicator i n d 3 :
i n d 3 = m o d ( L T , 8 ) + 1 .
Step 2: Crossover operation. Divide C i n i into N c parts from left to right and intersect each part according to i n d 1 and i n d 2 to form 2 × N c new individuals. These individuals are then stored in the matrix C M 1 . Using entropy as the fitness function, select the best individual, denoted as C 1 , through the optimal preservation strategy. Simultaneously, record the corresponding index value I n d c b e s t in the first row component of K 2 . The Algorithm 1 is presented below, where crossover represents the compiled crossover function (2).
Algorithm 1 Local crossover operation
1:
for all  k = 1 : N c  do
2:
  for all  i = n 2 / N c ( k 1 ) + 1 : 2 : n 2 / N c k 1  do
3:
     ( C M 1 ( k , i ) , C M 1 ( k , i + 1 ) ) = crossover ( C i n i ( i ) , C i n i ( i + 1 ) , i n d 1 ( i ) ) ;
4:
     ( C M 1 ( N c + k , i ) , C M 1 ( N c + k , i + 1 ) ) = crossover ( C i n i ( i ) , C i n i ( i + 1 ) , i n d 2 ( i ) ) ;
5:
  end for
6:
end for
7:
C 1 = C M 1 ( I n d c b e s t , : ) ;
8:
return  C 1
Step 3: Mutation operation. Divide C 1 into N m parts from left to right; each part undergoes mutation according to i n d 2 and i n d 3 , resulting in the formation of 2 × N m new individuals that are stored in the matrix C M 2 . Use the optimal preservation strategy to select the best individual as C 2 and record the corresponding index value I n d m b e s t in the second row component of K 2 . The Algorithm 2 is presented below, where mutation represents the compiled mutation function (3).
Algorithm 2 Local mutation operation
1:
for all  k = 1 : N m  do
2:
  for all  i = n 2 / N m ( k 1 ) + 1 : 1 : n 2 / N m k 1  do
3:
     C M 2 ( k , i ) = mutation ( C 2 ( i ) , i n d 2 ( i ) ) ;
4:
     C M 2 ( N m + k , i ) = mutation ( C 2 ( i ) , i n d 3 ( i ) ) ;
5:
  end for
6:
end for
7:
C 2 = C M 2 ( I n d m b e s t , : ) ;
8:
return  C 2
Step 4: Let C i n i = C 2 . Continue with Steps 2 and 3 until the number of iterations N u m or I n d c b e s t and I n d m b e s t match that of the previous column in K 2 , then terminate the calculation and record final iteration number as I n d b e s t .
Step 5: Transpose C 2 , the vector obtained after the iteration, into an n × n matrix in order to obtain C and output K 2 .

3.4. Image Decryption Process

The proposed cryptosystem employs asymmetric processes for both encryption and decryption. To decrypt C, the receiver requires K 1 and K 2 along with the characteristic value s u m Q and the public parameter a. The decryption diagram of this cryptosystem is illustrated in Figure 2.
The steps are described in detail below.
Step 1: First, K 1 is utilized to generate M following Algorithm I. Then, three row vectors L 1 , L 2 , and L T are generated using s u m Q and a.
Step 2: C is transformed into a row vector R 1 and the pre-optimized image R 2 is decrypted using K 2 . This step is asymmetric with regard to the optimization process, and can be decrypted directly by using K 2 . Initially, mutation is performed according to the second index block of the last column of K 2 , then crossover is conducted according to the first index block, iterating I n d b e s t times to obtain R 2 .
Step 3: The original image R is recovered from R 2 . First, reverse diffusion is performed on R 2 to obtain R 3 , then reverse scrambling to obtain R 4 , followed by reverse large-scale mutation to acquire R 5 . Finally, the result is transposed into an n × n matrix in order to obtain the decrypted image R. This step is a complete reversal of the initial encryption process, and is not repeated.

4. Simulation Results and Safety Analyses

To validate the security and efficacy of the cryptosystem proposed in this paper, a set of 256 × 256 grayscale images from the USC-SIPI2 image set were selected as test samples. The initial key K 1 was set to μ 0 = 3.99999 , k e y 0 = 0.123456 and k e y 1 = 0.234567 , whilehe public parameters were set to a = 31 , N c = 16 , N m = 32 , and N u m = 20 .
In the process of utilizing GAs for image encryption, fitness functions such as entropy and correlation coefficients are commonly employed for assessing the quality of ciphertext images. However, due to the stochastic nature of correlation coefficients, in this paper we have instead adopted the information entropy of the encrypted image as the fitness function.
We evaluated our proposed cryptosystem through simulation experiments from various aspects, including key space and sensitivity analyses, statistical analyses, resistance to differential attacks, and more. To demonstrate its superiority over recent algorithms, a comparison is provided in terms of security and efficiency.

4.1. Simulation Results

Our cryptosystem is highly effective in converting a grayscale image into a meaningless encrypted image, thereby ensuring the confidentiality and privacy of the original. Additionally, the decrypted image remains unchanged, with no loss or distortion, guaranteeing its integrity and authenticity. Figure 3a shows the several plaintext images, Figure 3c depicts the corresponding ciphertext images, and Figure 3e illustrates the lossless decrypted images. In this cryptosystem, the initial encryption process ensures that any image meets the requirements for encryption, while the optimization stage further enhances the overall randomness. The second keys and the iteration numbers required for optimization are displayed in Table 3. For a majority of the images, the optimization process can be completed within 20 generations, resulting in relatively higher-quality ciphertext images.

4.2. Key Analyses

4.2.1. Key Space Analysis

The key space of a cryptosystem is a metric describing its resistance against brute-force attacks. A larger key space results in increased resistance to such attacks, making it more difficult for attackers to determine the correct key. The initial key K 1 = ( μ 0 , k e y 0 , k e y 1 ) has a precision of 10 15 for each real number. Therefore, the key space can reach at least 10 45 2 149 , which is significantly larger than 2 128 [40,41]. In addition, each image has a unique K 2 value during decryption, and there is a public parameter that can be selected. Therefore, the key space of the proposed cryptosystem is of sufficient size to defend against brute-force attacks.

4.2.2. Key Sensitivity Analyses

Key sensitivity is a crucial property of an image cryptosystem, ensuring that even the slightest alteration in the encryption or decryption key will result in two entirely distinct datasets. In regard to the proposed cryptosystem, the key sensitivity can be analyzed from two perspectives: during the encryption stage and during the decryption stage.
To analyze the key sensitivities of the proposed cryptosystem, we selected Lena as the test image. The resulting ciphertext image when encrypting Lena with the initial key K 1 = ( 3.99999 , 0.123456 , 0.234567 ) is denoted as c i p h e r 1 . A minute value of 10 15 was subsequently added to each element of K 1 , resulting in c i p h e r 2 as the ciphertext image obtained by encrypting Lena with the altered key. A comparison of the results of two encrypted images under three sets of parameters is shown in Figure 4, revealing that while both images contain noise, they differ significantly from each other. Table 4 calculates the percentages of different pixels in the two contrasting images after encryption, with the results surpassing 99.6 % . This fully demonstrates the exceptional sensitivity of the proposed cryptosystem during encryption.
For the sensitivity analysis performed during decryption, we again used Lena as the test image. Utilizing K 1 = ( 3.99999 , 0.123456 , 0.234567 ) and K 2 to decrypt C, the original image can be obtained; however, even a slight alteration of 10 15 in each value of K 1 results in a meaningless and completely different decryption compared to the original image. The contrasting results are presented in Figure 5. Further, Table 4 lists the percentages of different pixels between Q and the decryption using the modified key, reaching more than 99.52%. This fully demonstrates that the proposed cryptosystem is highly sensitive to K 1 . Additionally, there is an equally strong sensitivity to K 2 , which need not be reiterated here.

4.3. Histogram Analyses

In the context of image encryption algorithms, the randomness and uniformity of the encrypted image are important for protecting against statistical attacks. The more random and uniform the ciphertext image is, the more challenging it becomes for attackers to identify correlations or patterns that can be exploited to break the encryption [40]. Typically, the variance S is employed as to describe the uniformity of the pixel distribution. Its calculation formula is
S = 1 256 i = 0 255 ( h i s t i a v e r ) 2 ,
where h i s t i ( i = 0 , 1 , . . . , 255 ) represents the occurrence of the ith grayscale value in the image and a v e r denotes the mean value of h i s t i . A smaller value of S implies a more homogeneous distribution of grayscale pixels in the encrypted image, posing a challenge for attackers to exploit any statistical patterns and break the encryption.
Figure 3 illustrates the changes in the histograms of multiple images pre- and post-encryption. The histograms of the ciphertext images display a more homogeneous distribution in comparison to that of the original image, indicating an approximately equal frequency of occurrence for each grayscale value. Table 5 presents the variance values of multiple images pre- and post-encryption. The data indicate that after encryption, the variance values decrease significantly and are all smaller than the standard value χ 0.05 2 = 293.25 , which meets the encryption requirement. Notably, the variance of the encrypted Lena image is as low as 101.133, indicating the effectiveness of our proposed cryptosystem in resisting histogram analyses.

4.4. Correlation Coefficient Analyses

In a plaintext image, adjacent pixels exhibit a strong correlation, which can be exploited by attackers to break the encryption using statistical patterns or correlations. Therefore, an effective encryption algorithm should eliminate the correlation of adjacent pixels in order to increase resistance against statistical analyses. Typically, correlation coefficients are commonly computed to assess the strength of correlations using the formula
r u v = E [ u E ( u ) ] [ v E ( v ) ] D ( u ) D ( v ) ,
E ( u ) = 1 N i = 1 N u i , D ( u ) = 1 N i = 1 N ( u i E ( u ) ) 2 ,
where u and v represent the gray values of two adjacent pixels, E ( u ) denotes the expected value of u, D ( u ) represents its variance, and N denotes the quantity of samples randomly selected from the image.
In this study, we selected 4000 pairs of adjacent pixels in a stochastic manner from the vertical, horizontal, and diagonal directions in the image. The coefficients in the three directions x, y, and z were then calculated according to Equations (12) and (13) and the average coefficients were obtained using Equation (14).
a v e r c o e f = | x | + | y | + | z | 3
The resulting coefficients are presented in Table 5. In the table, the correlation coefficient of each plaintext image is highly proximate to 1 in three distinct directions, indicating a strong correlation between adjacent pixels. Conversely, the correlation coefficient of every ciphertext image approaches 0, signifying a weakened correlation. To demonstrate the optimization effect of our cryptosystem, we compared the correlation coefficients of the encrypted Lena image with those obtained from several recently proposed algorithms. The contrasting results of the coefficients are displayed in Table 6. As can be seen, the average correlation coefficient when using our cryptosystem is larger than the results for those in [29,42], but smaller than those in the other seven papers. This indicates that our approach can effectively mitigate the pixel correlation.
To obtain a more intuitive visual comparison, Figure 6 displays the pre- and post-encryption distribution of neighboring pixels in three directions for three different images when using our proposed cryptosystem. The midpoint of the original grayscale image is effectively scattered along the diagonal line, whereas that of the corresponding ciphertext image is more uniformly distributed within the entire scope. This demonstrates that the proposed cryptosystem is capable of achieving superior confounding effects and successfully passing the correlation test.

4.5. Entropy Analyses

Information entropy is another crucial measure for testing the uncertainty or randomness of ciphertext images, and can also be used to assess the efficacy of encryption algorithms. Its symbolic representation is H, and the calculation formula can be expressed as follows:
H ( m ) = i = 0 l 1 p ( m i ) l o g 2 p ( m i )
where l is the number of gray values and m i and p ( m i ) are the gray values and their occurrence probabilities, respectively. In cryptography, a secure cryptosystem should produce ciphertext images with uniform gray values in order to increase randomness and security. The ideal value of information entropy for an image with 256 gray levels is 8 [46].
Following Equation (15), we calculated the information entropy values of multiple encrypted images. Table 5 displays the results, while Table 6 lists the contrasting results obtained for Lena with different algorithms. As can be seen, all entropy values are very close to 8; the information entropy for the encrypted Lena image reaches 7.99888, which is a larger value than most of the other algorithms. Therefore, the proposed image cryptosystem is capable of generating ciphertext images with a more random and uniform distribution of pixel values, resulting in increased security and confidentiality.

4.6. Differential Attack Analyses

In order to be resistant to differential attacks, a secure cryptosystem should guarantee that even minor alterations to the plaintext will lead to large changes in the encrypted image. In general, two criteria, NPCR and UACI, are used to evaluate resistance to differential attacks. The respective formulas are provided below.
N P C R = i = 0 M 1 j = 0 N 1 D ( i , j ) M × N × 100 % ,
where D i , j = 0 , C 1 ( i , j ) = C 2 ( i , j ) 1 , C 1 ( i , j ) C 2 ( i , j )
U A C I = i = 0 M 1 j = 0 N 1 C 1 ( i , j ) C 2 ( i , j ) 255 × M × N × 100 % .
In the above formulas, C 1 and C 2 are two ciphertext images that correspond to plaintext images with only one different pixel, while M and N represent the width and height of the encrypted image, respectively.
For each plaintext image, 100 pixels at different positions are randomly selected and increased by 1. Table 7 displays the maximum, lowest, and average values of NPCR and UACI. The significance level was set to 0.05, and the ideal expected values of NPCR and UACI for grayscale images with a size of 256 × 256 were obtained from [47]. The average NPCR values in Table 7 exceed the ideal values. Moreover, the average values of UACI are found to fall within the interval [ U 0.05 , U 0.05 + ]. This testifies that the proposed image cryptosystem exhibits high resistance to differential attacks with respect to pixel modifications.

4.7. Cutting and Noise Attack Analyses

Signal loss or noise pollution can compromise the security and confidentiality of transmitted ciphertext images. To test a ciphertext image’s resilience against data loss and noise attacks, experiments can simulate such conditions to assess the encryption algorithm’s ability to maintain data integrity [48].
Cutting parts of the ciphertext image can cause information loss and hinder the successful recovery of the original plaintext message. Taking the Plane image as an example, the corresponding decryptions are shown in Figure 7 when cutting 1/16, 1/8, 1/4, and 1/2 at the upper left corner of the encrypted image. As can be seen, even when up to 50% of the encrypted image is cut, the proposed cryptosystem is still able to recover a visually recognizable image of the original message using the correct key. In addition, it demonstrates strong robustness against various types of noise attacks, including salt and pepper noise (SPN) with densities of 0.05 and 0.1 and Gaussian noise (GN) with a mean value of 0 and variances of 0.01 and 0.1. Despite the introduction of such noise types into the ciphertext image, the deciphering process utilizing the correct encryption key remains discernible, as demonstrated in Figure 8. Overall, these results demonstrate the good robustness of our cryptosystem against both cutting attacks and different types of noise attacks.
Additionally, the PSNR index is usually employed for assessing the quality of decrypted images after attacks. The formula is
PSNR = 10 × l o g 10 M × N × 255 2 i = 0 M 1 j = 0 N 1 ( P 1 ( i , j ) P ( i , j ) ) 2 ,
where P and P 1 denote the original decrypted image of size M × N and the decrypted image after attacks, respectively. A higher PSNR value indicates better image quality.
Table 8 displays the PSNR values of various images that have undergone cutting and noise attacks using the proposed encryption cryptosystem. The data in the table suggest that the PSNR values under these cutting attacks are greater than 7.7 dB, while those for the noise attack are greater than 7.2 dB. These findings suggest that the decrypted images exhibit relatively low levels of distortion compared to their original counterparts even after being attacked, and continue to maintain a high level of visual quality. Therefore, these results indicate that our cryptosystem is robust against both cutting and noise attacks.

4.8. Computational Complexity and Encryption Speed Analyses

Computational complexity (CC) and encryption speed are crucial factors to consider when evaluating the validity of an image cryptosystem. First, Algorithm I generates a chaotic sequence with length n, with computational complexity O ( n ) , followed by constructing a difference matrix with computational complexity O ( n 2 ) . In Algorithm II, there are three layers of encryption structure: large-scale mutation, scrambling, and diffusion; thus, the CC is O ( 3 n 2 ) . Algorithm III is an optimization process, including crossover and mutation operations, meaning that the CC is also O ( 4 n 2 ) . Therefore, the CC of our cryptosystem is O ( n 2 ) .
The experimental environment was MATLAB R2019b, Microsoft Windows 10, Intel i5-1135G7, a 2.40 GHz processor, and 16 GB RAM. Based on 100 calculations, Table 9 presents the average time taken to perform encryption and decryption of six representative images. The results indicate that each image takes approximately 5.86 s to encrypt and about 0.43 s to decrypt, suggesting the effectiveness of our image cryptosystem for instant encryption. The proposed cryptosystem employs an asymmetric process for encryption and decryption that involves multi-segment and multi-round crossover and mutation operations during encryption, which can be computationally expensive and result in longer optimization and encryption times compared to other algorithms. However, the decryption time is significantly shorter when using the secondary secret key to decrypt the ciphertext image directly. The comparison results reported in Table 9 demonstrate that our GA-based encryption cryptosystem is faster in both encryption and decryption compared to other contrasting algorithms, with the exception of the algorithm presented in [29], reflecting the efficient optimization process of the proposed cryptosystem.

4.9. Analysis of Resistance to Chosen-Plaintext Attacks

Chosen-plaintext attacks are a potent method of attacking encryption schemes. In such an attack, the attacker has access to the encryption scheme, and can select plaintext images and encrypt them to obtain the key’s information. If a cryptosystem is able to withstand chosen-plaintext attacks, this usually indicates that the encryption approach is secure against three other classical attacks as well: ciphertext-only attacks, known-plaintext attacks and chosen-ciphertext attacks [21,53].
In the proposed cryptosystem, the same difference matrix is used for all images in image encryption. This matrix only needs to be generated once, and can be reused to encrypt multiple images. However, employing the information of plaintext images in the key ensures that the encrypted data remain unique and secure for every individual image even if the difference matrix is identical. Specifically, the entire cryptosystem is extremely sensitive to both K 1 = ( μ 0 , k e y 0 , k e y 1 ) and to the plaintext image. If even a single pixel is altered, the resulting L 1 , L 2 , and L T will be completely distinct. Additionally, our encryption cryptosystem utilizes two Latin squares and leverages the approximate uniformity of the difference matrix during diffusion. With just one round of encryption processing required to achieve a secure result, our cryptosystem is resistant to chosen-plaintext attacks, as well as other forms of intrusion.
Additionally, all-black or all-white images are frequently utilized by hackers to launch attacks on encryption algorithms. These special images were also subjected to experiments. Table 5 shows the resulting correlation coefficients of approximately 0, variance values of approximately 100, and entropies of approximately 8 for two encrypted ciphertext images. These results fully demonstrate that the proposed cryptosystem can resist statistical attacks. Table 7 shows that both of the encrypted images pass the differential attack tests successfully. Table 8 displays that all PSNR values related to both encrypted images exceed 7.2 dB, demonstrating our cryptosystem’s robustness. Moreover, our cryptosystem exhibits resistance against chosen-plaintext attacks as well as other classical attack methods.

5. Conclusions

In this paper, an efficient image cryptosystem utilizing a difference matrix and a genetic algorithm is put forward. The discreteness and approximate uniformity of the difference matrix satisfy the characteristics of a pseudo-random sequence, enabling a variety of scrambling methods while occupying a very small storage space. Additionally, the GA’s crossover and mutation operations can generate numerous new individuals, and the optimal preservation strategy can then select the best one. The proposed cryptosystem first generates a difference matrix using the initial secret key; then, the difference matrix is used to perform image encryption. The resulting initial ciphertext image already has relatively good randomness. A large number of ciphertext images are then obtained through local genetic operations in order to generate better-quality ciphertext images through multiple iterations using the optimal preservation strategy, which strengthens the randomness of the final ciphertext image. We used this cryptosystem to effectively encrypt test images, and it successfully passed all tests. Furthermore, it offers a number of advantages over other existing algorithms.
Finally, the use of a combined structure consisting of a difference matrix and a genetic algorithm to generate more secure ciphertext images showcases interdisciplinary advantages that can serve as a reference for future research.

Author Contributions

Conceptualization, X.S.; data curation, H.S.; formal analysis, H.S. and X.S.; investigation, H.S.; methodology, H.S. and X.S.; project administration, H.S.; resources, H.S. and X.S.; software, H.S.; supervision, X.S.; validation, H.S. and X.S.; visualization, H.S.; writing—original draft, H.S.; writing—review and editing, H.S. and X.S. 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 under Grant Numbers 11871019.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data used to support the findings of this study are included within the article.

Acknowledgments

The authors would like to thank the editor and the anonymous reviewers for their valuable comments and suggestions to improve the quality of this paper.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Wang, X.; Liu, C.; Jiang, D. A novel triple-image encryption and hiding algorithm based on chaos, compressive sensing and 3D DCT. Inform. Sci. 2021, 574, 506–527. [Google Scholar] [CrossRef]
  2. Zhou, S.; Wang, X.; Zhang, Y.; Ge, B.; Wang, M.; Gao, S. A novel image encryption cryptosystem based on true random numbers and chaotic systems. Multimed. Syst. 2022, 28, 95–112. [Google Scholar] [CrossRef]
  3. Nardo, L.G.; Nepomuceno, E.G.; Bastos, G.T.; Santos, T.A.; Butusov, D.N.; Arias-Garcia, J. A reliable chaos-based cryptography using Galois field. Chaos Interdiscip. J. Nonlinear Sci. 2021, 31, 091101. [Google Scholar] [CrossRef] [PubMed]
  4. Li, H.; Li, T.; Feng, W.; Zhang, J.; Zhang, J.; Gan, L.; Li, C. A novel image encryption scheme based on non-adjacent parallelable permutation and dynamic DNA-level two-way diffusion. J. Inf. Secur. Appl. 2021, 61, 102844. [Google Scholar] [CrossRef]
  5. Dong, W.; Li, Q.; Tang, Y.; Hu, M.; Zeng, R. A robust and multi chaotic DNA image encryption with pixel-value pseudorandom substitution scheme. Opt. Commun. 2021, 499, 127211. [Google Scholar] [CrossRef]
  6. 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]
  7. Sha, Y.; Bo, S.; Yang, C.; Mou, J.; Jahanshahi, H. A chaotic image encryption scheme based on genetic central dogma and KMP method. Int. J. Bifurc. Chaos 2022, 32, 2250186. [Google Scholar] [CrossRef]
  8. Abdullah, A.H.; Enayatifar, R.; Lee, M. A hybrid genetic algorithm and chaotic function model for image encryption. AEU-Int. J. Electron. Commun. 2012, 66, 806–816. [Google Scholar] [CrossRef]
  9. Zhang, Y.; He, Y.; Li, P.; Wang, X. A new color image encryption scheme based on 2DNLCML system and genetic operations. Opt. Lasers Eng. 2020, 128, 106040. [Google Scholar] [CrossRef]
  10. Qobbi, Y.; Jarjar, A.; Essaid, M.; Benazzi, A. Image encryption algorithm based on genetic operations and chaotic DNA encoding. Soft Comput. 2022, 26, 5823–5832. [Google Scholar] [CrossRef]
  11. Xu, Q.; Sun, K.; Cao, C.; Zhu, C. A fast image encryption algorithm based on compressive sensing and hyperchaotic map. Opt. Lasers Eng. 2019, 121, 203–214. [Google Scholar] [CrossRef]
  12. 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]
  13. Khan, J.S.; Kayhan, S.K. Chaos and compressive sensing based novel image encryption scheme. J. Inf. Secur. Appl. 2021, 58, 102711. [Google Scholar] [CrossRef]
  14. Xian, Y.; Wang, X. Fractal sorting matrix and its application on chaotic image encryption. Inform. Sci. 2021, 547, 1154–1169. [Google Scholar] [CrossRef]
  15. Premkumar, R.; Mahdal, M.; Elangovan, M. An efficient chaos-based image encryption technique using bitplane decay and genetic operators. Sensors 2022, 22, 8044. [Google Scholar] [CrossRef] [PubMed]
  16. Li, G. A digital image scrambling method based on orthogonal Latin square. J. North China Univ. Tech. 2001, 13, 14–16. [Google Scholar]
  17. Zhang, X.; Wu, T.; Wang, Y.; Jiang, L.; Niu, Y. A novel chaotic image encryption algorithm based on Latin square and random shift. Comput. Intel. Neurosci. 2021, 2021, 2091053. [Google Scholar] [CrossRef] [PubMed]
  18. Wang, X.; Su, Y.; Xu, M.; Zhang, H.; Zhang, Y. A new image encryption algorithm based on Latin square matrix. Nonlinear Dyn. 2022, 107, 1277–1293. [Google Scholar] [CrossRef]
  19. Xu, M.; Tian, Z. A flexible image cipher based on orthogonal arrays. Inform. Sci. 2021, 551, 39–53. [Google Scholar] [CrossRef]
  20. Xu, M.; Tian, Z. A novel image cipher based on 3D bit matrix and latin cubes. Inform. Sci. 2019, 478, 1–14. [Google Scholar] [CrossRef]
  21. Zhou, J.; Zhou, N.; Gong, L. Fast color image encryption scheme based on 3D orthogonal Latin squares and matching matrix. Opt. Laser Technol. 2020, 131, 106437. [Google Scholar] [CrossRef]
  22. Hua, Z.; Zhu, Z.; Chen, Y.; Li, Y. Color image encryption using orthogonal Latin squares and a new 2D chaotic system. Nonlinear Dyn. 2021, 104, 4505–4522. [Google Scholar] [CrossRef]
  23. Shen, H.; Shan, X.; Xu, M.; Tian, Z. A new chaotic image encryption algorithm based on transversals in a Latin square. Entropy 2022, 24, 1574. [Google Scholar] [CrossRef] [PubMed]
  24. Sam, I.S.; Devaraj, P.; Bhuvaneswaran, R. An efficient quasigroup based image encryption using modified nonlinear chaotic maps. Sens. Imaging 2014, 15, 1–21. [Google Scholar] [CrossRef]
  25. Xu, M.; Tian, Z. A novel image encryption algorithm based on self-orthogonal Latin squares. Optik 2018, 171, 891–903. [Google Scholar] [CrossRef]
  26. Pashakolaee, P.G.; Shahhoseini, H.S.; Mollajafari, M. Hyper-chaotic Feeded GA (HFGA): A reversible optimization technique for robust and sensitive image encryption. Multimed. Tools Appl. 2018, 77, 20385–20414. [Google Scholar] [CrossRef]
  27. Mozaffari, S. Parallel image encryption with bitplane decomposition and genetic algorithm. Multimed. Tools Appl. 2018, 77, 25799–25819. [Google Scholar] [CrossRef]
  28. Ghazvini, M.; Mirzadi, M.; Parvar, N. A modified method for image encryption based on chaotic map and genetic algorithm. Multimed. Tools Appl. 2020, 79, 26927–26950. [Google Scholar] [CrossRef]
  29. Liang, Z.; Qin, Q.; Zhou, C. An image encryption algorithm based on Fibonacci Q-matrix and genetic algorithm. Neural Comput. Appl. 2022, 34, 19313–19341. [Google Scholar] [CrossRef]
  30. Bhowmik, S.; Acharyya, S. Image encryption approach using improved chaotic system incorporated with differential evolution and genetic algorithm. J. Inf. Secur. Appl. 2023, 72, 103391. [Google Scholar] [CrossRef]
  31. Premkumar, R.; Anand, S. Secured and compound 3-D chaos image encryption using hybrid mutation and crossover operator. Multimed. Tools Appl. 2019, 78, 9577–9593. [Google Scholar] [CrossRef]
  32. Liu, H.; Zhao, B.; Huang, L. A novel quantum image encryption algorithm based on crossover operation and mutation operation. Multimed. Tools Appl. 2019, 78, 20465–20483. [Google Scholar] [CrossRef]
  33. Nematzadeh, H.; Enayatifar, R.; Motameni, H.; Guimarães, F.G.; Coelho, V.N. Medical image encryption using a hybrid model of modified genetic algorithm and coupled map lattices. Opt. Lasers Eng. 2018, 110, 24–32. [Google Scholar] [CrossRef]
  34. Zhang, Y.; Huang, H.; Wang, X.; Huang, X. A secure image encryption scheme based on genetic mutation and MLNCML chaotic system. Multimed. Tools Appl. 2021, 80, 19291–19305. [Google Scholar] [CrossRef]
  35. Murali, P.; Niranjana, G.; Paul, A.J.; Muthu, J.S. Domain-flexible selective image encryption based on genetic operations and chaotic maps. Vis. Comput. 2022, 39, 1057–1079. [Google Scholar] [CrossRef]
  36. Colbourn, C.J.; Dinitz, J.H. Handbook of Combinatorial Designs, 2nd ed.; CRC Press/Chapman & Hall: Boca Raton, FL, USA, 2007. [Google Scholar]
  37. Drake, D.A. Partial λ-geometries and generalized Hadamard matrices over groups. Can. J. Math. 1979, 31, 617–627. [Google Scholar] [CrossRef]
  38. Guesmi, R.; Farah, M.A.B.; Kachouri, A.; Samet, M. Hash key-based image encryption using crossover operator and chaos. Multimed. Tools Appl. 2016, 75, 4753–4769. [Google Scholar] [CrossRef]
  39. Kumar, J.; Nirmala, S. Random selection of crossover operation with mutation for image encryption—A new approach. In Advanced Computing and Communication Technologies: Proceedings of the 10th ICACCT, Panipat, India, 18–20 December 2016; Springer: Signapore, 2018; pp. 63–72. [Google Scholar]
  40. Liu, H.; Jin, C. A color image encryption scheme based on Arnold scrambling and quantum chaotic. Int. J. Netw. Secur. 2017, 19, 347–357. [Google Scholar]
  41. Patro, K.A.K.; Acharya, B. Secure multi–level permutation operation based multiple colour image encryption. J. Inf. Secur. Appl. 2018, 40, 111–133. [Google Scholar] [CrossRef]
  42. Zhou, W.; Wang, X.; Wang, M.; Li, D. A new combination chaotic system and its application in a new Bit-level image encryption scheme. Opt. Lasers Eng. 2022, 149, 106782. [Google Scholar] [CrossRef]
  43. Wu, J.; Liao, X.; Yang, B. Image encryption using 2D Hénon-Sine map and DNA approach. Signal Process. 2018, 153, 11–23. [Google Scholar] [CrossRef]
  44. Niu, Y.; Zhou, Z.; Zhang, X. An image encryption approach based on chaotic maps and genetic operations. Multimed. Tools Appl. 2020, 79, 25613–25633. [Google Scholar] [CrossRef]
  45. Wang, X.; Guan, N. A novel chaotic image encryption algorithm based on extended Zigzag confusion and RNA operation. Opt. Laser Technol. 2020, 131, 106366. [Google Scholar] [CrossRef]
  46. Sun, X. Image Encryption Algorithm and Practice-Based on C Sharp Language Implementation; Science Press: Beijing, China, 2013. [Google Scholar]
  47. Wu, Y.; Noonan, J.P.; Agaian, S. NPCR and UACI randomness tests for image encryption. Cyber J. Multidiscip. J. Sci. Technol. J. Sel. Areas Telecommun. (JSAT) 2011, 1, 31–38. [Google Scholar]
  48. Wang, X.; Li, Z. A color image encryption algorithm based on Hopfield chaotic neural network. Opt. Lasers Eng. 2019, 115, 107–118. [Google Scholar] [CrossRef]
  49. Zhang, Y.; Zhang, Q. A fast image encryption scheme based on public image and chaos. In Proceedings of the 2017 International Conference on Computing Intelligence and Information System (CIIS), Nanjing, China, 21–23 April 2017; pp. 270–276. [Google Scholar]
  50. Zhang, Y.; Zhang, Q. A fast image encryption scheme based with compound keys. In Proceedings of the 2018 3rd Annual International Conference on Information System and Artificial Intelligence (ISAI), Suzhou, China, 22–24 June2018; pp. 1069–1071. [Google Scholar]
  51. Shen, Q.; Liu, W. A novel digital image encryption algorithm based on orbit variation of phase diagram. Int. J. Bifurc. Chaos 2017, 27, 1750204. [Google Scholar] [CrossRef]
  52. Hu, H.; Cao, Y.; Xu, J.; Ma, C.; Yan, H. An image compression and encryption algorithm based on the fractional-order simplest chaotic circuit. IEEE Access 2021, 9, 22141–22155. [Google Scholar] [CrossRef]
  53. Yildirim, M. A color image encryption scheme reducing the correlations between R, G, B components. Optik 2021, 237, 166728. [Google Scholar] [CrossRef]
Figure 1. Encryption diagram of the proposed cryptosystem.
Figure 1. Encryption diagram of the proposed cryptosystem.
Entropy 26 00351 g001
Figure 2. Decryption diagram of the proposed cryptosystem.
Figure 2. Decryption diagram of the proposed cryptosystem.
Entropy 26 00351 g002
Figure 3. Histograms of different plaintext images and ciphertext images. The plaintext images from top to bottom are as follows: Lena, Cameraman, Plane, Allblack, Allwhite. (a) Plaintext images; (b) the corresponding histograms of (a); (c) ciphertext images; (d) the corresponding histograms of (c); (e) the decryption of (c).
Figure 3. Histograms of different plaintext images and ciphertext images. The plaintext images from top to bottom are as follows: Lena, Cameraman, Plane, Allblack, Allwhite. (a) Plaintext images; (b) the corresponding histograms of (a); (c) ciphertext images; (d) the corresponding histograms of (c); (e) the decryption of (c).
Entropy 26 00351 g003
Figure 4. Key sensitivity test results in the encryption stage: (a) μ 0 + 10 15 , (b) k e y 0 + 10 15 , and (c) k e y 1 + 10 15 .
Figure 4. Key sensitivity test results in the encryption stage: (a) μ 0 + 10 15 , (b) k e y 0 + 10 15 , and (c) k e y 1 + 10 15 .
Entropy 26 00351 g004
Figure 5. Key sensitivity test results in the decryption stage: (a) μ 0 + 10 15 , (b) k e y 0 + 10 15 , and (c) k e y 1 + 10 15 .
Figure 5. Key sensitivity test results in the decryption stage: (a) μ 0 + 10 15 , (b) k e y 0 + 10 15 , and (c) k e y 1 + 10 15 .
Entropy 26 00351 g005
Figure 6. Distribution of adjacent pixels of Lena, Pepper, and 5.1.09: (a) Plaintext images; (b) Distribution of adjacent pixels of (a); (c) ciphertext images; (d) Distribution of adjacent pixels of (c).
Figure 6. Distribution of adjacent pixels of Lena, Pepper, and 5.1.09: (a) Plaintext images; (b) Distribution of adjacent pixels of (a); (c) ciphertext images; (d) Distribution of adjacent pixels of (c).
Entropy 26 00351 g006
Figure 7. Ciphertext Plane images under different cutting levels and the corresponding decryptions: (a) 1/16; (b) 1/8; (c) 1/4; (d) 1/2.
Figure 7. Ciphertext Plane images under different cutting levels and the corresponding decryptions: (a) 1/16; (b) 1/8; (c) 1/4; (d) 1/2.
Entropy 26 00351 g007
Figure 8. Ciphertext Plane images under noise attacks and the corresponding decryptions: (a) SPN (0.05); (b) SPN (0.1); (c) GN (0.01); (d) GN (0.1).
Figure 8. Ciphertext Plane images under noise attacks and the corresponding decryptions: (a) SPN (0.05); (b) SPN (0.1); (c) GN (0.01); (d) GN (0.1).
Entropy 26 00351 g008
Table 1. An example of a crossover operation with c = 3 .
Table 1. An example of a crossover operation with c = 3 .
Pixel ValueDecimal RepresentationBinary Representation
p s 1 17810110 | 010
p s 2 4600101 | 110
n s 1 18210110 | 110
n s 2 4200101 | 010
Table 2. An example mutation operation with c = 6 .
Table 2. An example mutation operation with c = 6 .
Pixel ValueDecimal RepresentationBinary Representation
p m 17810 | 110010
g m 14110 | 001101
Table 3. The final results of the iteration numbers and K 2 required for optimization.
Table 3. The final results of the iteration numbers and K 2 required for optimization.
ImageIteration Number K 2
Lena1917 25 12  5 30 30 13 10 26 13 13 12  2  4   4  7   1   1  22
15 26 64 12 61 28 22 19 47 45 20 39 27 31 44 11 52 43 52
Cameraman1416 26 24 17 29 24 14 14  1 31 12 31 19 31
3  38 51 10 52 22 12 28 30 24 26 45 38 41
Plane136  16 13 20 18 22 11 32 28 17 18  2  1
44 15 22 32 19 5  36 11 24 15 36 15 15
Pepper1815 11 17 19 18 30 24 10 13 18 24 14 14 14 30 29 13 13
46 20 22 17 32 18 27  3  58 15 43 44 30 55 57 12 55  6
5.1.091517 18 3 22 19 14 20 20 7 23 29 29 4 23 17
48 28 49 59 6 52 40 45 4 5 46 60 58 46 46
6.1.011331 9 24 17 32 18 2  11  5   5  12  7 22
12 7 52 58 30 16 43 31 11 42 24 13 24
6.2.011122 4  32 24 27 30 26 18 32  8  12
15 37 22 27 50 24 28 62 27 32 42
Allwhite2013  8 26  6  31 18 23  3  7 28 11 11 11 29 28 20 31 19 31 12
8  33 50 34 45 39 35 19 56 63 47 29 61 25 46 63 37 57 24 55
Allblack2020 24 22 26 13 16 7 32 7  31 27  5 27 13 27 27 27 21 7 27
37 31 25 29 64 56 6 52 61 61 57 62 9 33 1  15 46 47 56 54
Table 4. Number and percentage changes during encryption and decryption.
Table 4. Number and percentage changes during encryption and decryption.
ImageEncryptionDecryption
Figure 4aFigure 4bFigure 4cFigure 5aFigure 5bFigure 5c
The number of different pixels65,29365,27965,28965,27765,26365,224
Percentage (%)99.629299.607899.623199.604899.583499.5239
Table 5. Complete results of several images pre- and post-encryption.
Table 5. Complete results of several images pre- and post-encryption.
ImageTesting DirectionAverage ValueVarianceEntropy
HVD
Lena0.94100.96540.92210.9428 4.14 × 10 4 7.42489
Ciphertext image Lena0.00100.0029-0.0020.0020101.1337.99888
Cameraman0.95530.97350.94060.9565 1.06 × 10 5 7.03056
Ciphertext image Cameraman0.0025−0.0005−0.00360.0022117.1887.99871
Plane0.94260.92490.88330.9169 1.75 × 10 5 6.72033
Ciphertext image Plane0.00050.00430.00130.0020117.827.9987
Pepper0.95470.95420.90410.9376 3.67 × 10 4 7.53524
Ciphertext image Pepper−0.00240.00690.00390.0044119.227.99869
5.1.090.90400.93600.90000.9134 1.36 × 10 5 6.70931
Ciphertext image 5.1.090.0006−0.0032−0.00340.0024124.8137.99863
6.1.010.98620.99170.97380.9839 1.22 × 10 5 7.20445
Ciphertext image 6.1.01−0.00140.00250.00060.0015112.3447.99876
6.2.010.94240.91050.88180.9116 6.33 × 10 4 7.16791
Ciphertext image 6.2.010.00130.0026−0.00270.0022133.187.99853
AllwhiteNaNNaNNaNNaN 1.67 × 10 7 0
Ciphertext image Allwhite0.00290.0025−0.00010.0018108.6567.99881
AllblackNaNNaNNaNNaN 1.67 × 10 7 0
Ciphertext image Allblack−0.00190.0018−0.00080.0015104.4697.99886
Table 6. Contrasting results for Lena.
Table 6. Contrasting results for Lena.
ImageTesting DirectionAverage ValueEntropyNPCR (%)UACI (%)
HVD
The proposed cryptosystem0.00100.0029−0.00200.00207.9988899.608133.581
Lena in [10]0.00190.00140.00520.00287.999299.61433.364
Lena in [12]0.00760.0093−0.0160.0117.999599.6533.64
Lena in [27]−0.000580.0048−0.02430.00997.996899.5833.08
Lena in [29]−0.00630.0022−0.00060.0037.998599.6133.48
Lena in [34]−0.0239−0.00330.00460.01067.996699.6433.48
Lena in [42]−0.0026−0.0012−0.00110.00167.997699.5933.43
Lena in [43]0.00560.00370.00320.00427.997699.6233.4169
Lena in [44]0.0305−0.00430.00420.0137.997699.6133.51
Lena in [45]0.0015−0.00260.00420.00287.997699.600233.4592
Table 7. NPCR and UACI results for several test images.
Table 7. NPCR and UACI results for several test images.
ImageNPCR (%)ResultsUACI (%)Results
maxminmean N 0 . 05 Resultsmaxminmean U 0 . 05 U 0 . 05 + Results
Lena99.664399.548399.608199.5693Pass33.689533.44833.58133.282433.6447Pass
Cameraman99.676599.551499.618499.5693Pass33.677833.402233.557133.282433.6447Pass
Pepper99.667499.549999.604399.5693Pass33.537933.318333.428533.282433.6447Pass
Plane99.652199.543899.600399.5693Pass33.598233.389133.495333.282433.6447Pass
5.1.0999.664399.537799.610999.5693Pass33.454333.235433.372633.282433.6447Pass
6.1.0199.67599.574399.618399.5693Pass33.730633.491833.622233.282433.6447Pass
6.2.0199.673599.563699.617599.5693Pass33.559233.3133.458633.282433.6447Pass
Allwhite99.758999.540799.643499.5693Pass33.776333.224933.459133.282433.6447Pass
Allblack99.668999.568299.628799.5693Pass33.492833.33433.419833.282433.6447Pass
Table 8. All PSNR values for robustness analyses of multiple images.
Table 8. All PSNR values for robustness analyses of multiple images.
ImagePSNR (dB)PSNR (dB)
Cut 1/16Cut 1/8Cut 1/4Cut 1/2SPN(0.05)SPN(0.1)GN(0.01)GN(0.1)
Lena21.308118.289415.278312.230919.208316.593913.018311.9036
Cameraman20.421317.396914.393411.429918.442115.514812.28811.1186
Plane19.941916.856413.952611.000718.172915.411411.943710.7354
Pepper20.882517.900314.876111.95518.981216.136812.966111.7686
5.1.0922.276119.200916.199513.21620.159817.220713.50312.4539
6.1.0120.110317.145514.104611.138218.264515.326811.73610.7258
6.2.0120.865717.820714.809311.80218.832515.839612.610711.4927
Allwhite16.734413.719710.7397.751614.982612.10558.15397.226
Allblack16.823713.788210.75697.795715.080812.2958.13067.2233
Table 9. Time efficiency results for several images.
Table 9. Time efficiency results for several images.
ImageEncryption Time(s)Decryption Time(s)
Lena7.20930.4303
Cameraman5.34260.4105
Plane5.10360.4116
Pepper6.80450.528
5.1.095.70750.4088
6.1.014.99680.4122
Average5.860.43
Encrypted Lena in [49]10.9
Encrypted Lena in [50]14.1
Encrypted Lena in [51]6.9
Encrypted Lena in [52]7.07
Encrypted Lena in [29]0.88
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

Shen, H.; Shan, X. An Efficient Image Cryptosystem Utilizing Difference Matrix and Genetic Algorithm. Entropy 2024, 26, 351. https://doi.org/10.3390/e26050351

AMA Style

Shen H, Shan X. An Efficient Image Cryptosystem Utilizing Difference Matrix and Genetic Algorithm. Entropy. 2024; 26(5):351. https://doi.org/10.3390/e26050351

Chicago/Turabian Style

Shen, Honglian, and Xiuling Shan. 2024. "An Efficient Image Cryptosystem Utilizing Difference Matrix and Genetic Algorithm" Entropy 26, no. 5: 351. https://doi.org/10.3390/e26050351

APA Style

Shen, H., & Shan, X. (2024). An Efficient Image Cryptosystem Utilizing Difference Matrix and Genetic Algorithm. Entropy, 26(5), 351. https://doi.org/10.3390/e26050351

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