A Novel Hyperchaotic Image Encryption System Based on Particle Swarm Optimization Algorithm and Cellular Automata

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 ﬁtness of PSO is the correlation coeﬃcient 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.


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. erefore, 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. e 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 [3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18]; hyperchaos is better for image encryption and security than chaos because of its high dynamic complexity. e 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]. is 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. e 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 . For example, Khan proposed an image encryption scheme based on multiple chaotic S-boxes [20]. e scheme does not require multiple round keys and can be applied to highspeed communication systems. Liu et al. utilized a new fourdimensional 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 [28][29][30][31][32][33]. 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 [34][35][36][37][38][39][40][41]. 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) [42][43][44][45][46]. 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. erefore, 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. e 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. e simulation experiments and security analysis reveal that the proposed system has a better encryption effect and superior security performance. e 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.

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 w are state variables and a, b, c, d, e, and f are real constant system parameters of the chaotic system (1). When a � 30, b � 0.03, c � − 1.2, d � 50, 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.

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. is 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". e 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. e general PSO is described as follows: e velocity and position of each particle are updated according to the following equations:

Security and Communication Networks
where p denotes the position of the particle and v 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. e process for implementing PSO is shown in the following algorithm (Algorithm 1). (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.

Cellular Automata
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. ese cells are arranged in a particular regular way, and each cell has a set of finite possible values. e state of each cell in a CA is related to the state of the adjacent cell. us, 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. erefore, three cells adjacent to each other have eight possible binary states. In this paper, we use a 2-state, 3neighborhood CA, where each cell can map the binary number of three bits to the binary number of one bit. e 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 S t i 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. us, 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. e 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: erefore, 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].

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. en, 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.
Set constant values to c1, c2, r1, and r2; Produce the initial particle swarm; Randomly initialize the position and velocity of each particle.
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. ALGORITHM 1 Step 2: utilize m 1 , m 2 , m 3 , and m 4 to calculate x 0 , y 0 , z 0 , and w 0 as the initial values of the chaotic system by the following equation: where t 1 , t 2 , t 3 , and t 4 are parts of secret keys, abs(x) is the absolute value of x, and fix(x) return the integer value of x.

Encryption
Process. e population is the set of all images produced by a round of encryption process in PSO, so a picture is an individual. e flow diagram of the encryption system is shown in Figure 2.
e 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 valuesx 0 , y 0 , z 0 , and w 0 of 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. en, according to equation (9), four sequences X 1 , Y 1 , Z 1 , and W 1 are obtained: Step 2: the initialization of PSO.
Step 2.1: set the population size popSize and learning factors c1 and c2. e chaotic sequence X 1 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: p � fix mod y × 10 5 , N * N .
where y is an element in the sequence Y 1, , v denotes the velocity of the individual, and p 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. erefore, 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 r1 and r2 use elements from chaotic sequences Y 1 and W 1 , respectively.
Step 3.3: transform the rows and columns of a twodimensional 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 onedimensional 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.

Decryption Process.
e 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 (t 1 , t 2 , t 3 , and t 4 ), 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. e detailed decryption process is as follows: Step 1: the initial value (x 0 , y 0 , z 0 , and w 0 )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. en, 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): 6 Security and Communication Networks 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.

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.

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. e results of gray histogram analysis show that the proposed encryption system can resist statistical attacks.

Correlation of Adjacent Pixels.
e correlation coefficient between image pixels can represent the statistical relationship between neighborhood pixels. An ideal encryption system should be able to break high correlation.

Security and Communication Networks
Plain image P (N × N) and sequence X 1 Randomly get the position of the data in Y 1 Select 4 data to generate the initial value of the hyperchaotic system xx 0 , yy 0 , zz 0 and ww 0 Sequence Q is obtained by using the chaotic sequence generated by hyperchaotic system 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). e 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. erefore, the proposed encryption system has a good performance in resisting statistical analysis attacks.

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. e 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. e 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 C ′ is the encrypted image corresponding to the plain image after a slight change. e definition of D is shown as follows: e 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. erefore, our proposed system is more effective in resisting differential attacks.

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.

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

Encryption and Decryption
Efficiencies. Encryption and decryption efficiency refers to the running speed of the system. e 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. e 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 realtime 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. erefore, the speed and performance of the encryption system are guaranteed. When the plain image is encrypted, cipher image can be obtained quickly.

Key Space Analysis.
e key of the encryption system proposed in this paper includes the given initial key and the hash value of the plain image. e initial values are doubleprecision stored inside the computer. erefore, the key space is (10 16 ) 8 × 2 128 ≈ 2 512 > 2 100 . For a secure encryption system, the key space should be greater than 2 100 . Obviously, it is not feasible for malicious attackers to exploit exhaustive attacks to break the encryption system.  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   erefore, we can conclude that our encryption system has better comprehensive performance than the other three encryption methods.

Conclusion
In this paper, a new hyperchaotic image encryption system based on PSO and CA is proposed. is 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 highquality 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. e 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
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.