Abstract

In this paper, we propose a hyperchaotic image encryption system based on particle swarm optimization algorithm (PSO) and cellular automata (CA). Firstly, to improve the ability to resist plaintext attacks, the initial conditions of the hyperchaotic system are generated by the hash function value which is closely related to the plaintext image to be encrypted. In addition, the fitness of PSO is the correlation coefficient between adjacent pixels of the image. Moreover, On the basis of hyperchaotic system, cellular automata technology is adopted, which can enhance the randomness of population distribution and increase the complexity and diversity of the population so that the security of the encryption system can be improved and avoid falling into local optimum. The simulation results and security analysis of the proposed encryption system demonstrate that the hyperchaotic image encryption system has high resistance against plaintext attack and statistical attack.

1. Introduction

In an era of rapid network science and the multimedia industry progress, using network for information transmission has become the primary choice for most people. As an important carrier of information, digital images are transmitted or stored through public channels. Therefore, the importance of information security is valued. It has been found that the traditional data encryption algorithm is not efficient and has many technical defects due to large data volume in digital images, high redundancy, and strong correlation between adjacent pixels. The existing research results show that the image encryption based on chaos theory have better characteristics than the traditional encryption algorithm [1, 2].

Many papers have been published on chaos generation to data [318]; hyperchaos is better for image encryption and security than chaos because of its high dynamic complexity. The concept of hyperchaos was first proposed by Rossler in 1979 to describe the characteristics of chaotic systems with two or more positive Lyapunov exponents [19]. This means that when compared with a chaotic system with only one positive Lyapunov exponent, the hyperchaotic system has the dynamics which can be extended in multiple directions simultaneously, resulting in more complex chaotic attractors and dynamical behaviors. The progression of hyperchaotic systems within unique cryptographic characteristics such as large key space and high sensitivity to initial values highlights its role in image encryption.

To improve the effectiveness of digital image encryption, researchers have proposed many new image encryption systems based on hyperchaotic systems [2058]. For example, Khan proposed an image encryption scheme based on multiple chaotic S-boxes [20]. The scheme does not require multiple round keys and can be applied to high-speed communication systems. Liu et al. utilized a new four-dimensional hyperchaotic system to generate a key stream and displace and replace the plain image pixels in order to obtain a better pixel diffusion effect and higher encryption security [21]. However, those researchers found that the image encryption scheme based on S-box structure has the disadvantages of small key space and simple encryption structure. Image encryption schemes based on bit-plane and bit-level were proposed to compensate these shortcomings [2833]. Zhang et al. utilized chaotic systems to design a random visiting mechanism to the bit level of the plain image [29]. However, Wu discovered that the image encryption scheme based on three-dimensional bit matrix permutation was not suitable for secure communication. For this reason, an improved encryption scheme was proposed which ensured that the parameter values in chaotic systems depend not only on the key but also on the plain image [33].To solve the problems of single DNA coding rules and low sensitivity of chaotic encryption algorithm to key, the image encryption schemes based on DNA computing were introduced [3441]. Hu et al. [36] proposed an image encryption scheme using a high-dimensional hyperchaotic system to generate the key stream and control the DNA coding rules, so as to achieve the effect of random coding. In [38], a new hyperchaotic image encryption system based on dynamic DNA encryption was proposed. In this encryption system, a pixel random diffusion mechanism based on plaintext is designed under DNA coding rules and binary operation rules. Wan et al. applied the diffusion algorithm to the plain image, then segmented the middle cipher image, and finally formed the final encrypted image by DNA operations [41]. Moreover, some researchers have invented hyperchaotic image encryption system based on cellular automata (CA) [4246]. Chai et al. proposed an image encryption scheme based on memory hyperchaotic system, cellular automata, and DNA sequence computing [44]. Niyat et al. proposed a hyperchaotic image encryption scheme based on the heterogeneous cellular automata framework which consists of confusion and diffusion steps [45]. Nevertheless, Li et al. found that the scheme could not effectively resist the chosen-plaintext attack [46]. In [58], Ahmad et al. designed an image encryption system based on particle swarm optimization algorithm and low-dimensional mapping. However, the system has not enough large key space and has small data range. Therefore, strong pseudorandomness and ergodicity are not fully possessed by these generated data, thus resulting in low security. Besides, the problem of premature convergence and diversity of the population decreases in the PSO often lead to local optimum traps.

The purpose of this paper was to address the problems above by developing a new hyperchaotic image encryption system based on particle swarm optimization algorithm (PSO) and cellular automata (CA). To improve the ability to resist plaintext attacks, the initial conditions of the hyperchaotic system are generated by the hash function value which is closely related to the plaintext image to be encrypted. In addition, the fitness function of PSO is used to calculate the correlation between adjacent pixels of the image. By introducing CA technology, the complexity and diversity of the population in PSO are increased in order to avoid the loss of diversity of the population in the search space and enhance the security of the encryption system. The simulation experiments and security analysis reveal that the proposed system has a better encryption effect and superior security performance.

The paper is organized as follows. Section 2 introduces the relevant knowledge. In Section 3, a novel cryptosystem is proposed and its characteristics are analyzed. Simulation results and security analysis are provided in Section 4. Finally, Section 5 presents the conclusions drawn from this work.

2. Preliminary Knowledge

2.1. Hyperchaotic System

In this paper, a novel hyperchaotic image encryption system based on PSO and CA is proposed and a hyperchaotic system is adopted [59]:where x, y, z, and are state variables and a, b, c, d, e, and f are real constant system parameters of the chaotic system (1). When , , , , e = 0.32, and f = 0.1111, the system is hyperchaotic. To analyze its hyperchaotic behavior, the initial condition is set as (0, 0.1, 0.3, 0.4), and the time step of iteration is 0.001. Figure 1 shows the phase diagram of the system.

2.2. Particle Swarm Optimization Algorithm (PSO)

PSO was proposed by Eberhart and Kennedy in 1995, inspired by the foraging of birds and fish [60]. PSO is a speculative calculation method based on swarm intelligence. This similarity can be explained by the assumption that a group of birds is foraging randomly in a large field, and no bird will know the position of the food in the field, but they only know the distance from the food. One of the most effective ways to find food is to hang out with the birds closest to the food site. PSO has the optimal understanding ability of social behavior, so it can be used to solve various optimization problems.

PSO has been widely recognized in signal processing, machine learning, adaptive control, fuzzy system control, neural network, function optimization, model classification, and other fields because of its simple implementation and intuitive process. Another advantage of PSO is that it involves only simple calculations and optimizes the problem by repeatedly trying to update the solution space associated with a particular fitness function.

In PSO, each bird represents a separate solution, which is called a “particle”. The algorithm starts with the initial state of any particle and uses two optimal values for each particle’s update: the first variable is the best value which the particle has achieved so far, called as pbest; the second is the gbest, refers to the best value in the all particles pbest values. All particles have three characteristics: fitness value, position, and velocity, which guide particles to find the best state of individuals and populations in the search space. The general PSO is described as follows:

The velocity and position of each particle are updated according to the following equations:where p denotes the position of the particle and denotes the velocity of particles, c1 and c2 are the constant learning factor, r1 and r2 are constant values between [0, 1], pbest is the best position value for each particle, and gbest is the best value for the particle swarm.

The process for implementing PSO is shown in the following algorithm (Algorithm 1).

Step 1: initialization process.
 Set constant values to c1, c2, r1, and r2;
 Produce the initial particle swarm;
 Randomly initialize the position and velocity of each particle.
Step 2: optimization process.
 Calculate the fitness value of each particle;
 Find the pbest;
 Find the gbest;
 If (Meet the termination condition)
  Go to Step 3
 else
  Update the velocity of each particle by equation (2);
  Update the position of each particle by equation (3);
  Go to Step 2
Step3: terminate algorithm.
2.3. Cellular Automata (CA)

Cellular automata are not only a simple biological computing model but also a decentralized spatially extended system, which includes a large number of cells with local connectivity. CA has the potential to perform complex computation and can simulate the behavior of complex systems in nature. CA is characterized by simple rules and high efficiency. Due to its complex behavior and reliable evolutionary rules, a secure encryption system can be designed based on CA.

CA is a discrete mathematical model. In other words, CA can obtain discrete outputs through discrete inputs, and its basic cell is a simple structure that evolves in discrete time and space. CA can represent the sequential behavior of several cells connected to each other. These cells are arranged in a particular regular way, and each cell has a set of finite possible values. The state of each cell in a CA is related to the state of the adjacent cell. Thus, each cell of CA can evolve over time depending on the type of rule used.

In the one-dimensional CA, each cell has two neighborhoods, and each neighborhood has two values, namely, 0 and 1. Therefore, three cells adjacent to each other have eight possible binary states. In this paper, we use a 2-state, 3-neighborhood CA, where each cell can map the binary number of three bits to the binary number of one bit. The transition function for a 2-state, 3-neighborhood CA cell can be described by the following equation:where f is a Boolean function associated with each CA rule, i is the position of a cell, t is the t th time step, and is the output state. If the i-th cell is to be updated, it must depend on the current state of itself and its left and right cells. Thus, the total number of rules available for CA is 256.

In addition, Wolfram encodes the set of local rules for the temporal evolution of one-dimensional CA [61]. Table 1 gives an example of Wolfram’s numbering scheme for the Rule 30 of CA. The rule numbers represent the decimal value of the rule output. For example, if the mapping rule satisfies the equation (5), the binary number 00011110 is the binary form of 30:

Therefore, the CA is called Rule 30 CA. In Boolean form, Rule 30 can be written as follows:

In the image encryption system in this paper, there are 8 rules of CA used, as shown in Table 2.

If all CA cells follow the same rules, the CA is called a unified CA; otherwise, the CA is not uniform. Moreover, if many cells are adjacent to each other, CA is considered to have periodic boundary conditions. Otherwise, the CA is referred to as a borderless CA [62].

3. The Proposed Cryptosystem

3.1. Generation of Initial Values of the Hyperchaotic System

In this paper, in order to enhance the correlation between the encryption system and the plain image and improve the encryption system’s resistance to plaintext attack, the SHA-256 hash function of the original image is used to calculate the initial values of the hyperchaotic system. In cases where only 1 bit is different, the hash values of the two images are significantly different, which helps to increase the sensitivity of the encryption system to the secret key. Firstly, before encrypting the plain image, calculate the 256 bit hash value of the plain image and set it to the secret key K. Then, K is divided into 32 8 bit blocks, and each block is converted to a decimal digit. Next, the initial values of the chaotic system are calculated by the following steps.Step 1: convert K into 32 decimal numbers , and then obtain by equation (7):Step 2: utilize to calculate as the initial values of the chaotic system by the following equation:where are parts of secret keys, is the absolute value of x, and return the integer value of x.

3.2. Encryption Process

The population is the set of all images produced by a round of encryption process in PSO, so a picture is an individual. The flow diagram of the encryption system is shown in Figure 2.

The detailed steps of the encryption process are as follows:Step 1: let P be the plain image which size is N × N. Utilize the initial valuesof the hyperchaotic system to iterate the hyperchaotic system for T + L times, where L = N × N. To avoid the effect of transient, we discard the previous T values. Finally, we get four chaotic sequences X, Y, Z, and W, each of which consists of L elements. Then, according to equation (9), four sequences are obtained:Step 2: the initialization of PSO.Step 2.1: set the population size popSize and learning factors c1 and c2. The chaotic sequence is used to initialize each individual in the population, and the process of generating individuals is shown in Figure 3.Step 2.2: initialize the velocity and position of each individual according to the following equations:where y is an element in the sequence , denotes the velocity of the individual, and denotes the position of the individual.Step 2.3: set pbest and gbest. In this paper, the correlation coefficient between adjacent pixels of the image is taken as the fitness function of the optimization process. Therefore, the smaller the fitness function value, the more individuals will be retained into the next generation.Step 3: perform the optimization process.Step 3.1: set s = 1, where s is the number of rounds in the optimization process.Step 3.2: update the velocity and position of each generated individual according to equations (2) and (3), where and use elements from chaotic sequences and , respectively.Step 3.3: transform the rows and columns of a two-dimensional image into one-dimensional data, and the pixel value of the image is diffused by using rule 150 in cellular automata technology, as shown in the following equation.where the first pixel and the last pixel are updated according to the following equation:Step 3.4: reconstruct the rows and columns of the one-dimensional data to restore the two-dimensional image and then calculate the fitness of each individual and update the pbest and gbest.Step 3.5: set s = s+1, then loop executes Step 3.2 to Step 3.5 S times, and the cipher image C is obtained.

3.3. Decryption Process

The reverse of the encryption process is the decryption process. Before decrypting, the sender sends the secret keys safely to the receiver. Secret keys include the 256-bit hash value K, the parameters (), discarding T numbers of chaotic sequences, the total number S of particle swarm optimization algorithm rounds, and the velocity V and position P of the best individual. After the recipient obtains the secret keys, the decryption of cipher image only requires the inverse process of diffusion. The detailed decryption process is as follows:Step 1: the initial value of chaotic system is obtained, according to Section 3.2.Step 2: iterate the hyperchaotic system for T + L times, where L = N × N. To avoid the transient effect, we discard the previous T values. Then, four new hyperchaotic sequences are obtained by equation (9).Step 3: set pbest and gbest, which is generally a larger value.Step 4: set s = 1, and s represents the number of rounds in the current optimization process.Step 4.1: carry out the reverse diffusion process of cellular automata according to equations (12) and (13).Step 4.2: update the velocity and position of each generated individual according to equations (14) and (15):Step 4.3: set s = s+1, and then loop executes Step 4.1 to Step 4.3 S times. Finally, the plain image P is recovered.

4. Simulation Results and Security Analysis

4.1. Simulation Results

To demonstrate the effectiveness of the proposed system given above, the simulation process is carried out on the MATLAB software platform. For color images, the system can encrypt the image data of R, G and B channels, respectively. After encryption, they are recombined to obtain color cipher images. In addition, the encryption system can effectively encrypt images of various sizes. In other words, the encryption system has no limit on the size of the image. Take the plain image of Lena for encryption and decryption, as shown in Figure 4.

4.2. Statistical Analysis
4.2.1. Histogram

Histograms can be used to count the number of values with a specific gray value. If a high security image encryption system is used, cipher images with uniform histograms can be obtained.

As shown in Figure 5, compared with the histogram of plain image, cipher image has the characteristic of uniform distribution of pixel values. The results of gray histogram analysis show that the proposed encryption system can resist statistical attacks.

4.2.2. Correlation of Adjacent Pixels

The correlation coefficient between image pixels can represent the statistical relationship between neighborhood pixels. An ideal encryption system should be able to break high correlation.

between adjacent pixels of the plain image.

From the tested images, a number of pixels were randomly selected to calculate the correlation coefficients in three different directions (horizontal, vertical, and diagonal). The correlation coefficients are calculated by the following formulae:where x and y are two neighborhood pixel values in the image, respectively.

Figure 6 shows the correlation distribution in the three directions. As shown in Table 3, by comparing the correlation coefficients in the three directions, it can be concluded that the correlation between adjacent pixels of cipher image is much lower than that of plain image. Therefore, the proposed encryption system has a good performance in resisting statistical analysis attacks.

4.3. Sensitivity Analysis
4.3.1. Differential Attack

Image encryption schemes generally require that the encrypted image should be vastly different from the original plain image. The proposed encryption system ensures that two cipher images are completely different, even if only one bit of data is different between the plain images. Differential attack means to break the encryption algorithm by comparing and analyzing the corresponding cipher images of two plain images with slight differences. Number of Pixels Change Rate (NPCR) and Unified Average Changing Intensity (UACI) are two standards used to test the ability of encryption algorithm to resist differential attack. The calculation formula is shown in the following equations:where M and N represent the number of rows and columns of the image, C is the encrypted image of the plain image, and is the encrypted image corresponding to the plain image after a slight change. The definition of D is shown as follows:

The results in Table 4 show that, after the plain image is processed by the encryption system, the NPCR and UACI values of the proposed encryption system are 99.6352% and 33.5614%, respectively, which are close to the ideal values. Therefore, our proposed system is more effective in resisting differential attacks.

4.3.2. Key Sensitivity

For key sensitivity, if the key is slightly modified, a secure encryption system should get a completely different cipher image in the encryption process. A noisy image without any information about plain image should be obtained in the decryption process.

Take image Lena as an example, in the encryption process, we encrypt with the original key and then encrypt with the modified key. As shown in Figure 7, a cipher image is obtained with the original key; however, we encrypt the plain image again by using the modified key to obtain a completely different cipher image. It is obvious that a slight modification of the key can make a huge difference in the cipher image. In the decryption process, the cipher image of Lena is decrypted by the original key and the modified key, respectively. As shown in Figure 8, the original key is successfully restored the original plain image, but the slightly modified key could not correctly restore the plain image.

4.4. Information Entropy

In information theory, information entropy is used to evaluate the amount of information. The calculation method of entropy is described as the following formula:where N is the number of bits for and is the probability of . Table 5 lists the values of the tested image information entropy, and the calculated results are close to the ideal theoretical value of 8. Therefore, the proposed encryption system can achieve a better randomness effect on cipher images by encrypting plain images.

4.5. Encryption and Decryption Efficiencies

Encryption and decryption efficiency refers to the running speed of the system. The hardware environment used in this paper is the computer Windows 10 64 bit operating system, the Intel Core I5-8300h processor @2.30ghz and 8 GB of memory. The software environment is Matlab (R2017a). In the same hardware and software environment, the running speed of encryption system plays a crucial role in satisfying the real-time performance of network transmission. In this paper, the PSO is simple in coding and genetic operation and has the advantages of fewer parameters, easier implementation, and faster optimization speed. Therefore, the speed and performance of the encryption system are guaranteed. When the plain image is encrypted, cipher image can be obtained quickly.

4.6. Key Space Analysis

The key of the encryption system proposed in this paper includes the given initial key and the hash value of the plain image. The initial values are double-precision stored inside the computer.

Therefore, the key space is . For a secure encryption system, the key space should be greater than Obviously, it is not feasible for malicious attackers to exploit exhaustive attacks to break the encryption system.

4.7. Encryption Performance Comparison

Taking image Lena as an example, Table 6 lists the performance comparison between the encryption system proposed in this paper and other encryption systems. We have compared the correlation coefficients, the NPCR and UACI values, and information entropy of the proposed encryption system and other systems. Therefore, we can conclude that our encryption system has better comprehensive performance than the other three encryption methods.

5. Conclusion

In this paper, a new hyperchaotic image encryption system based on PSO and CA is proposed. This system increases the complexity and diversity of the population in the process of evolution, increases the key space of the encryption system, reduces the possibility of the loss of high-quality population, and enhances the security of the encryption system. In security analysis, we compared the security of our system with other encryption systems’ security performance in the relevant literature and verified the security of the image encryption system through histogram analysis, difference analysis, correlation analysis, statistical analysis, key performance analysis, etc. The performance analysis demonstrate that the proposed system has better encryption effect and higher resistance against plaintext attack and statistical attack in comparison to other hyperchaotic image encryption systems.

Data Availability

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

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Acknowledgments

This work was supported by the National Natural Science Foundation of China (No. 61971185) and Natural Science Foundation of Hunan Province (2020JJ4218).