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

Authors: Jie Zeng; Chunhua Wang
Journal: Security and Communication Networks
 (2021)

---

## 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.


---

## Body

## 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 [3–18]; 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 [20–58]. 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 [28–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–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–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. 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. Section2 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]:(1)x˙=ay−bx3−1+cx,y˙=x−y+z,z˙=w−dy−ez,w˙=yz−fx,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.Figure 1
The phase diagram of the proposed hyperchaotic system: (a)x-y phase diagram; (b) x-z phase diagram; (c) y-z phase diagram; (d) y-w phase diagram; (e) x-y-z phase diagram; (f) x-y-w phase diagram; (g) x-z-w phase diagram; (h) y-z-w phase diagram.
(a)(b)(c)(d)(e)(f)(g)(h)


### 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:(2)vk+1=vk+c1×r1×pbestk−pk+c2×r2×gbest−pk,(3)pk+1=vk+1+pk,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.The process for implementing PSO is shown in the following algorithm (Algorithm1).Algorithm 1:
Step 1: initialization process.Set constant values toc1, 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 3elseUpdate the velocity of each particle by equation (2);Update the position of each particle by equation (3);Go to Step 2Step3: 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:(4)Sit+1=fSi−1t,Sit,Si+1t,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 Sitis 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:(5)f111=0,f110=0,f101=0,f100=1,f011=1,f010=1,f001=1,f000=0.Table 1
Representation of Boolean symmetry Rule 30 with radius 1.
Number76543210Si−1tSitSi+1t111110101100011010001000Sit+100011110Therefore, the CA is called Rule 30 CA. In Boolean form, Rule 30 can be written as follows:(6)Sit+1=Si−1txorSitorSi+1t.In the image encryption system in this paper, there are 8 rules of CA used, as shown in Table2.Table 2
Boolean expression for each CA rule.
RiRule numbersBoolean equation130Sit+1=Si−1txorSitorSi+1t290Sit+1=Si−1txorSi+1t3150Sit+1=Si−1txorSitxorSi+1t4153Sit+1=SitxnorSi+1t5165Sit+1=Si−1txnorSi+1t686Sit+1=Si−1tnorSitxornotSit7105Sit+1=notSi−1txorSitxorSi+1t8101Sit+1=Si−1tnorSi+1torSitxorSi+1tandSi−1tIf 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].


## 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]:(1)x˙=ay−bx3−1+cx,y˙=x−y+z,z˙=w−dy−ez,w˙=yz−fx,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.Figure 1
The phase diagram of the proposed hyperchaotic system: (a)x-y phase diagram; (b) x-z phase diagram; (c) y-z phase diagram; (d) y-w phase diagram; (e) x-y-z phase diagram; (f) x-y-w phase diagram; (g) x-z-w phase diagram; (h) y-z-w phase diagram.
(a)(b)(c)(d)(e)(f)(g)(h)


## 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:(2)vk+1=vk+c1×r1×pbestk−pk+c2×r2×gbest−pk,(3)pk+1=vk+1+pk,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.The process for implementing PSO is shown in the following algorithm (Algorithm1).Algorithm 1:
Step 1: initialization process.Set constant values toc1, 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 3elseUpdate the velocity of each particle by equation (2);Update the position of each particle by equation (3);Go to Step 2Step3: 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:(4)Sit+1=fSi−1t,Sit,Si+1t,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 Sitis 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:(5)f111=0,f110=0,f101=0,f100=1,f011=1,f010=1,f001=1,f000=0.Table 1
Representation of Boolean symmetry Rule 30 with radius 1.
Number76543210Si−1tSitSi+1t111110101100011010001000Sit+100011110Therefore, the CA is called Rule 30 CA. In Boolean form, Rule 30 can be written as follows:(6)Sit+1=Si−1txorSitorSi+1t.In the image encryption system in this paper, there are 8 rules of CA used, as shown in Table2.Table 2
Boolean expression for each CA rule.
RiRule numbersBoolean equation130Sit+1=Si−1txorSitorSi+1t290Sit+1=Si−1txorSi+1t3150Sit+1=Si−1txorSitxorSi+1t4153Sit+1=SitxnorSi+1t5165Sit+1=Si−1txnorSi+1t686Sit+1=Si−1tnorSitxornotSit7105Sit+1=notSi−1txorSitxorSi+1t8101Sit+1=Si−1tnorSi+1torSitxorSi+1tandSi−1tIf 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 numbersk1,k2,…,k32, and then obtainm1,m2,m3,andm4 by equation (7):(7)m1=k1+k2+k3+⋯⋯+k8256,m2=k9+k10+k11+⋯⋯+k16256,m3=k17+k18+k19+⋯⋯+k24256,m4=k25+k26+k27+⋯⋯+k32256.Step 2: utilizem1,m2,m3,andm4 to calculate x0,y0,z0,andw0 as the initial values of the chaotic system by the following equation:(8)x0=t1+absm1−fixm1,x0=t1+absm1−fixm1,z0=t3+absm3−fixm3,w0=t4+absm4−fixm4,where t1,t2,t3,andt4 are parts of secret keys, absx is the absolute value of x, and fixx 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 Figure2.Figure 2
The flow diagram of the encryption system.Figure 3
The flow diagram of generating individual.The detailed steps of the encryption process are as follows:Step 1: letP be the plain image which size is N × N. Utilize the initial valuesx0,y0,z0,andw0of 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 X1,Y1,Z1,andW1are obtained:(9)X1i=modXi×108,1,Y1i=modabsYi−Zi×108,1,Z1i=modabsXi+Yi+Zi×108,1,W1i=modabsWi×108,3.Step 2: the initialization of PSO.Step 2.1: set the population size popSize and learning factors c1 and c2. The chaotic sequenceX1 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:(10)v=flooryN+1,(11)p=fixmody×105,N∗N.wherey is an element in the sequence Y1,, 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. 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: sets = 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 Y1and W1, 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.(12)ei=ei−1⊕ei⊕ei+1.where the first pixel and the last pixel are updated according to the following equation:(13)e1=eM∗N⊕e1⊕e2,eN∗N=eN∗N−1⊕eN∗N⊕e1.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: sets = 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 valueK, the parameters (t1,t2,t3,andt4), 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 valuex0,y0,z0,andw0of chaotic system is obtained, according to Section 3.2.Step 2: iterate the hyperchaotic system forT + 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: sets = 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):(14)vk=vk+1−c1×r1×pbestk−pk−c2×r2×gbest−pk,(15)pk=pk+1−vk+1.Step 4.3: sets = s+1, and then loop executes Step 4.1 to Step 4.3 S times. Finally, the plain image P is recovered.


## 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 numbersk1,k2,…,k32, and then obtainm1,m2,m3,andm4 by equation (7):(7)m1=k1+k2+k3+⋯⋯+k8256,m2=k9+k10+k11+⋯⋯+k16256,m3=k17+k18+k19+⋯⋯+k24256,m4=k25+k26+k27+⋯⋯+k32256.Step 2: utilizem1,m2,m3,andm4 to calculate x0,y0,z0,andw0 as the initial values of the chaotic system by the following equation:(8)x0=t1+absm1−fixm1,x0=t1+absm1−fixm1,z0=t3+absm3−fixm3,w0=t4+absm4−fixm4,where t1,t2,t3,andt4 are parts of secret keys, absx is the absolute value of x, and fixx 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 Figure2.Figure 2
The flow diagram of the encryption system.Figure 3
The flow diagram of generating individual.The detailed steps of the encryption process are as follows:Step 1: letP be the plain image which size is N × N. Utilize the initial valuesx0,y0,z0,andw0of 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 X1,Y1,Z1,andW1are obtained:(9)X1i=modXi×108,1,Y1i=modabsYi−Zi×108,1,Z1i=modabsXi+Yi+Zi×108,1,W1i=modabsWi×108,3.Step 2: the initialization of PSO.Step 2.1: set the population size popSize and learning factors c1 and c2. The chaotic sequenceX1 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:(10)v=flooryN+1,(11)p=fixmody×105,N∗N.wherey is an element in the sequence Y1,, 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. 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: sets = 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 Y1and W1, 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.(12)ei=ei−1⊕ei⊕ei+1.where the first pixel and the last pixel are updated according to the following equation:(13)e1=eM∗N⊕e1⊕e2,eN∗N=eN∗N−1⊕eN∗N⊕e1.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: sets = 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 valueK, the parameters (t1,t2,t3,andt4), 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 valuex0,y0,z0,andw0of chaotic system is obtained, according to Section 3.2.Step 2: iterate the hyperchaotic system forT + 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: sets = 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):(14)vk=vk+1−c1×r1×pbestk−pk−c2×r2×gbest−pk,(15)pk=pk+1−vk+1.Step 4.3: sets = 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 ofR, 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.Figure 4
The simulation results: (a) the plain image; (b) the cipher image; (c) the recovered image.
(a)(b)(c)


### 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 Figure5, 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.Figure 5
Histogram analysis: the histogram of (a) plain image of Lena and (b) cipher images of Lena.
(a)(b)


#### 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:(16)rxy=covx,yDxDy,(17)Ex=1N∑i=1Nxi,(18)Dx=1N∑i=1Nxi−Ex2,(19)covx,y=1N∑i=1Nxi−Exyi−Ey,where x and y are two neighborhood pixel values in the image, respectively.Figure6 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.Figure 6
Correlation analysis: (a) horizontal of plain image; (b) vertical of plain image; (c) diagonal of plain image; (d) horizontal of cipher image; (e) vertical of cipher image; (f) diagonal of cipher image.
(a)(b)(c)(d)(e)(f)Table 3
Correlation coefficients of plain image and cipher image.
ImageDirectionHorizontalVerticalDiagonalPlain image (Lena)0.95670.96110.9169Cipher image (Lena)0.0053−0.00890.0126


### 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:(20)NPCR=∑i=1M∑j=1NDi,jM×N×100%,(21)UACI=∑i=1M∑j=1NC′i,j−Ci,j/255M×N×100%,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. The definition of D is shown as follows:(22)Di,j=1,ifCi,j≠C′i,j,0,ifCi,j=C′i,j.The results in Table4 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.Table 4
NPCR and UACI of image Lena.
ImageNPCR (%)UACI (%)Lena99.635233.5614


#### 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 Figure7, 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.Figure 7
Sensitivity test of encryption key: (a) encrypted image with the original secret key; (b) encrypted image with the modified secret key.
(a)(b)Figure 8
Sensitivity test of decryption key: (a) decrypted image with the correct secret key; (b) encrypted image with the modified secret key.
(a)(b)


### 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:(23)H=−∑i=02N−1pmilog2pmi,where N is the number of bits for mi and pmi is the probability of mi. 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.Table 5
Information entropy.
ImagePlain imageCipher imageLena7.58277.9987


### 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 is10168×2128≈2512>2100. For a secure encryption system, the key space should be greater than 2100. 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, Table6 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.Table 6
Encryption performance comparison.
Encryption schemeDirectionNPCR (%)UACI (%)Information entropyHorizontalVerticalDiagonalOurs0.0053−0.00890.012699.635233.56147.9987Ref. [31]−0.0574−0.00350.057899.583933.37567.9989Ref. [44]−0.0016−0.00330.013099.612533.53757.9971Ref. [48]0.00150.00430.002399.688137.56007.9877


## 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 ofR, 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.Figure 4
The simulation results: (a) the plain image; (b) the cipher image; (c) the recovered image.
(a)(b)(c)


## 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 Figure5, 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.Figure 5
Histogram analysis: the histogram of (a) plain image of Lena and (b) cipher images of Lena.
(a)(b)


### 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:(16)rxy=covx,yDxDy,(17)Ex=1N∑i=1Nxi,(18)Dx=1N∑i=1Nxi−Ex2,(19)covx,y=1N∑i=1Nxi−Exyi−Ey,where x and y are two neighborhood pixel values in the image, respectively.Figure6 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.Figure 6
Correlation analysis: (a) horizontal of plain image; (b) vertical of plain image; (c) diagonal of plain image; (d) horizontal of cipher image; (e) vertical of cipher image; (f) diagonal of cipher image.
(a)(b)(c)(d)(e)(f)Table 3
Correlation coefficients of plain image and cipher image.
ImageDirectionHorizontalVerticalDiagonalPlain image (Lena)0.95670.96110.9169Cipher image (Lena)0.0053−0.00890.0126


## 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 Figure5, 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.Figure 5
Histogram analysis: the histogram of (a) plain image of Lena and (b) cipher images of Lena.
(a)(b)


## 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:(16)rxy=covx,yDxDy,(17)Ex=1N∑i=1Nxi,(18)Dx=1N∑i=1Nxi−Ex2,(19)covx,y=1N∑i=1Nxi−Exyi−Ey,where x and y are two neighborhood pixel values in the image, respectively.Figure6 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.Figure 6
Correlation analysis: (a) horizontal of plain image; (b) vertical of plain image; (c) diagonal of plain image; (d) horizontal of cipher image; (e) vertical of cipher image; (f) diagonal of cipher image.
(a)(b)(c)(d)(e)(f)Table 3
Correlation coefficients of plain image and cipher image.
ImageDirectionHorizontalVerticalDiagonalPlain image (Lena)0.95670.96110.9169Cipher image (Lena)0.0053−0.00890.0126


## 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:(20)NPCR=∑i=1M∑j=1NDi,jM×N×100%,(21)UACI=∑i=1M∑j=1NC′i,j−Ci,j/255M×N×100%,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. The definition of D is shown as follows:(22)Di,j=1,ifCi,j≠C′i,j,0,ifCi,j=C′i,j.The results in Table4 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.Table 4
NPCR and UACI of image Lena.
ImageNPCR (%)UACI (%)Lena99.635233.5614


### 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 Figure7, 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.Figure 7
Sensitivity test of encryption key: (a) encrypted image with the original secret key; (b) encrypted image with the modified secret key.
(a)(b)Figure 8
Sensitivity test of decryption key: (a) decrypted image with the correct secret key; (b) encrypted image with the modified secret key.
(a)(b)


## 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:(20)NPCR=∑i=1M∑j=1NDi,jM×N×100%,(21)UACI=∑i=1M∑j=1NC′i,j−Ci,j/255M×N×100%,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. The definition of D is shown as follows:(22)Di,j=1,ifCi,j≠C′i,j,0,ifCi,j=C′i,j.The results in Table4 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.Table 4
NPCR and UACI of image Lena.
ImageNPCR (%)UACI (%)Lena99.635233.5614


## 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 Figure7, 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.Figure 7
Sensitivity test of encryption key: (a) encrypted image with the original secret key; (b) encrypted image with the modified secret key.
(a)(b)Figure 8
Sensitivity test of decryption key: (a) decrypted image with the correct secret key; (b) encrypted image with the modified secret key.
(a)(b)


## 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:(23)H=−∑i=02N−1pmilog2pmi,where N is the number of bits for mi and pmi is the probability of mi. 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.Table 5
Information entropy.
ImagePlain imageCipher imageLena7.58277.9987


## 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 is10168×2128≈2512>2100. For a secure encryption system, the key space should be greater than 2100. 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, Table6 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.Table 6
Encryption performance comparison.
Encryption schemeDirectionNPCR (%)UACI (%)Information entropyHorizontalVerticalDiagonalOurs0.0053−0.00890.012699.635233.56147.9987Ref. [31]−0.0574−0.00350.057899.583933.37567.9989Ref. [44]−0.0016−0.00330.013099.612533.53757.9971Ref. [48]0.00150.00430.002399.688137.56007.9877


## 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.



---

*Source: 6675565-2021-02-05.xml*