# 2D Sin-Cos-Henon Map for Color Image Encryption with High Security

Authors: Zhiqiang Cheng; Wencheng Wang; Yuezhang Dai; Lun Li
Journal: Journal of Applied Mathematics
 (2022)

---

## Abstract

In this paper, a high security color image encryption algorithm is proposed by 2D Sin-Cos-HÃ©non (2D-SCH) system. A new two-dimensional chaotic system which is 2D-SCH. This system is hyperchaotic. The use of the 2D-SCH, a color image encryption algorithm based on random scrambling and localization diffusion, is proposed. First, the secret key is generated by SHA512 through plaintext. As the initial value of the 2D-SCH system, the secret key is used to generate chaotic sequences. Then, the random scrambling is designed based on chaotic sequences. Finally, a pair of initial points is generated by the secret key; the image diffuses around this point. The ciphertext is obtained by a double encryption. Different from the traditional encryption algorithm, this paper encrypts three channels of color image simultaneously, which greatly improves the security of the algorithm. Simulation results show that the algorithm can resist various attacks.


---

## Body

## 1. Introduction

With the rapid development of Internet technology, information exchange becomes more and more frequent, and the protection of information becomes more and more important. As an important medium of information exchange, the image has become an important research object of scholars. Many methods are proposed to protect images [1–4], such as image hiding technology, zero-watermarking technology, and image encryption technology [5–9]. Image encryption technology is to convert plaintext into noise image; it is the most commonly used technology.Because chaotic systems have long-term unpredictability, initial value sensitivity, key sensitivity, and other characteristics, image encryption technology combined with chaotic system has gradually become a hot issue [10–13]. Hua et al. use 2D Logistic-Sine-coupling map in image encryption [14]. Sun et al. proposed an image encryption algorithm combined with 2D nonadjacent coupled map lattice with q [15]. Sharma proposed a new 2D logistic adjusted logistic map and used it in image encryption [16]. Zhang et al. used perceptron-like network and proposed an encryption algorithm based on chaos [17]. The chaotic key stream is used to generate a key matrix, and the image is diffused using the matrix semitensor product technology to complete the encryption [18–20]. In addition, some scholars use DNA technology in image encryption, and these algorithms show good performance [21–23].Chaos systems are divided into two categories, low-dimensional chaotic systems and high-dimensional chaotic systems [24–27]. Low-dimensional chaotic systems include Logistic and Tent. A low-dimensional chaotic system has a simple structure with only one positive Lyapunov exponent. In Ref. [28], it is pointed out that because of the computer precision problem, low-dimensional chaotic systems have the phenomenon of short period chaos degradation, which seriously destroys its randomness, so the security of chaotic image encryption with low-dimensional chaos is not high. Considering the chaotic system above two-dimensional, the hardware implementation cost is large, and the time of generating chaotic sequence is longer, so it is necessary to develop a low-cost two-dimensional chaotic system. In this paper, a new 2D-SCH is proposed, this chaotic system has two positive Lyapunov exponents, and chaotic sequences produced take a short time, so it is a hyperchaotic system, and it can be widely used in image encryption.Recently, many color image encryption algorithms have been proposed. Wang and Sun proposed chaotic image encryption algorithm based on Joseph traversal and cyclic shift function [29]. Xian et al. proposed a new image encryption algorithm combining CDSD and CSBS [30]. The above color image encryption algorithm processes the three channels of the color image separately, so the security of the algorithm is weakened, because the attacker will have three examples of algorithms on basically the same image. This paper proposes a three-channel simultaneous encryption algorithm, which improves the security of the algorithm. On the same image, the attacker will only get an example of the algorithm. Experimental results show that the algorithm proposed in this paper has high security and can resist various attacks.The main contributions of this paper are as follows:(1)
A 2D-SCH is designed; this chaotic system has complex dynamical behavior(2)
A cascaded color image encryption algorithm is designed. The three channels of the color image are encrypted at the same time(3)
A method of location XOR diffusion is proposed. The starting position of diffusion is not fixedThe rest of this article is as follows. The second section introduces the 2D-SCH, the third section presents the image encryption algorithm, the fourth section analyzes the security of the algorithm, and the fifth section proposes the future work.


## 2. 2D-SCH System

A new chaotic system is proposed in this paper. The mathematical analytic formula of the system is as follows:(1)xi+1=1−μsin2πxi+sinπyi,yi+1=μsinxiyi,where x0∈0,1, y0∈0,1, and μ∈3,6 at this parameter; the system is hyperchaotic with two positive Lyapunov exponents.


### 2.1. Trajectory

In this section, the trajectory of the 2D-SCH system is described. Choose the parametersμ=3, μ=4, and μ=5 and draw their trajectory map which is shown in Figure 1. Trajectory analysis shows that the values of the system distribute almost all places of the plane, which indicates that the system can output more randomly and can take almost all values in the window.Figure 1
2D-SCH trajectory of different parameters. (a) Trajectory ofμ=3. (b) Trajectory of μ=4. (c) Trajectory of μ=5.
(a)(b)(c)


### 2.2. Lyapunov Exponent

The Lyapunov exponent is an important index to depict chaotic system. When a chaotic system has two or more positive Lyapunov exponents, the system is in a hyperchaotic state. It is defined as(2)λ=limn⟶∞1n∑i=0n−1lnf′xi.Figure2 shows the Lyapunov exponent in the parameters of μ∈−1,6 and μ∈3,6, respectively.Figure 2
Lyapunov exponent of 2D-SCH. (a) Lyapunov exponent ofμ∈−1,6. (b) Lyapunov exponent of μ∈3,6.
(a)(b)We can see from Figure2 that when the 2D-SCH system has two positive Lyapunov exponents, under this parameter, the system is in the hyperchaotic state.Because the 2D-SCH system has good chaos, the 2D-SCH system is used in color image encryption.


## 2.1. Trajectory

In this section, the trajectory of the 2D-SCH system is described. Choose the parametersμ=3, μ=4, and μ=5 and draw their trajectory map which is shown in Figure 1. Trajectory analysis shows that the values of the system distribute almost all places of the plane, which indicates that the system can output more randomly and can take almost all values in the window.Figure 1
2D-SCH trajectory of different parameters. (a) Trajectory ofμ=3. (b) Trajectory of μ=4. (c) Trajectory of μ=5.
(a)(b)(c)


## 2.2. Lyapunov Exponent

The Lyapunov exponent is an important index to depict chaotic system. When a chaotic system has two or more positive Lyapunov exponents, the system is in a hyperchaotic state. It is defined as(2)λ=limn⟶∞1n∑i=0n−1lnf′xi.Figure2 shows the Lyapunov exponent in the parameters of μ∈−1,6 and μ∈3,6, respectively.Figure 2
Lyapunov exponent of 2D-SCH. (a) Lyapunov exponent ofμ∈−1,6. (b) Lyapunov exponent of μ∈3,6.
(a)(b)We can see from Figure2 that when the 2D-SCH system has two positive Lyapunov exponents, under this parameter, the system is in the hyperchaotic state.Because the 2D-SCH system has good chaos, the 2D-SCH system is used in color image encryption.


## 3. Color Image Encryption Algorithm

The color image encryption algorithm proposed in this paper is a process of scrambling to diffusion, and it is a two-round encryption algorithm. The size of the color image isP∈M×N; the encryption process is shown below.


### 3.1. Key Generation

Use SHA512 to generate a series of secret keys related to plaintext. Different plaintext can generate different secret keys, because SHA512 is difficult to be cracked, which increases the security of the algorithm. The key is generated as follows:Suppose the plaintext isP, three channels of P are PR, PG, and PB, and the three channels combined into a new image are PRGB:
(3)PRGB=PR,PG,PB.The generated key is(4)a=fhashPRGB,SHA512,a1=a1:128,a2=a129:256,a3=a256:384,a4=a385:512.In Equation (4), hashx,SHA512 represent x changed into SHA512. fx stands for converting x from Hex to Binary. Processing ai:
(5)b1=∑i=1128a1×2−i,b2=∑i=1128a2×2−i,b3=∑i=1128a3×2−i,b4=∑i=1128a4×2−i.b1 and b2 are the initial value of the chaotic system, bring them into Equation (2), and two chaotic sequences are produced which are x and y. The size of x is 3N. The size of y is M.


### 3.2. Random Scrambling

Sort the chaotic sequences generated in Section3.1 from small to large. x1 and y1 are produced. X and Y are defined by
(6)Xi=findx1i==x,i∈1,N,Yi=findy1i==y,i∈1,3M..In Equation (6), findx1i==x represents the position of x1i in x.Scrambling the plaintextPRGB and the scrambling matrix S is
(7)Qi,:=PRGBYi,:,i∈1,M,S1:,i=Q:,Xi,i∈1,3N,S:,i=circshiftS1:,i,Xi.In Equation (7), circshiftx,b represents that the vector x is cyclically shifted to the right by b positions.


### 3.3. Location XOR Diffusion

This section proposes a location XOR diffusion strategy. Determine the starting position of diffusion based on the initial secret key.(8)j=floorb3×3N,i=floorb4×M.Determine the value of the initial XOR:(9)c=floor0.8+0.2b4×256.Takei,j as the center and diffuse to the surroundings. The diffusion steps are
(10)Ci,j=bitxorSi,j,c,Cs,j=bitxorSs,j,Cs−1,j,s∈i+1:M,Cs,j=bitxorSs,j,Cs+1,j,s∈i−1:−1:1,Cs,t=bitxorSs,t,Cs,t−1,s∈1:M,t∈j+1:3N,Cs,t=bitxorSs,t,Cs,t+1,s∈1:M,t∈j−1:−1:1,and finally, get the ciphertextC:
(11)CR=C:,1:N,CG=C:,1+N:2N,CB=C:,1+2N:3N.The three channels of color images are obtained by processing the ciphertextC.Figure3 shows the steps of the location XOR diffusion.Figure 3
Schematic map of location XOR diffusion.


### 3.4. Decryption Algorithm

The algorithm proposed in this paper is a symmetric image encryption algorithm; each part of the encryption is reversible.Decrypt the keya generated by Equation (4) and ciphertext C; the decryption steps are as follows:Step 1 (reverse process of diffusion).
(12)Si,j=bitxorCi,j,c,Ss,j=bitxorCs,j,Cs−1,j,s∈i+1:M,Ss,j=bitxorCs,j,Cs+1,j,s∈i−1:−1:1,Ss,t=bitxorCs,t,Cs,t−1,s∈1:M,t∈j+1:3N,Ss,t=bitxorCs,t,Cs,t+1,s∈1:M,t∈j−1:−1:1.Step 2 (reverse process of scrambling).
(13)S1:,i=circshiftS:,i,3N−Xi,Q:,Xi=S1:,i,i∈1,3N,PRGBYi,:=Qi,:,i∈1,M.Step 3 (the three channels of plaintext).
(14)PR=PRGB:,1:N,PG=PRGB:,1+N:2N,PB=PRGB:,1+2N:3N.


## 3.1. Key Generation

Use SHA512 to generate a series of secret keys related to plaintext. Different plaintext can generate different secret keys, because SHA512 is difficult to be cracked, which increases the security of the algorithm. The key is generated as follows:Suppose the plaintext isP, three channels of P are PR, PG, and PB, and the three channels combined into a new image are PRGB:
(3)PRGB=PR,PG,PB.The generated key is(4)a=fhashPRGB,SHA512,a1=a1:128,a2=a129:256,a3=a256:384,a4=a385:512.In Equation (4), hashx,SHA512 represent x changed into SHA512. fx stands for converting x from Hex to Binary. Processing ai:
(5)b1=∑i=1128a1×2−i,b2=∑i=1128a2×2−i,b3=∑i=1128a3×2−i,b4=∑i=1128a4×2−i.b1 and b2 are the initial value of the chaotic system, bring them into Equation (2), and two chaotic sequences are produced which are x and y. The size of x is 3N. The size of y is M.


## 3.2. Random Scrambling

Sort the chaotic sequences generated in Section3.1 from small to large. x1 and y1 are produced. X and Y are defined by
(6)Xi=findx1i==x,i∈1,N,Yi=findy1i==y,i∈1,3M..In Equation (6), findx1i==x represents the position of x1i in x.Scrambling the plaintextPRGB and the scrambling matrix S is
(7)Qi,:=PRGBYi,:,i∈1,M,S1:,i=Q:,Xi,i∈1,3N,S:,i=circshiftS1:,i,Xi.In Equation (7), circshiftx,b represents that the vector x is cyclically shifted to the right by b positions.


## 3.3. Location XOR Diffusion

This section proposes a location XOR diffusion strategy. Determine the starting position of diffusion based on the initial secret key.(8)j=floorb3×3N,i=floorb4×M.Determine the value of the initial XOR:(9)c=floor0.8+0.2b4×256.Takei,j as the center and diffuse to the surroundings. The diffusion steps are
(10)Ci,j=bitxorSi,j,c,Cs,j=bitxorSs,j,Cs−1,j,s∈i+1:M,Cs,j=bitxorSs,j,Cs+1,j,s∈i−1:−1:1,Cs,t=bitxorSs,t,Cs,t−1,s∈1:M,t∈j+1:3N,Cs,t=bitxorSs,t,Cs,t+1,s∈1:M,t∈j−1:−1:1,and finally, get the ciphertextC:
(11)CR=C:,1:N,CG=C:,1+N:2N,CB=C:,1+2N:3N.The three channels of color images are obtained by processing the ciphertextC.Figure3 shows the steps of the location XOR diffusion.Figure 3
Schematic map of location XOR diffusion.


## 3.4. Decryption Algorithm

The algorithm proposed in this paper is a symmetric image encryption algorithm; each part of the encryption is reversible.Decrypt the keya generated by Equation (4) and ciphertext C; the decryption steps are as follows:Step 1 (reverse process of diffusion).
(12)Si,j=bitxorCi,j,c,Ss,j=bitxorCs,j,Cs−1,j,s∈i+1:M,Ss,j=bitxorCs,j,Cs+1,j,s∈i−1:−1:1,Ss,t=bitxorCs,t,Cs,t−1,s∈1:M,t∈j+1:3N,Ss,t=bitxorCs,t,Cs,t+1,s∈1:M,t∈j−1:−1:1.Step 2 (reverse process of scrambling).
(13)S1:,i=circshiftS:,i,3N−Xi,Q:,Xi=S1:,i,i∈1,3N,PRGBYi,:=Qi,:,i∈1,M.Step 3 (the three channels of plaintext).
(14)PR=PRGB:,1:N,PG=PRGB:,1+N:2N,PB=PRGB:,1+2N:3N.


## 4. Simulation and Performance Analysis

### 4.1. Simulation

Figure4 shows Goldhill_color_576x720 and Fruits_color_480x512, the two rounds of encryption and decryption process.Figure 4
Encryption and decryption of Goldhill and Fruits. (a) Plaintext of Goldhill. (b) Ciphertext of Goldhill. (c) Decryption of Goldhill. (d) Plaintext of Fruits. (e) Ciphertext of Fruits. (f) Decryption of Fruits.
(a)(b)(c)(d)(e)(f)


### 4.2. Secret Key Space Analysis

This paper uses the SHA512 to produce the secret key, and then, the secret key space is(15)space=2512>2100.As mentioned in Refs. [31, 32], the algorithm is sufficient to resist violent attacks when the secret key space exceeds 2100, so the algorithm proposed in this paper is sufficient to resist violent attacks.


### 4.3. Secret Key Sensitive Analysis

The keya in this article is generated by SHA512, and a is divided into several keys. One of the keys b1 is processed to obtain the wrong key b′=b1+10−14. Use the wrong key to restore the image. Take Lena_color_512x512 as an example. The results are shown in Figure 5.Figure 5
Key sensitivity analysis. (a) Restored of the correct key. (b) Restored of the wrong key.
(a)(b)It can be seen from Figure5 that the secret key in this paper is sensitive, and even if a small change is made to the secret key, the plaintext cannot be obtained through the decryption algorithm.


### 4.4. Histogram Analysis

Histogram analysis is to calculate the distribution of pixel values of plaintext and ciphertext. Generally, the distribution of plaintext histograms is uneven, and the distribution of ciphertext histograms obtained by a secure encryption algorithm is uniform; otherwise, the attacker will get some plaintext information through the histogram distribution of ciphertexts and crack the algorithm (Figure6).Figure 6
Histogram analysis. (a) Plaintext of 2.1.11_color. (b) Histogram of 2.1.11_R. (c) Histogram of 2.1.11_G. (d) Histogram of 2.1.11_B. (e) Ciphertext of 2.1.11_color. (f) Histogram of ciphertext 2.1.11_R. (g) Histogram of ciphertext 2.1.11_G. (h) Histogram of ciphertext 2.1.11_B.
(a)(b)(c)(d)(e)(f)(g)(h)It can be seen from Figure6 that the distribution of the ciphertext histogram after the algorithm in this paper is uniform. Therefore, the algorithm proposed in this paper has a good ability to resist statistical attacks.


### 4.5. Correlation Analysis

Correlation analysis is another important indicator of statistical analysis. Correlation analysis includes horizontal correlation analysis, vertical correlation analysis, and object correlation analysis.The calculation formula is as follows:(16)rxy=covx,yDxDy,(17)covx,y=1N∑i=1Nxi−Exyi−Ey,(18)Dx=1N∑i=1Nxi−Ex2,(19)Ex=1N∑i=1Nxi,Table1 shows the correlation analysis of plaintexts and ciphertexts. Experimental results show that the proposed algorithm can reduce the correlation of adjacent pixels.Table 1
Correlation coefficients of images.
ImagePlaintextProposedHorizontalVerticalDiagonalHorizontalVerticalDiagonalLena_color_R0.97970.98920.9696-0.00050.00020.0001Lena_color_G0.96880.98230.9553-0.00090.0003-0.0003Lena_color_B0.93250.95730.9180-0.00090.0014-0.0007Goldhill_color_R0.97820.97310.95930.000010.0017-0.0013Goldhill_color_G0.98150.98390.97070.00130.00040.0019Goldhill_color_B0.98370.98450.97290.0009-0.0001-0.0012Fruits_color_R0.99150.99160.98320.00330.0024-0.0049Fruits_color_G0.98600.98530.97040.0022-0.0003-0.0022Fruits_color_B0.95100.93160.88240.0049-0.00190.0021Taking Lena as an example, Table2 shows the comparison results of the correlation of adjacent pixels. Compared with Refs. [13, 33–37], we can see that the correlation between the adjacent pixels of the ciphertext obtained by the encryption algorithm in this paper is smaller, so this algorithm has higher security and it can resist statistical attacks.Table 2
Comparison of correlation coefficients.
LenaHVDProposedR-0.00050.00020.0001G-0.00090.0003-0.0003B-0.00090.0014-0.0007Ref. [33]R-0.00030.0012-0.0017G-0.00070.00120.0021B0.00180.01010.0023Ref. [34]R-0.00140.0024-0.0023G0.00020.0007-0.0004B0.0026-0.0019-0.0074Ref. [13]R-0.00290.0013-0.0026G-0.0032-0.0032-0.0039B0.0040-0.00180.0012Ref. [35]0.0006-0.0017-0.0008Ref. [36]0.00130.00220.0006Ref. [37]-0.0747-0.0015-0.0013


### 4.6. Different Attack

Differential attack refers to an attacker attacking a plaintext image and observing the transformation of the ciphertext to find a way to crack the algorithm. Differential attacks have two important indicators: number of pixel change rate (NPCR) and unified average changing intensity (UACI); their calculation formula is(20)NPCR=∑i,jEi,jM×N×100%,(21)UACI=1M×N∑i,jC1i,j−C2i,j255×100%.The theoretical values of NPCR and UACI are 99.6093% and 33.4635%, respectively. Change a bit on a pixel value of the plaintext to obtain an encrypted image, and compare it with the original encrypted image. Calculate the values of NPCR and UACI by the two encrypted images. In this paper, random selection of 100 sets of points for testing and the average value is taken. The calculation results are shown in Table3.Table 3
Average NPCR and UACI values between two ciphertexts.
ImageNPCR (%)UACI (%)Lena_color_R99.602333.4610Lena_color_G99.609233.4563Lena_color_B99.611133.4783Goldhill_color_R99.653633.4568Goldhill_color_G99.603633.4632Goldhill_color_B99.610233.4652Fruits_color_R99.604633.4863Fruits_color_G99.612333.4446Fruits_color_B99.532633.4789Table4 shows NPCR and UACI comparison with Refs. [13, 33–35, 37, 38]. The comparison results show that the proposed NPCR and UACI are closer to the theoretical value, so this algorithm has higher security.Table 4
NPCR and UACI comparison with other algorithms (%).
ProposedAverageRef. [33]Ref. [34]Ref. [13]Ref. [35]Ref. [37]Ref. [38]NPCR99.607599.609999.994899.610099.610099.650099.6200UACI33.465233.551033.361633.500033.360033.510033.4000


### 4.7. Information Entropy Analysis

Information entropy represents the degree of confusion of information distribution. The bigger the information entropy, the more chaotic the information distribution. Conversely, the smaller the information entropy, the more uniform the information distribution. The calculation formula is as follows:(22)Hs=∑i=02L−1psilog21psi.The theoretical value of information entropy is 8. Using the above formula, the entropy test is performed on the plaintext and ciphertext of the algorithm in this paper. The test results are shown in Table5.Table 5
Information entropy of images.
ImagePlainProposedLena_color_R7.25307.9993Lena_color_G7.59517.9993Lena_color_B6.96857.9994Goldhill_color_R7.61007.9995Goldhill_color_G7.55447.9995Goldhill_color_B7.55397.9996Fruits_color_R7.53817.9992Fruits_color_G7.34357.9994Fruits_color_B6.79697.9992Table6 presents a comparison with Refs. [33–35, 37, 38] of Lena. The experimental results show that the information entropy of the algorithm proposed in this paper is closer to 8, so this algorithm has higher security.Table 6
Information entropy comparison.
ChannelsProposedRef. [33]Ref. [34]Ref. [35]Ref. [37]Ref. [38]R7.99937.99777.99737.99517.99747.9970G7.99937.99687.99697.99657.99687.9970B7.99947.99697.99717.98297.99707.9976


### 4.8. Time Analysis

The system environment is as follows: win7 system, CPU: 5210 U, and Matlab R2019a. Taking Lena_color (512x512) as an example, the time analysis of the proposed encryption algorithm is shown in Table7, and the time comparison results with some algorithms are shown in Table 7.Table 7
Time efficiency analysis.
AlgorithmsProposedRef. [35]Ref. [37]Ref. [38]Ref. [39]Time/s2.3112.2321.942.6819.14Time complexity analysis shows that the algorithm proposed in this paper runs faster and is more suitable for promotion in industrial production.


## 4.1. Simulation

Figure4 shows Goldhill_color_576x720 and Fruits_color_480x512, the two rounds of encryption and decryption process.Figure 4
Encryption and decryption of Goldhill and Fruits. (a) Plaintext of Goldhill. (b) Ciphertext of Goldhill. (c) Decryption of Goldhill. (d) Plaintext of Fruits. (e) Ciphertext of Fruits. (f) Decryption of Fruits.
(a)(b)(c)(d)(e)(f)


## 4.2. Secret Key Space Analysis

This paper uses the SHA512 to produce the secret key, and then, the secret key space is(15)space=2512>2100.As mentioned in Refs. [31, 32], the algorithm is sufficient to resist violent attacks when the secret key space exceeds 2100, so the algorithm proposed in this paper is sufficient to resist violent attacks.


## 4.3. Secret Key Sensitive Analysis

The keya in this article is generated by SHA512, and a is divided into several keys. One of the keys b1 is processed to obtain the wrong key b′=b1+10−14. Use the wrong key to restore the image. Take Lena_color_512x512 as an example. The results are shown in Figure 5.Figure 5
Key sensitivity analysis. (a) Restored of the correct key. (b) Restored of the wrong key.
(a)(b)It can be seen from Figure5 that the secret key in this paper is sensitive, and even if a small change is made to the secret key, the plaintext cannot be obtained through the decryption algorithm.


## 4.4. Histogram Analysis

Histogram analysis is to calculate the distribution of pixel values of plaintext and ciphertext. Generally, the distribution of plaintext histograms is uneven, and the distribution of ciphertext histograms obtained by a secure encryption algorithm is uniform; otherwise, the attacker will get some plaintext information through the histogram distribution of ciphertexts and crack the algorithm (Figure6).Figure 6
Histogram analysis. (a) Plaintext of 2.1.11_color. (b) Histogram of 2.1.11_R. (c) Histogram of 2.1.11_G. (d) Histogram of 2.1.11_B. (e) Ciphertext of 2.1.11_color. (f) Histogram of ciphertext 2.1.11_R. (g) Histogram of ciphertext 2.1.11_G. (h) Histogram of ciphertext 2.1.11_B.
(a)(b)(c)(d)(e)(f)(g)(h)It can be seen from Figure6 that the distribution of the ciphertext histogram after the algorithm in this paper is uniform. Therefore, the algorithm proposed in this paper has a good ability to resist statistical attacks.


## 4.5. Correlation Analysis

Correlation analysis is another important indicator of statistical analysis. Correlation analysis includes horizontal correlation analysis, vertical correlation analysis, and object correlation analysis.The calculation formula is as follows:(16)rxy=covx,yDxDy,(17)covx,y=1N∑i=1Nxi−Exyi−Ey,(18)Dx=1N∑i=1Nxi−Ex2,(19)Ex=1N∑i=1Nxi,Table1 shows the correlation analysis of plaintexts and ciphertexts. Experimental results show that the proposed algorithm can reduce the correlation of adjacent pixels.Table 1
Correlation coefficients of images.
ImagePlaintextProposedHorizontalVerticalDiagonalHorizontalVerticalDiagonalLena_color_R0.97970.98920.9696-0.00050.00020.0001Lena_color_G0.96880.98230.9553-0.00090.0003-0.0003Lena_color_B0.93250.95730.9180-0.00090.0014-0.0007Goldhill_color_R0.97820.97310.95930.000010.0017-0.0013Goldhill_color_G0.98150.98390.97070.00130.00040.0019Goldhill_color_B0.98370.98450.97290.0009-0.0001-0.0012Fruits_color_R0.99150.99160.98320.00330.0024-0.0049Fruits_color_G0.98600.98530.97040.0022-0.0003-0.0022Fruits_color_B0.95100.93160.88240.0049-0.00190.0021Taking Lena as an example, Table2 shows the comparison results of the correlation of adjacent pixels. Compared with Refs. [13, 33–37], we can see that the correlation between the adjacent pixels of the ciphertext obtained by the encryption algorithm in this paper is smaller, so this algorithm has higher security and it can resist statistical attacks.Table 2
Comparison of correlation coefficients.
LenaHVDProposedR-0.00050.00020.0001G-0.00090.0003-0.0003B-0.00090.0014-0.0007Ref. [33]R-0.00030.0012-0.0017G-0.00070.00120.0021B0.00180.01010.0023Ref. [34]R-0.00140.0024-0.0023G0.00020.0007-0.0004B0.0026-0.0019-0.0074Ref. [13]R-0.00290.0013-0.0026G-0.0032-0.0032-0.0039B0.0040-0.00180.0012Ref. [35]0.0006-0.0017-0.0008Ref. [36]0.00130.00220.0006Ref. [37]-0.0747-0.0015-0.0013


## 4.6. Different Attack

Differential attack refers to an attacker attacking a plaintext image and observing the transformation of the ciphertext to find a way to crack the algorithm. Differential attacks have two important indicators: number of pixel change rate (NPCR) and unified average changing intensity (UACI); their calculation formula is(20)NPCR=∑i,jEi,jM×N×100%,(21)UACI=1M×N∑i,jC1i,j−C2i,j255×100%.The theoretical values of NPCR and UACI are 99.6093% and 33.4635%, respectively. Change a bit on a pixel value of the plaintext to obtain an encrypted image, and compare it with the original encrypted image. Calculate the values of NPCR and UACI by the two encrypted images. In this paper, random selection of 100 sets of points for testing and the average value is taken. The calculation results are shown in Table3.Table 3
Average NPCR and UACI values between two ciphertexts.
ImageNPCR (%)UACI (%)Lena_color_R99.602333.4610Lena_color_G99.609233.4563Lena_color_B99.611133.4783Goldhill_color_R99.653633.4568Goldhill_color_G99.603633.4632Goldhill_color_B99.610233.4652Fruits_color_R99.604633.4863Fruits_color_G99.612333.4446Fruits_color_B99.532633.4789Table4 shows NPCR and UACI comparison with Refs. [13, 33–35, 37, 38]. The comparison results show that the proposed NPCR and UACI are closer to the theoretical value, so this algorithm has higher security.Table 4
NPCR and UACI comparison with other algorithms (%).
ProposedAverageRef. [33]Ref. [34]Ref. [13]Ref. [35]Ref. [37]Ref. [38]NPCR99.607599.609999.994899.610099.610099.650099.6200UACI33.465233.551033.361633.500033.360033.510033.4000


## 4.7. Information Entropy Analysis

Information entropy represents the degree of confusion of information distribution. The bigger the information entropy, the more chaotic the information distribution. Conversely, the smaller the information entropy, the more uniform the information distribution. The calculation formula is as follows:(22)Hs=∑i=02L−1psilog21psi.The theoretical value of information entropy is 8. Using the above formula, the entropy test is performed on the plaintext and ciphertext of the algorithm in this paper. The test results are shown in Table5.Table 5
Information entropy of images.
ImagePlainProposedLena_color_R7.25307.9993Lena_color_G7.59517.9993Lena_color_B6.96857.9994Goldhill_color_R7.61007.9995Goldhill_color_G7.55447.9995Goldhill_color_B7.55397.9996Fruits_color_R7.53817.9992Fruits_color_G7.34357.9994Fruits_color_B6.79697.9992Table6 presents a comparison with Refs. [33–35, 37, 38] of Lena. The experimental results show that the information entropy of the algorithm proposed in this paper is closer to 8, so this algorithm has higher security.Table 6
Information entropy comparison.
ChannelsProposedRef. [33]Ref. [34]Ref. [35]Ref. [37]Ref. [38]R7.99937.99777.99737.99517.99747.9970G7.99937.99687.99697.99657.99687.9970B7.99947.99697.99717.98297.99707.9976


## 4.8. Time Analysis

The system environment is as follows: win7 system, CPU: 5210 U, and Matlab R2019a. Taking Lena_color (512x512) as an example, the time analysis of the proposed encryption algorithm is shown in Table7, and the time comparison results with some algorithms are shown in Table 7.Table 7
Time efficiency analysis.
AlgorithmsProposedRef. [35]Ref. [37]Ref. [38]Ref. [39]Time/s2.3112.2321.942.6819.14Time complexity analysis shows that the algorithm proposed in this paper runs faster and is more suitable for promotion in industrial production.


## 5. Conclusion

This paper designs a 2D-SCH chaotic system, which is a hyperchaotic system. This system has low implementation cost and short time to generate chaotic sequence. Therefore, 2D-SCH chaotic system is used in image encryption. A location XOR diffusion algorithm is proposed, which obtains ciphertext after two rounds of operations. Unlike the common color image encryption, the algorithm designed in this paper encrypts three channels at the same time, which increases the security of the algorithm. Simulation and performance analysis show that the algorithm designed in this paper can resist various attacks.In future work, the authors intend to implement the algorithm in hardware so that the algorithm can be used in industrial production and make the encryption algorithm more secure and robust.



---

*Source: 9508749-2022-08-04.xml*