# A Color Image Encryption Scheme Based on a Novel 3D Chaotic Mapping

Authors: Chunyuan Liu; Qun Ding
Journal: Complexity
 (2020)

---

## Abstract

Low-dimensional chaotic mappings are simple functions that have low computation cost and are easy to realize, but applying them in a cryptographic algorithm will lead to security vulnerabilities. To overcome this shortcoming, this paper proposes the coupled chaotic system, which coupled the piecewise and Henon mapping. Simulation results indicate that the novel mapping has better complexity and initial sensitivity and larger key space compared with the original mapping. Then, a new color image encryption algorithm is proposed based on the new chaotic mapping. The algorithm has two processes: diffusion and confusion. In this scheme, the key is more than2216, and SSIM and PSNR are 0.009675 and 8.6767, respectively. The secret key is applied in the shuffling and diffusion. Security analysis indicates that the proposed scheme can resist cryptanalytic attacks. It has superior performance and has high security.


---

## Body

## 1. Introduction

Chaos has always been a very active research topic in the field of nonlinear science. There are many common characteristics of digital chaotic system and cryptography, such as sensitivity and being aperiodic and pseudorandom. These characteristics promote the application of digital chaotic system in cryptographic algorithm design. Image encryption is one of the main means of information protection. An image will have some characteristics such as high correlation, large data size, and high data dimension, which should be considered additional, when it is encrypted. Because of the low efficiency of real-time processing, traditional encryption algorithms are not suitable for digital images such as DES, 3DES, and AES [1]. Therefore, many image encryption schemes based on different fields have been proposed in recent years such as cellular automata [2, 3], wavelet transform [4, 5], compressing sensing [6], selective encryption [7], DNA coding [8, 9], and chaos [10–14].Because of the large key space, strong dynamic characteristics, complex attractor, and strong ergodicity of high-dimensional chaotic system, it is more secure than low dimension. The high computational cost of high-dimensional chaotic system makes it occupy more hardware and software resources, which is difficult to implement. By contrast, the low-dimensional chaotic system is a simple function, which is easier to implement. Due to the computation precision of software and hardware, the chaotic complexity in real-numbered chaos is often affected by dynamic degradation (collapsing effect) [14, 15]. With the study going on, low-dimensional chaotic maps have been performed perfectly on its characteristics [16, 17]. In particular, some algorithms based on low-dimensional chaotic maps have been widely studied and cracked [18–20]. Therefore, when a low-dimensional chaotic mapping is applied in cryptography, it is necessary to enhance all of its chaotic characteristics.Aiming at the degradation of digital chaotic property caused by innate structural defects, many algorithms such as [21, 22], pseudorandom perturbation [23], switching systems [24, 25], and combination systems based on modular operation [26–29] have been proposed to overcome this. However, due to the uncertain parameters, it still includes partial periodic regions which do not maintain long stable synchronization. Each of the existing approaches has its own limitations and drawbacks [30].Many image encryption algorithms have been proposed based on Shannon’s theory about shuffling and diffusion [5, 12, 31, 32]. Shuffling can rearrange pixels by some rules [33] and diffusion can substitute pixels by a series generated by a chaotic map. The inherent features of a chaotic map can be suitable for the two security notions.Generally, most of algorithms come with the common limitations. Firstly, the key is independent of the original image; that is, if the key is unchanged, the different original images that need to be encrypted will use the same key [34–36]. Secondly, the encryption scheme based on low-dimensional chaotic maps is not suitable for practical use because of its small key space, short period, and low complexity [14–17]. At last, the ciphertext is only related to the key and has no relationship with the plaintext and middle ciphertext, which cannot resist the plaintext attack and the ciphertext attack.In this paper, we propose a novel color image encryption algorithm based on an efficient chaotic system coupling two low-dimensional chaotic maps. Firstly, the new chaotic system utilizes combination method to formulate a 3D chaotic map. It not only retains the complexity of its underlying maps but also enlarges the dimensions from 2D to 3D. Also, it enlarges the key space. Thus, the chaotic map can depict highly chaotic behavior for all parameters. Secondly, the initial key is derived from plaintext, and different images have different initial key, which improves the security of the algorithm. Finally, the formula of this algorithm is related not only to the key and plaintext but also to the intermediate ciphertext, which increases the complexity among plaintext, ciphertext, and key.The other sections of this paper are organized as follows: Section2 represents the proposed chaotic system and introduces the new 3D chaotic map and then proves its chaotic properties. In Section 3, a detailed explanation of the proposed encryption algorithm is provided. Some analysis of its security and performance is carried out in Section 4 and the conclusion is given in Section 5.


## 2. 3D Piecewise-Henon Map

With the continuous improvement of computing speed and performance of modern computers, nonlinear systems have developed greatly. However, because of the computational accuracy of computer software and hardware limiting, the complexity of chaotic mapping in real number field will gradually decline. In addition, the orbit of the low-dimensional chaotic map will degenerate (collapse effect) in some periods. Therefore, low-dimensional chaotic systems are rarely used alone [37, 38]. In particular, Henon and logistic mappings are quite different in theory when they are used alone [39, 40]. Therefore, we combine the characteristics of Henon mapping and the piecewise mapping to construct a new chaotic mapping with larger dimension and better chaotic characteristics, 3D piecewise-Henon mapping (3D-PHM).3D-PHM is as follows:(1)Txn,yn,zn=xn+1=ψc1xn+Λc2yn,znmod1,yn+1=ψc1yn+Λc2zn,xnmod1,zn+1=ψc1zn+Λc2xn,ynmod1,wherec1 and c2 are real control parameters; ψc1x is a piecewise function; that is,(2)ψc1x=1−c1x,Λc2x,y=y+1−c2x2,is the Henon mapping.The initial valuesx0, y0, and z0 are selected in the interval 0,1. From 3D-PHM, three state values are obtained by each integer k, which are denoted as xk, yk, and zk. The range of the value is confined in 0,13. Because of its good simplicity, ergodicity, and sensitivity to initial conditions, the system has good cryptographic performance.


### 2.1. Graphical Analysis

The control parametersc1 and c2 in 3D-PHM are very important. We drew a contour map of the approximate entropy of the system with different values, which is shown in Figure 1; c1 and c2 are varied from 0 to 15, and the step=0.01. In Figure 1(a), the complexity of the system is good in most of the regions, and, with the increase of parameters c1 and c2, the approximate entropy is high, except for some regions (Figure 1(b) is the enlargement of part (a); the low value position can be seen). Therefore, when studying the characteristics of 3D-PHM, we will set the control parameters of the system (formula (1)) as c1=c2=c.Figure 1
The approximate entropy of the control parameters ofc1 and c2. (a)c1,c2∈0,15×0,15; (b) an enlargement of (a).
(a)(b)Lyapunov exponent is an important parameter of chaotic systems. When one of Lyapunov exponents is positive, the system will be a chaotic system. Provided that there are two or more positive Lyapunov exponents, the system is a hyperchaotic system. Eigenvalue method is used to calculate Lyapunov exponent of 3D-PHM, which is (0.3055, 0.3158, 0.1529), whenx0,y0,z0=0.1,0.2,0.3, and c1=c2=c=15. The Jacobian of equation (1) is as follows:(3)J=∂f1∂xn∂f1∂yn∂f1∂zn∂f2∂xn∂f2∂yn∂f2∂zn∂f3∂xn∂f3∂yn∂f3∂zn.The initial point isx0,y0,z0, and the other iteration points obtained from the iterative equation are x0,y0,z0,x1,y1,z1,…,xn,yn,zn, respectively. The first (n−1) Jacobian matrices are J0=Jx0,y0,z0, J1=Jx1,y1,z1, and Jn−1=Jxn−1,yn−1,zn−1, respectively. When the increment is small enough, its evolution satisfies the linear differential equation: (4)∂xn∂yn∂zn=Jn−1∂xn−1∂yn−1∂zn−1=Jn−1Jn−2∂xn−2∂yn−2∂zn−2=⋯=Jn−1Jn−2⋯J0∂x0∂y0∂z0,where J = Jn−1Jn−2…J. Let the three eigenvalues of matrix J be λ1,λ2,λ3, respectively. (5)LE1=1nlnλ1,LE2=1nlnλ2,LE3=1nlnλ3.Figure2 shows the chaotic attractor of A, which has no obvious uneven distribution in the region. It has a very good ergodicity when c=15.Figure 2
The chaotic attractor of 3D-PHM.


### 2.2. Comparative Analysis of Permutation Entropy of Henon, 3D-Henon, and 3D-PHM Maps

The complexity of a chaotic system indicates the uncertainty of a mapping, which can be measured by entropy. For a symbol sequence, the higher its entropy is, the higher its complexity is; otherwise, the lower its complexity is.Permutation entropy (PE) is the algorithm of complexity for measuring time series, which was proposed by Christoph Bandt and Pompe in 2002. The permutation entropy is defined as follows [34]:(6)He=−∑i=1kPklnPk,where e is the embedded dimension of the reconstructed sequence and Pk is the probability of the occurrence of each symbol. In theory, when Pk=1/e!, He reaches the maximum lne!, but, in practice, He≤lnN−e+1. In general, He will be standardized by lnN−e+1; that is,(7)0≤he=HelnN−e+1≤1.Obviously, the complexity of the series can be reflected byhe. The smaller he is, the stronger regularity of the chaotic series is. On the contrary, the larger he is, the higher complexity of the chaotic sequence is and the greater the complexity of the chaotic sequence is. The comparisons of PE among Henon mapping, 3D-Henon, and 3D-PHM are shown in Figure 3. As is shown, PE of 3D-PHM is higher than those of 3D-Henon mapping and Henon mapping. Henon mapping is the least complex. PE of 3D-PHM is significantly higher than that of Henon mapping. That means the complexity of Henon mapping is increased significantly.Figure 3
The comparison of PE between Henon mapping, 3D-PHM, and 3D-Henon mapping (e is the embedded dimension).


### 2.3. Sensitive to Initial Conditions

The initial condition sensitiveness is another important characteristic of chaotic systems. Figure4 illustrates the sensitivity of 3D-PHM to small changes in initial conditions. For two very close initial values x0,y0,z0 and x˜0,y˜0,z˜0=x0+δ,y0+δ,z0+δ, where δ≈10−16, 3D-PHM can produce two completely different sequences and the gaps between their trajectories xn,yn,znn=0,1,⋯… and x˜n,y˜n,z˜nn=0,1,2… increase considerably.Figure 4
Initial value sensitivity for 100 iterations whenc=15, x0,y0,z0=0.103,0.241,0.318, x˜0,y˜0,z˜0=x0+δ,y0+δ,z0+δ, and δ≈10−16. (a) Plot of xnn=0n=100 and x˜nn=0n=100 versus n; (b) plot of ynn=0n=100 and y˜nn=0n=100 versus n; (c) plot of znn=0n=100 and z˜kn=0n=100 versus n; (d) plot of xn−x˜nn=0n=100 versus n; (e) plot of yn−y˜nn=0n=100 versus n; (f) plot of zn−z˜nn=0n=100 versus n.
(a)(b)(c)(d)(e)(f)


### 2.4. The NIST Statistical Test

For all 15 tests in the NIST suite, the significance level was set to 1%. IfP−value>0.01, the binary sequence is accepted to be random with a confidence of 99%; otherwise, it is considered as nonrandom. To perform this battery of tests, we have generated up to 106 points xi,yi,zi;i>nt by 3D-PHM. We convert these sequences into binary form and NIST tests were performed on them. The test results are shown in Table 1 and all the tests were successful. It is shown that 3D-PHM has a strong randomness and can resist many statistical attacks. Hence, the tested binary sequences generated by 3D-PLM are random with respect to all the 15 tests of NIST suite.Table 1
The NIST test results of each component generated by 3D-PHM.
No.Test nameP valueResultxyz1Frequency0.5543200.3268100.458760Success2Block frequency0.8345700.5778020.435602Success3Runs0.5476000.1975060.231586Success4Longest run0.8012650.7923510.786422Success5Rank0.9727450.2678110.336589Success6FFT0.0356870.9487210.456874Success7Nonoverlapping template0.2358740.4785120.587456Success8Overlapping template0.4978320.0894510.785421Success9Universal0.9356470.0589740.057894Success10Linear complexity0.7981450.2789450.924578Success11Serial0.7546120.8459710.348755Success12Approximate entropy0.6167840.0894510.365874Success13Cumulative sums0.1687450.9445130.638745Success14Random excursions0.6541230.0879450.654716Success15Random excursions variant0.5652090.0587990.565209Success


### 2.5. Approximate Probability Density

Probability distribution function is a tool to measure whether a dynamic system is a uniform distribution [41]. In order to measure the probability density of the system, we divide the three-dimensional attractor A into a group of small cubes in B=0,13, and the number of cubes is n3, which is defined by(8)ri=in,gj=jn,bk=kn,i,j,k=0,1,…,n−1,Bi,j,k=ri,ri+1×gj,gj+1×bk,bk+1,i,j,k=0,1,…,n−2,Bn−1,j,k=rn−1,1×gj,gj+1×bk,bk+1,i,j,k=0,1,…,n−2,Bi,n−1,k=ri,ri+1×gn−1,1×bk,bk+1,,i,j,k=0,1,…,n−2,andBi,j,n−1=ri,ri+1×gj,gj+1×bn−1,1,,i,j,k=0,1,…,n−2.Letnt be the number of iterations in transition regime, large enough, and after nt+n^ iterations of 3D-PHM, the proportion of the box Bi,j,k0≤i,j,k≤n−1 reached by the orbit Cn^x0,y0,z0=Tnt+ix0,y0,z0;i=1,…,n^ is calculated by (9)%Pn^=1n3∑0≤i,j,k≤n−1χBi,j,kCn^x0,y0,z0×100%,where χE is a special function about the set E′ which is defined as follows:(10)χEE′=1,ifE∩E′≠∅,0,ifE∩E′=∅.In addition, in order to get the number of times the trajectoryCn^x0,y0,z0 passes through a particular cube Bi,j,k, we need to calculate the relative times of trajectory Cn^x0,y0,z0 accessing this box relative to n^. Given that n^ is large enough, the approximate probability density function Pn^x,y,z=Pn^Bi,j,k under all conditions 0≤i,j,k≤n−1 and all x,y,z∈Bi,j,k and then(11)Pn^Bi,j,k=1n^∑s=1s=n^χBi,j,kTnt+sx0,y0,z0.In order to define the 3D-PHM system to random, it will be further required that the variables defined above and the invariant measure mathematicians called must be independent of the starting pointx0,y0,z0. Moreover, when the track Cn^x0,y0,z0 is evenly distributed throughout the space, in that way, for all 0≤i,j,k≤n−1, the following formula holds right:(12)μBi,j,k=limn^⟶∞Pn^Bi,j,k=1n3,where μBi,j,k represents the natural Lebesgue metric of Bi,j,k [42].For computing the approximate density function of 3D-PHM, cubeB is divided into n3=1003 boxes. When nt=104 and nt+n^ iterates with mapping (1), n^=s×n3, where s=1,…,30. The control parameter and the initial values are fixed at c=15 and x0,y0,z0=0.1,0.2,0.3. In Figure 5(a), the trajectory Cn^x0,y0,z0 will visit more than 99% cubes Bi,j,k, when n^ exceeds 5×n3. The calculation using mean square error (MSE) is carried out to measure the difference between the values of Pn^Bi,j,k and μBi,j,k. This metric is as follows:(13)MSEPn^−1n3=1n3Pn^−1n32,where ⋅ denotes the Euclidian norm. Obviously, in Figure 5(b), MSE values decrease to zero with the number of iterations n^ increasing, which means the point of the trajectory Cn^x0,y0,z0 is distributed uniformly in the phase space.Figure 5
The results ofPn^ and MSE, where n=100, n^=s×n3, and s=1,2,…,30. (a) The proportion of Pn^; (b) the mean square error MSEPn^−1/n3.
(a)(b)The histogram of the approximate density functionPn^ is displayed in Figure 6(b). It shows a standard normalized distribution perfectly. The series, which is generated by 3D-PHM, is distributed uniformly in the phase space without any concentration in Figure 6(a). It implies strong chaoticity and ergodicity.Figure 6
(a) The approximate density functionPn^ of 3D-PHM. (b) The histogram of the density, wheren=100 and n^=30×n3.
(a)(b)


## 2.1. Graphical Analysis

The control parametersc1 and c2 in 3D-PHM are very important. We drew a contour map of the approximate entropy of the system with different values, which is shown in Figure 1; c1 and c2 are varied from 0 to 15, and the step=0.01. In Figure 1(a), the complexity of the system is good in most of the regions, and, with the increase of parameters c1 and c2, the approximate entropy is high, except for some regions (Figure 1(b) is the enlargement of part (a); the low value position can be seen). Therefore, when studying the characteristics of 3D-PHM, we will set the control parameters of the system (formula (1)) as c1=c2=c.Figure 1
The approximate entropy of the control parameters ofc1 and c2. (a)c1,c2∈0,15×0,15; (b) an enlargement of (a).
(a)(b)Lyapunov exponent is an important parameter of chaotic systems. When one of Lyapunov exponents is positive, the system will be a chaotic system. Provided that there are two or more positive Lyapunov exponents, the system is a hyperchaotic system. Eigenvalue method is used to calculate Lyapunov exponent of 3D-PHM, which is (0.3055, 0.3158, 0.1529), whenx0,y0,z0=0.1,0.2,0.3, and c1=c2=c=15. The Jacobian of equation (1) is as follows:(3)J=∂f1∂xn∂f1∂yn∂f1∂zn∂f2∂xn∂f2∂yn∂f2∂zn∂f3∂xn∂f3∂yn∂f3∂zn.The initial point isx0,y0,z0, and the other iteration points obtained from the iterative equation are x0,y0,z0,x1,y1,z1,…,xn,yn,zn, respectively. The first (n−1) Jacobian matrices are J0=Jx0,y0,z0, J1=Jx1,y1,z1, and Jn−1=Jxn−1,yn−1,zn−1, respectively. When the increment is small enough, its evolution satisfies the linear differential equation: (4)∂xn∂yn∂zn=Jn−1∂xn−1∂yn−1∂zn−1=Jn−1Jn−2∂xn−2∂yn−2∂zn−2=⋯=Jn−1Jn−2⋯J0∂x0∂y0∂z0,where J = Jn−1Jn−2…J. Let the three eigenvalues of matrix J be λ1,λ2,λ3, respectively. (5)LE1=1nlnλ1,LE2=1nlnλ2,LE3=1nlnλ3.Figure2 shows the chaotic attractor of A, which has no obvious uneven distribution in the region. It has a very good ergodicity when c=15.Figure 2
The chaotic attractor of 3D-PHM.


## 2.2. Comparative Analysis of Permutation Entropy of Henon, 3D-Henon, and 3D-PHM Maps

The complexity of a chaotic system indicates the uncertainty of a mapping, which can be measured by entropy. For a symbol sequence, the higher its entropy is, the higher its complexity is; otherwise, the lower its complexity is.Permutation entropy (PE) is the algorithm of complexity for measuring time series, which was proposed by Christoph Bandt and Pompe in 2002. The permutation entropy is defined as follows [34]:(6)He=−∑i=1kPklnPk,where e is the embedded dimension of the reconstructed sequence and Pk is the probability of the occurrence of each symbol. In theory, when Pk=1/e!, He reaches the maximum lne!, but, in practice, He≤lnN−e+1. In general, He will be standardized by lnN−e+1; that is,(7)0≤he=HelnN−e+1≤1.Obviously, the complexity of the series can be reflected byhe. The smaller he is, the stronger regularity of the chaotic series is. On the contrary, the larger he is, the higher complexity of the chaotic sequence is and the greater the complexity of the chaotic sequence is. The comparisons of PE among Henon mapping, 3D-Henon, and 3D-PHM are shown in Figure 3. As is shown, PE of 3D-PHM is higher than those of 3D-Henon mapping and Henon mapping. Henon mapping is the least complex. PE of 3D-PHM is significantly higher than that of Henon mapping. That means the complexity of Henon mapping is increased significantly.Figure 3
The comparison of PE between Henon mapping, 3D-PHM, and 3D-Henon mapping (e is the embedded dimension).


## 2.3. Sensitive to Initial Conditions

The initial condition sensitiveness is another important characteristic of chaotic systems. Figure4 illustrates the sensitivity of 3D-PHM to small changes in initial conditions. For two very close initial values x0,y0,z0 and x˜0,y˜0,z˜0=x0+δ,y0+δ,z0+δ, where δ≈10−16, 3D-PHM can produce two completely different sequences and the gaps between their trajectories xn,yn,znn=0,1,⋯… and x˜n,y˜n,z˜nn=0,1,2… increase considerably.Figure 4
Initial value sensitivity for 100 iterations whenc=15, x0,y0,z0=0.103,0.241,0.318, x˜0,y˜0,z˜0=x0+δ,y0+δ,z0+δ, and δ≈10−16. (a) Plot of xnn=0n=100 and x˜nn=0n=100 versus n; (b) plot of ynn=0n=100 and y˜nn=0n=100 versus n; (c) plot of znn=0n=100 and z˜kn=0n=100 versus n; (d) plot of xn−x˜nn=0n=100 versus n; (e) plot of yn−y˜nn=0n=100 versus n; (f) plot of zn−z˜nn=0n=100 versus n.
(a)(b)(c)(d)(e)(f)


## 2.4. The NIST Statistical Test

For all 15 tests in the NIST suite, the significance level was set to 1%. IfP−value>0.01, the binary sequence is accepted to be random with a confidence of 99%; otherwise, it is considered as nonrandom. To perform this battery of tests, we have generated up to 106 points xi,yi,zi;i>nt by 3D-PHM. We convert these sequences into binary form and NIST tests were performed on them. The test results are shown in Table 1 and all the tests were successful. It is shown that 3D-PHM has a strong randomness and can resist many statistical attacks. Hence, the tested binary sequences generated by 3D-PLM are random with respect to all the 15 tests of NIST suite.Table 1
The NIST test results of each component generated by 3D-PHM.
No.Test nameP valueResultxyz1Frequency0.5543200.3268100.458760Success2Block frequency0.8345700.5778020.435602Success3Runs0.5476000.1975060.231586Success4Longest run0.8012650.7923510.786422Success5Rank0.9727450.2678110.336589Success6FFT0.0356870.9487210.456874Success7Nonoverlapping template0.2358740.4785120.587456Success8Overlapping template0.4978320.0894510.785421Success9Universal0.9356470.0589740.057894Success10Linear complexity0.7981450.2789450.924578Success11Serial0.7546120.8459710.348755Success12Approximate entropy0.6167840.0894510.365874Success13Cumulative sums0.1687450.9445130.638745Success14Random excursions0.6541230.0879450.654716Success15Random excursions variant0.5652090.0587990.565209Success


## 2.5. Approximate Probability Density

Probability distribution function is a tool to measure whether a dynamic system is a uniform distribution [41]. In order to measure the probability density of the system, we divide the three-dimensional attractor A into a group of small cubes in B=0,13, and the number of cubes is n3, which is defined by(8)ri=in,gj=jn,bk=kn,i,j,k=0,1,…,n−1,Bi,j,k=ri,ri+1×gj,gj+1×bk,bk+1,i,j,k=0,1,…,n−2,Bn−1,j,k=rn−1,1×gj,gj+1×bk,bk+1,i,j,k=0,1,…,n−2,Bi,n−1,k=ri,ri+1×gn−1,1×bk,bk+1,,i,j,k=0,1,…,n−2,andBi,j,n−1=ri,ri+1×gj,gj+1×bn−1,1,,i,j,k=0,1,…,n−2.Letnt be the number of iterations in transition regime, large enough, and after nt+n^ iterations of 3D-PHM, the proportion of the box Bi,j,k0≤i,j,k≤n−1 reached by the orbit Cn^x0,y0,z0=Tnt+ix0,y0,z0;i=1,…,n^ is calculated by (9)%Pn^=1n3∑0≤i,j,k≤n−1χBi,j,kCn^x0,y0,z0×100%,where χE is a special function about the set E′ which is defined as follows:(10)χEE′=1,ifE∩E′≠∅,0,ifE∩E′=∅.In addition, in order to get the number of times the trajectoryCn^x0,y0,z0 passes through a particular cube Bi,j,k, we need to calculate the relative times of trajectory Cn^x0,y0,z0 accessing this box relative to n^. Given that n^ is large enough, the approximate probability density function Pn^x,y,z=Pn^Bi,j,k under all conditions 0≤i,j,k≤n−1 and all x,y,z∈Bi,j,k and then(11)Pn^Bi,j,k=1n^∑s=1s=n^χBi,j,kTnt+sx0,y0,z0.In order to define the 3D-PHM system to random, it will be further required that the variables defined above and the invariant measure mathematicians called must be independent of the starting pointx0,y0,z0. Moreover, when the track Cn^x0,y0,z0 is evenly distributed throughout the space, in that way, for all 0≤i,j,k≤n−1, the following formula holds right:(12)μBi,j,k=limn^⟶∞Pn^Bi,j,k=1n3,where μBi,j,k represents the natural Lebesgue metric of Bi,j,k [42].For computing the approximate density function of 3D-PHM, cubeB is divided into n3=1003 boxes. When nt=104 and nt+n^ iterates with mapping (1), n^=s×n3, where s=1,…,30. The control parameter and the initial values are fixed at c=15 and x0,y0,z0=0.1,0.2,0.3. In Figure 5(a), the trajectory Cn^x0,y0,z0 will visit more than 99% cubes Bi,j,k, when n^ exceeds 5×n3. The calculation using mean square error (MSE) is carried out to measure the difference between the values of Pn^Bi,j,k and μBi,j,k. This metric is as follows:(13)MSEPn^−1n3=1n3Pn^−1n32,where ⋅ denotes the Euclidian norm. Obviously, in Figure 5(b), MSE values decrease to zero with the number of iterations n^ increasing, which means the point of the trajectory Cn^x0,y0,z0 is distributed uniformly in the phase space.Figure 5
The results ofPn^ and MSE, where n=100, n^=s×n3, and s=1,2,…,30. (a) The proportion of Pn^; (b) the mean square error MSEPn^−1/n3.
(a)(b)The histogram of the approximate density functionPn^ is displayed in Figure 6(b). It shows a standard normalized distribution perfectly. The series, which is generated by 3D-PHM, is distributed uniformly in the phase space without any concentration in Figure 6(a). It implies strong chaoticity and ergodicity.Figure 6
(a) The approximate density functionPn^ of 3D-PHM. (b) The histogram of the density, wheren=100 and n^=30×n3.
(a)(b)


## 3. The Color Image Encryption Algorithm

To thwart a powerful attack based on statistical analysis, Shannon suggests using confusion and diffusion for encryption [43]. Generally, the security of image encryption technology is defined by shuffling and diffusion. Shuffling is a method to change the positions of pixels in an image. Shuffling can make it difficult to predict the initial positions of an encrypted pixel.The diffusion operation can be implemented by a chaotic map; it can change the behavior of the whole chaotic system through a small change of the chaotic map. The two implementations can be applied to all kinds of pictures.Our proposed scheme also has two major steps.First, the plain image is destroyed by shuffling with 3D-PHM. The second step is to diffuse the shuffled image, which is to reach a high complexity. The block diagram of the proposed scheme is shown in Figure7. The details of the proposed encrypting algorithm are outlined as follows:(1)
Primary Stages. Convert the image with the size of m×n×3 into three monochromatic images, where the size is m×n , namely, PR, PG, and PB, and then each matrix is converted into a vector (1×mn), represented by IR, IG, and IB.(2)
Generate the Initial Conditions. Let the control parameter at c=15 and n0 be large enough and choose an initial pixel x^0,y^0,z^0∈A and calculate the sum of all pixels in every component of the plain image. The formula is as follows:(14)∑R=∑i=1mnIRi,∑G=∑i=1mnIGi,∑B=∑i=1mnIBi.K represents the initial values of the scheme and the formula is as follows:(15)K≡x0,y0,z0=x^0,y^0,z^0+10−8+d×∑R,10−8+d×∑G,10−8+d×∑B.(3)
Generate the Key to Shuffling. Formula (1) of 3D-PHM and the initial condition K are used to generate three real-valued sequences with the length of 1×mn, namely, MR′, MG′, and MB′, where MR′i∈amin=0,amax=1, MG′i∈amin=0,amax=1, and MB′i∈amin=0,amax=1, i=1,…,mn. The interval amin,amax is divided into d+1 subintervals on average, and the length of each interval is h=amax−amin/d+1. What function ϕd does is to map the value of interval amin,amax to the set of integers 0,1,…,d.(16)ϕd:amin,amax⟶0,1,…,d,ϕdx=x−aminhifamin≤x<amax,d,ifx=amax,whered=mn−1, and get the integer key sequence KRi, KGi, and KBi; obviously KRi,KGi,KBi∈0,mn−1.(4)
Shuffle Images. Use Algorithm 1 to generate the shuffled vectors SR, SG, and SB corresponding to the three monochromatic components of the initial plain images IR, IG, and IB.For example, provide thatKR1=345, I1=255, and then SR345+1=I1=255. So generate three shuffled images SR, SG and SB.(5)
Generate the Chaotic Mask Sequence. Use formula (17) to obtain the integer chaotic masks, MR, MG and MB, respectively, where d=255. The formula is as follows:(17)MRi=ϕdMR′iMGi=ϕdMG′iMBi=ϕdMB′i,i=1,2,…,mn.(6)
Diffusion of the Cipher Image. Formulas (18)–(20) are used to obtain three encrypted image integer matrices CR, CG, and CB. For example, for the red component, the pixel sequence of the scrambled image is SRi|i=1,2,…,mn, the chaotic mask series is MRi|i=1,2,…,mn, and the ciphertext is CRi|i=1,2,…,mn. Here, the round n encryption scheme is introduced as follows:(18)CR10=modDR0+MR1,256,CR1i=modSRi+MRi+1,256⊕CR1i−1,CR2i=modCR1i+MRi+1,256⊕CR2i−1,⋮CRni=modCRn−1i+MRi+1,256⊕CRni−1,i=1,2,…,mn,(19)CG10=modDG0+MG1,256,CG1i=modSGi+MGi+1,256⊕CGi−1,CG2i=modCG1i+MGi+1,256⊕CG2i−1,⋮CGni=modCGn−1i+MGi+1,256⊕CGni−1,i=1,2,…,mn,(20)CB10=modDB0+MB1,256,CB1i=modSBi+MBi+1,256⊕CB1i−1,CB2i=modCB1i+MBi+1,256⊕CB2i−1,⋮CBni=modCBn−1i+MBi+1,256⊕CBni−1,i=1,2,…,mn,where DR0,DG0,DB0∈0,255 are the parameters introduced when encrypting the first scrambling pixel, which can be used as the initial key in the encryption and CR1,CG1,CB1;CR2,CG2,CB2;⋯CRn,CGn,CBn are results of the nth round encryption. Generally, n≥2. The relationship among the ciphertext, plaintext (or intermediate ciphertext), and the key not only is XOR but also includes nonlinear module. Thus, the proposed algorithm can resist plaintext attack. Then convert each component into matrices CRn, CGn, and CBn, whose size is m×n. Finally, the color cipher CRGB is combined.Figure 7
The block diagram of encryption algorithm.Algorithm 1: Shuffle images (the red component is selected as research sample).
Input: the integersm and n, and the vectors IR, IG and IBOutput: the shuffled images vectorsSR, SG and SBwhilekR≤mnSR←−1,SR←−1,SR←−1endkR←1, i←1whilekR≤mnif ()SRKRkR+1=−1SRKRkR+1←IRkR;elseSRKRkR+1+i←IRkR;endkR←kR+1; i←i+1;endAlgorithm 2: Deshuffling the images.
Input:MR and MG and MB, SR, SG, and SBOutput:IR, IG and IBInitialize:kr←0, i←1whilekr≤mnifSRKRkR+1≥0IRkR←SRKRkR+1;SRKRkR+1←−1;elsei←KRkR+1;IRkR←SRi;SRi←−1;endkR←kR+1;endDecryption is the inverse of encryption, but decryption starts with the last pixel and goes back to the first. The process of decryption is given as follows:(1)
Splitting the ciphered imageCRGB into three separated components and then converting them into encrypted pixel sequences CR, CG, and CB (1×mn).(2)
Formula (17) is used to obtain the secret key sequences MR, MG, and MB, and formulas (21)–(23) are used to obtain the shuffled sequences SRi, SGi, and SBi when the round number n=2.(21)CR1i=modCR2i⊕CR2i−1−MRi+1,256,SRi=modCR1i⊕CR1i−1−MRi+1,256,i=mn,mn−1,…,1,(22)CG1i=modCG2i⊕CG2i−1−MGi+1,256,SGi=modCG1i⊕CG1i−1−MGi+1,256,i=mn,mn−1,…,1,(23)CB1i=modCB2i⊕CB2i−1−MBi+1,256,SBi=modCB1i⊕CB1i−1−MBi+1,256,i=mn,mn−1,…,1.(3)
Use the vectorsSR, SG, and SB as input with Algorithm 2 to generate the deshuffled vectors IR, IG, and IB.(4)
Obtain pixel sequencesIR, IG, and IB, and combine them into the plain image P.


## 4. Simulation and Experimental Analysis

For all the analysis, the control parametersc1=c2=c=15, the round number n=2, the initial valuex0,y0,z0=0.1,0.2,0.3, and CR0,CG0,CB0=234,15,167. The proposed color image cryptosystem is executed on the standard test image named “Lena” with the size 512×512×3. The ciphertext of the three color components of the color image is shown in Figure 8.Figure 8
Every component of plaintext and its ciphertext. (a) Component R of plaintext; (b) component G of plaintext; (c) component B of plaintext; (d) component R of ciphertext; (e) component G of ciphertext; (f) component B of ciphertext.
(a)(b)(c)(d)(e)(f)In order to demonstrate that the proposed image encryption algorithm is secure against most common attacks, key space and key sensitivity tests are analyzed, and security analyses such as chosen plaintext attack, histogram analysis, correlation of the image, difference measurement, and information entropy are also carried out.


### 4.1. Key Space Analysis

In order to resist brute-force attacks, it is necessary to extend a key space as large as feasible. Generally, the security will be accepted when the key space is greater than2128. The proposed algorithm takes the initial three states of formula (1) as the initial secret keys, expressed by double-precision real type. So the key space is 264×264×264=2192. In addition, DR0,DG0,DB0 can also be the initial key. So the key space of the proposed algorithm is 2216. Therefore, it is sufficiently large to prevent a brute-force attack [35, 44, 45]. The comparison of key space sizes between the proposed scheme and similar works is displayed in Table 2.Table 2
Comparison of key spaces among different schemes.
The number of keysKey space sizeOur cryptosystem62216Reference [44]72130Reference [35]32140Reference [45]82160Reference [46]82280


### 4.2. Key Sensitivity Analysis

A secure image encryption scheme requires a high secret key sensitivity. It means that even a very small change between the initial keys can cause two completely different decrypted images. The plaintext and the ciphertext are shown in Figures9(a) and 9(b). In Figure 9(c), the right decryption is shown and the wrong result is shown in Figure 9(d), where the initial value is K˜=x0+δ,y0,z0 and δ=10−16. It is easy to distinguish that the last image is completely different from the original image. The proposed scheme is sensitive to the key.Figure 9
Decrypting Lena image by two secret keysK=x0,y0,z0 and K˜=x0+δ,y0,z0, where δ=10−16. (a) The original image; (b) encrypted image with K; (c) decrypted image with t K; (d) decrypted image with the wrong key K˜.
(a)(b)(c)(d)


### 4.3. Image Histogram Analysis

For the three color components of RGB images, the graph with the number of pixels at each gray level is histogram. Histogram analyses for the original image and the encrypted image by the proposed scheme are carried out in this paper. Histograms for three components of the original and encrypted images are shown in Figure10. From Figures 10(b), 10(d), and 10(f), the histograms are quite uniform and they are different from the plaintext. It means the that result of the algorithm can resist the known plaintext attack [47].Figure 10
Histogram of every component of RGB (Lena); (a) histogram ofR of plaintext; (b) histogram ofG of plaintext; (c) histogram of B of plaintext; (d) histogram of R of ciphertext; (e) histogram of G of ciphertext; (f) histogram of B of ciphertext.
(a)(b)(c)(d)(e)(f)It is necessary to verify the security of the encrypted image with histogram analysis, but it is not enough. In order to further verify the uniform distribution of the ciphertext, the Chi-square test is applied. It is as follows:(24)χ2=∑i=0255oi−ei2ei,where oi are the occurrence times for every gray level (0 to 255) of the cipher and ei is the mean occurrence frequency of the uniform distribution, which is 1024 in the image with the size of 512×512. For a secure cryptosystem, the values of χ2 in encrypted images must be less than the values of χ2 in plain images. In Table 3, values of χ2 in the plain image are much larger than values of χ2 in the encryption image, which means the security of the proposed algorithm has good encryption effect.Table 3
Values ofχ2 for plain and encrypted Lena images.
χ2RedGreenBlueOriginal image243712.39118826.39335466.77Proposed algorithm300.1914272.8633273.4277


### 4.4. Correlations of Adjacent Pixels

Besides histograms analysis, the correlation between adjacent pixels in the plain and encrypted image is conducted. The correlation coefficientsρ of several adjacent pixel pairs (including horizontal, vertical, and diagonal pixel pairs) which are selected from the image are computed. The formula is as follows: (25)ρ=∑i=1M0xi−x¯yi−y¯∑i=1M0xi−x¯2∑i=1M0yi−y¯2,where xi and yi represent the gray values of two adjacent pixels in the plain and encrypted image and M0 is the number of adjacent pixels pairs selected randomly from the plain or encrypted image. ρ, x¯, and y¯ represent the two means of two adjacent pixels. When ρ⟶1, it will indicate that the adjacent pixels are highly correlated, and when ρ⟶0, it will mean that the adjacent pixels are low correlated.For the correlation analysis experiment, we randomly selected 10000 pairs of adjacent pixels from the plain and encrypted images in horizontal, vertical, and diagonal directions. The experimental results are shown in Figure11, where i,j represents the coordinate of pixels in an image. From Figure 11, the correlation of the plain image is significantly higher than that of the encrypted image.Figure 11
The correlation plots of two adjacent pixels for plaintext and ciphertext. (a) Horizontal correlation of plaintext; (b) vertical correlation of plaintext; (c) diagonal correlation of plaintext; (d) horizontal correlation of ciphertext; (e) vertical correlation of ciphertext; (f) diagonal correlation of ciphertext.
(a)(b)(c)(d)(e)(f)In addition, the correlation coefficientsρ of the original image are computed, which are listed in Table 4. ρ of the original image are close to 1. Otherwise, the encrypted ρ are close to 0. It means that the proposed algorithm removed the correlation between adjacent pixels of the original image. Then, comparisons are conducted among different algorithms in Table 4. The correlation coefficient of the plain image is extremely different from the encrypted image and the former is close to zero. The encrypted ρ of ours is more close to zero than others.Table 4
The correlation coefficients between the proposed method and other algorithms.
Correlation directionDiagonalHorizontalVerticalOriginal image0.95010.96900.9835Proposed algorithm−0.0033−0.0012−0.0027Reference [48]0.00360.00530.0085Reference [49]0.00240.00420.0033Reference [50]—0.06810.0845Reference [51]0.0030−0.00820.0027


### 4.5. The Difference Measurements

The degradation rate of the image after encryption can also prove the encrypted effect of an encryption system. To measure the difference between the original and the encrypted images, we have the two following effective statistical tools.


#### 4.5.1. The Structural Similarity Index

The structural similarity (SSIM) index can indicate the similarity between the two images. The SSIM belongs to−1,1. When the SSIM is 1, it indicates that the two images are completely similar. It is defined by the attribute of the object structure in the reflection scene independent of brightness and contrast, which is from the angle of image composition. The value of SSIM is composed of brightness, contrast, and structure of images. Mean values are used by estimating the brightness, and the standard deviation is used by estimating the contrast, and the covariance is used by measuring the similarity of the structure. The formula used to calculate SSIM of two images is as follows: (26)SSIMX,Y=2uXuY+C12σXY+C1uX2+uY2+C1σX2+σY2+C2,where uX and uY represent the means of gray pixels in two images; σX and σY are the standard deviations of the two images; σX2 and σY2 are the variances of the two images; σXY represents the covariance of the two images; C1 and C2 are two constants, where C1=K1×L and C2=K2×L. Generally, K1=0.01, K2=0.03, and L=255. The SSIM of different encryption schemes are listed in Table 5. The SSIM between the original image and other encrypted schemes of “Lena” approach zero. Compared with others, the proposed algorithm has higher superiority.Table 5
SSIM between the plain and other encrypted images.
AlgorithmSSIMAverage SSIMRedGreenBlueProposed algorithm0.0100500.0091410.0101040.009765Reference [52]0.01940.04480.044750.0372Reference [53]———0.3795Reference [54]———0.0425


#### 4.5.2. Peak Signal-to-Noise Ratio Analysis

Peak signal-to-noise ratio (PSNR) is the most common and widely used objective evaluation index of images. For a perfect image encryption scheme, the smaller values of the PSNR are (generally, less than 10), the better schemes are. The calculation is as follows:(27)MSE=1mn∑i,jCi,j−Ii,j2,PSNR=10log10L2MSE,where MSE is the mean square error of an image; Ci,j is a pixel of the encrypted image and Ii,j is a pixel of the original image, the coordinate of which is i,j; L is the range of pixel in the image. We calculated PSNR of each color component of the encrypted image (Lena) and found that it was less than 10. Values of PSNR of this encryption scheme are compared with the results of other schemes; see Table 6. From the comparison in Table 6, we can see that the results of PSNR of this scheme are better than those of other existing algorithms.Table 6
PSNR results between the proposed algorithm and other algorithms (Lena).
AlgorithmsPSNRAverage PSNRRedGreenBlueProposed algorithm7.84158.58909.59958.6767Reference [55]———10.8314Reference [56]———9.5513Reference [57]7.81608.60709.64048.6877Reference [58]———9.2322


### 4.6. Analysis of Antidifferential Attack

In the encryption algorithm, diffusion is an important property, which was proposed by Shannon in [43]. A good encryption system must have good diffusivity. It means that one pixel in the original image is changed, and the encrypted image will be changed completely in an unpredictable way.The important significance of the diffusion depends on how complex the algorithm is, which can resist the analysis of the algorithm by the attacker. The number of pixel change rate (NPCR) is usually used to test the effect of changing a pixel in the encrypted scheme, which calculates the percentage of two different image pixels.The average intensity of the two images is tested by UACI. Here,C1 and C2 are two cipher images whose corresponding plain images have only one pixel difference. Di,j is defined as (28)Di,j=0,C1i,j=C2i,j,1,C1i,j≠C2i,j,NPCR=∑i=1m∑j=1nDi,jmn,and UACI is defined as (29)UACI=∑i=1m∑j=1nC1i,j−C2i,j255×m×n,where m and n are rows and columns of the image, respectively. Ideally, the means of NPCR and UACI are NPCR=1−2−n×100% and UACI=1/22n∑i=12n−1ii+1/2n−1100%. For grayscale image with 256 levels, n=8. The expected values of NPCR and UACI are NPCRE=99.6094070 and UACIE=33.463507, respectively.In the experiment, 100 group pixels of Lena image were selected for encryption. Every group has two images. One is the original image, and the other is image with one pixel changed, which is an image where one pixel is changed randomly in the original image. The results of NPCR and UACI are shown in Figures12 and 13. Results of the proposed algorithm are distributed near the ideal value (horizontal lines in the figure). The mean values of NPCR and UACI in the proposed scheme are 99.6214% and 33.4149%, respectively, which are very close to the ideal values.Figure 12
Test results of NPCR (N is the test group label).Figure 13
Test results of UACI (N is the test group label).The comparison with other algorithms is shown in Table7. The results show that the proposed algorithm can resist plaintext attack, ciphertext attack, and known plaintext attack well, and it is also superior to other algorithms. The reason is, in other schemes, the ciphertext diffusion effect of the algorithm works only in one round of pixel substitution, in which the change of any one pixel in plaintext can only affect the ciphertext behind the changed pixel. In this paper, two or more rounds of diffusion are carried out. Therefore, each pixel in the encrypted image will be affected.Table 7
NPCR and UACI results between the proposed algorithm and other schemes (Lena).
AlgorithmsNPCRUACIProposed algorithm0.99620.3341Reference [59]0.99360.3272Reference [60]0.99610.3346Reference [36]0.99600.3347


### 4.7. Analysis of Chosen Plaintext Attack

The ability of a scheme to resist the chosen plaintext attack should be tested in the following way. The formula is as follows [61]:(30)O1i,j⊕O2i,j=E1i,j⊕E2i,j,where O1 and O2 are two plain images and E1 and E2 are two encrypted images which are encrypted by the same plain images. When the equation holds right, the algorithm will be highly vulnerable to chosen plaintext attack. Figure 14(a) indicates E1⊕E2 (XOR operation to the encrypted images of Lena and baboon), and Figure 14(b) indicates O1⊕O2 (XOR operation to the plain images of Lena and baboon). Obviously, Figures 14(a) and 14(b) are completely different, indicating that the equation is not tenable. Therefore, the algorithm can resist chosen plaintext attack.Figure 14
The result of chosen plaintext attack analysis: (a)E1⊕E2; (b)O1⊕O2.
(a)(b)


### 4.8. Analysis of Plaintext Attacks

In many methods of cryptanalysis, attackers try to identify the relationship between plaintext and ciphertext by searching ways to reduce the key space or the equivalent key space. This kind of attack usually uses white or black pixels to generate ciphertext by the proposed algorithm. Then the key is inferred from the corresponding ciphertext image. In order to resist this attack, this encryption scheme should eliminate any relationship between ciphertext and plaintext.The proposed scheme, even if a specific plaintext is selected, such as black and white images, cannot generate recognizable patterns. It is because the encryption algorithm not only depends on the change of pixel position but also depends on the high complexity of the novel chaotic and good multiple diffusion characteristics of the encryption algorithm. Especially when the algorithm is used to encrypt adjacent columns/rows, the adjacent pixels will have little correlation.The results of our proposed algorithm are depicted in Figure15. The size of the white and black images is 512×512. They are encrypted by the proposed algorithm. From Figures 15(b) and 15(d), the encrypted images are different from the original images. Then, our proposed encryption algorithm can resist the known plaintext attack.Figure 15
Results of the black and white images by the proposed algorithm. (a) Black plaintext; (b) black ciphertext; (c) white plaintext; (d) white ciphertext.
(a)(b)(c)(d)


### 4.9. Analysis of Noise Attack

#### 4.9.1. Analysis of Pepper and Salt Noise Attack

The ability of the encryption system to resist noise attack is tested by adding salt and pepper noise with different intensities when encrypting the image. Figure16 shows the decrypted images where densities of 0.05 and 0.1 are added, respectively. The decrypted images become slightly blurred, but the contents of the images can still be recognized.Figure 16
The decryption image with different densities of salt and pepper noise. (a) 0.05 and (b) 0.1.
(a)(b)


#### 4.9.2. Analysis of Gaussian Noise

The Gaussian noise with variance of 0.01 and zero mean was added to the encryption process, and the result is shown in Figure17(a). Take the Gaussian noise with variance of 0.5 and zero mean, and the result is shown in Figure 17(b). Although the decrypted image is still fuzzy, it can still distinguish the basic image content. It illustrates that the proposed algorithm can resist the Gaussian noise.Figure 17
The decryption image of the plain image by adding different variance Gaussian noise.
(a)(b)


### 4.10. Information Entropy

Information entropy (EN) can describe the complexity, which can quantify the randomness of a chaotic system. Lets represent a source of information, and the entropy Hs can be calculated by (31)Hs=−∑i=02n−1Psilog2Psi,where Psi is the probability of the symbol si which can appear in the chaotic system. For a random signal consisting of 2n symbols, Hs is equal to 8. The information entropy value of the proposed scheme is calculated. The results between the proposed algorithm and other schemes are shown in Table 8 and our values are 7.9984, 7.9982, and 7.9979, respectively, which are higher than others, ensuring that our scheme is more complex.Table 8
The results of information entropy.
MethodsInformation entropyRedGreenBlueAverageOur proposed algorithm7.99847.99827.99837.9983Reference [62]7.98687.98807.98847.9877Reference [50]———7.9971


### 4.11. Computational Complexity and Speed Test

The computational complexity of algorithms is often used to describe the execution time of programs or the space occupied by algorithms in memory or disk. It is often represented by symbolO.The functionTn represents the time of an algorithm (or the number of steps), where n is the size of the problem to be solved and n↦gn. Theoretically, the function Tn=Ogn. It means that there is a positive constant δ which makes 0≤Tn≤δgn. Given that the size of the image is m×n, the times of scrambling statements are m×n during the image encryption. Take two rounds as an example; the times of the diffusion statement are 2m×n. The times of decrypted statement are the same as those of the encryption. So, we can write the expression as Tn=Omn. Therefore, the complexity of the algorithm is Omn. Thus, the proposed algorithm can resist different cryptographic analysis.The speed of every scheme is shown in Table9. We implement our scheme and other schemes using Matlab R2016b on an Intel Core i5-4590 @ 3.30 GHz Processor, 4 GB RAM, and Windows 10 operating system. Compared with DES, AES, and logistic mapping encryption scheme, our chaotic encrypted algorithm is more quick than traditional ones.Table 9
Encrypted speed of each scheme.
ImageDES time (s)AES time (s)Logistic map time (s)Our proposed time (s)Lena512×5122.396940.900370.763210.68795Baboon256×2560.880760.461583.5478e − 0022.4457e − 002House128×1280.451230.254871.2347e − 0020.4567e − 002


## 4.1. Key Space Analysis

In order to resist brute-force attacks, it is necessary to extend a key space as large as feasible. Generally, the security will be accepted when the key space is greater than2128. The proposed algorithm takes the initial three states of formula (1) as the initial secret keys, expressed by double-precision real type. So the key space is 264×264×264=2192. In addition, DR0,DG0,DB0 can also be the initial key. So the key space of the proposed algorithm is 2216. Therefore, it is sufficiently large to prevent a brute-force attack [35, 44, 45]. The comparison of key space sizes between the proposed scheme and similar works is displayed in Table 2.Table 2
Comparison of key spaces among different schemes.
The number of keysKey space sizeOur cryptosystem62216Reference [44]72130Reference [35]32140Reference [45]82160Reference [46]82280


## 4.2. Key Sensitivity Analysis

A secure image encryption scheme requires a high secret key sensitivity. It means that even a very small change between the initial keys can cause two completely different decrypted images. The plaintext and the ciphertext are shown in Figures9(a) and 9(b). In Figure 9(c), the right decryption is shown and the wrong result is shown in Figure 9(d), where the initial value is K˜=x0+δ,y0,z0 and δ=10−16. It is easy to distinguish that the last image is completely different from the original image. The proposed scheme is sensitive to the key.Figure 9
Decrypting Lena image by two secret keysK=x0,y0,z0 and K˜=x0+δ,y0,z0, where δ=10−16. (a) The original image; (b) encrypted image with K; (c) decrypted image with t K; (d) decrypted image with the wrong key K˜.
(a)(b)(c)(d)


## 4.3. Image Histogram Analysis

For the three color components of RGB images, the graph with the number of pixels at each gray level is histogram. Histogram analyses for the original image and the encrypted image by the proposed scheme are carried out in this paper. Histograms for three components of the original and encrypted images are shown in Figure10. From Figures 10(b), 10(d), and 10(f), the histograms are quite uniform and they are different from the plaintext. It means the that result of the algorithm can resist the known plaintext attack [47].Figure 10
Histogram of every component of RGB (Lena); (a) histogram ofR of plaintext; (b) histogram ofG of plaintext; (c) histogram of B of plaintext; (d) histogram of R of ciphertext; (e) histogram of G of ciphertext; (f) histogram of B of ciphertext.
(a)(b)(c)(d)(e)(f)It is necessary to verify the security of the encrypted image with histogram analysis, but it is not enough. In order to further verify the uniform distribution of the ciphertext, the Chi-square test is applied. It is as follows:(24)χ2=∑i=0255oi−ei2ei,where oi are the occurrence times for every gray level (0 to 255) of the cipher and ei is the mean occurrence frequency of the uniform distribution, which is 1024 in the image with the size of 512×512. For a secure cryptosystem, the values of χ2 in encrypted images must be less than the values of χ2 in plain images. In Table 3, values of χ2 in the plain image are much larger than values of χ2 in the encryption image, which means the security of the proposed algorithm has good encryption effect.Table 3
Values ofχ2 for plain and encrypted Lena images.
χ2RedGreenBlueOriginal image243712.39118826.39335466.77Proposed algorithm300.1914272.8633273.4277


## 4.4. Correlations of Adjacent Pixels

Besides histograms analysis, the correlation between adjacent pixels in the plain and encrypted image is conducted. The correlation coefficientsρ of several adjacent pixel pairs (including horizontal, vertical, and diagonal pixel pairs) which are selected from the image are computed. The formula is as follows: (25)ρ=∑i=1M0xi−x¯yi−y¯∑i=1M0xi−x¯2∑i=1M0yi−y¯2,where xi and yi represent the gray values of two adjacent pixels in the plain and encrypted image and M0 is the number of adjacent pixels pairs selected randomly from the plain or encrypted image. ρ, x¯, and y¯ represent the two means of two adjacent pixels. When ρ⟶1, it will indicate that the adjacent pixels are highly correlated, and when ρ⟶0, it will mean that the adjacent pixels are low correlated.For the correlation analysis experiment, we randomly selected 10000 pairs of adjacent pixels from the plain and encrypted images in horizontal, vertical, and diagonal directions. The experimental results are shown in Figure11, where i,j represents the coordinate of pixels in an image. From Figure 11, the correlation of the plain image is significantly higher than that of the encrypted image.Figure 11
The correlation plots of two adjacent pixels for plaintext and ciphertext. (a) Horizontal correlation of plaintext; (b) vertical correlation of plaintext; (c) diagonal correlation of plaintext; (d) horizontal correlation of ciphertext; (e) vertical correlation of ciphertext; (f) diagonal correlation of ciphertext.
(a)(b)(c)(d)(e)(f)In addition, the correlation coefficientsρ of the original image are computed, which are listed in Table 4. ρ of the original image are close to 1. Otherwise, the encrypted ρ are close to 0. It means that the proposed algorithm removed the correlation between adjacent pixels of the original image. Then, comparisons are conducted among different algorithms in Table 4. The correlation coefficient of the plain image is extremely different from the encrypted image and the former is close to zero. The encrypted ρ of ours is more close to zero than others.Table 4
The correlation coefficients between the proposed method and other algorithms.
Correlation directionDiagonalHorizontalVerticalOriginal image0.95010.96900.9835Proposed algorithm−0.0033−0.0012−0.0027Reference [48]0.00360.00530.0085Reference [49]0.00240.00420.0033Reference [50]—0.06810.0845Reference [51]0.0030−0.00820.0027


## 4.5. The Difference Measurements

The degradation rate of the image after encryption can also prove the encrypted effect of an encryption system. To measure the difference between the original and the encrypted images, we have the two following effective statistical tools.


### 4.5.1. The Structural Similarity Index

The structural similarity (SSIM) index can indicate the similarity between the two images. The SSIM belongs to−1,1. When the SSIM is 1, it indicates that the two images are completely similar. It is defined by the attribute of the object structure in the reflection scene independent of brightness and contrast, which is from the angle of image composition. The value of SSIM is composed of brightness, contrast, and structure of images. Mean values are used by estimating the brightness, and the standard deviation is used by estimating the contrast, and the covariance is used by measuring the similarity of the structure. The formula used to calculate SSIM of two images is as follows: (26)SSIMX,Y=2uXuY+C12σXY+C1uX2+uY2+C1σX2+σY2+C2,where uX and uY represent the means of gray pixels in two images; σX and σY are the standard deviations of the two images; σX2 and σY2 are the variances of the two images; σXY represents the covariance of the two images; C1 and C2 are two constants, where C1=K1×L and C2=K2×L. Generally, K1=0.01, K2=0.03, and L=255. The SSIM of different encryption schemes are listed in Table 5. The SSIM between the original image and other encrypted schemes of “Lena” approach zero. Compared with others, the proposed algorithm has higher superiority.Table 5
SSIM between the plain and other encrypted images.
AlgorithmSSIMAverage SSIMRedGreenBlueProposed algorithm0.0100500.0091410.0101040.009765Reference [52]0.01940.04480.044750.0372Reference [53]———0.3795Reference [54]———0.0425


### 4.5.2. Peak Signal-to-Noise Ratio Analysis

Peak signal-to-noise ratio (PSNR) is the most common and widely used objective evaluation index of images. For a perfect image encryption scheme, the smaller values of the PSNR are (generally, less than 10), the better schemes are. The calculation is as follows:(27)MSE=1mn∑i,jCi,j−Ii,j2,PSNR=10log10L2MSE,where MSE is the mean square error of an image; Ci,j is a pixel of the encrypted image and Ii,j is a pixel of the original image, the coordinate of which is i,j; L is the range of pixel in the image. We calculated PSNR of each color component of the encrypted image (Lena) and found that it was less than 10. Values of PSNR of this encryption scheme are compared with the results of other schemes; see Table 6. From the comparison in Table 6, we can see that the results of PSNR of this scheme are better than those of other existing algorithms.Table 6
PSNR results between the proposed algorithm and other algorithms (Lena).
AlgorithmsPSNRAverage PSNRRedGreenBlueProposed algorithm7.84158.58909.59958.6767Reference [55]———10.8314Reference [56]———9.5513Reference [57]7.81608.60709.64048.6877Reference [58]———9.2322


## 4.5.1. The Structural Similarity Index

The structural similarity (SSIM) index can indicate the similarity between the two images. The SSIM belongs to−1,1. When the SSIM is 1, it indicates that the two images are completely similar. It is defined by the attribute of the object structure in the reflection scene independent of brightness and contrast, which is from the angle of image composition. The value of SSIM is composed of brightness, contrast, and structure of images. Mean values are used by estimating the brightness, and the standard deviation is used by estimating the contrast, and the covariance is used by measuring the similarity of the structure. The formula used to calculate SSIM of two images is as follows: (26)SSIMX,Y=2uXuY+C12σXY+C1uX2+uY2+C1σX2+σY2+C2,where uX and uY represent the means of gray pixels in two images; σX and σY are the standard deviations of the two images; σX2 and σY2 are the variances of the two images; σXY represents the covariance of the two images; C1 and C2 are two constants, where C1=K1×L and C2=K2×L. Generally, K1=0.01, K2=0.03, and L=255. The SSIM of different encryption schemes are listed in Table 5. The SSIM between the original image and other encrypted schemes of “Lena” approach zero. Compared with others, the proposed algorithm has higher superiority.Table 5
SSIM between the plain and other encrypted images.
AlgorithmSSIMAverage SSIMRedGreenBlueProposed algorithm0.0100500.0091410.0101040.009765Reference [52]0.01940.04480.044750.0372Reference [53]———0.3795Reference [54]———0.0425


## 4.5.2. Peak Signal-to-Noise Ratio Analysis

Peak signal-to-noise ratio (PSNR) is the most common and widely used objective evaluation index of images. For a perfect image encryption scheme, the smaller values of the PSNR are (generally, less than 10), the better schemes are. The calculation is as follows:(27)MSE=1mn∑i,jCi,j−Ii,j2,PSNR=10log10L2MSE,where MSE is the mean square error of an image; Ci,j is a pixel of the encrypted image and Ii,j is a pixel of the original image, the coordinate of which is i,j; L is the range of pixel in the image. We calculated PSNR of each color component of the encrypted image (Lena) and found that it was less than 10. Values of PSNR of this encryption scheme are compared with the results of other schemes; see Table 6. From the comparison in Table 6, we can see that the results of PSNR of this scheme are better than those of other existing algorithms.Table 6
PSNR results between the proposed algorithm and other algorithms (Lena).
AlgorithmsPSNRAverage PSNRRedGreenBlueProposed algorithm7.84158.58909.59958.6767Reference [55]———10.8314Reference [56]———9.5513Reference [57]7.81608.60709.64048.6877Reference [58]———9.2322


## 4.6. Analysis of Antidifferential Attack

In the encryption algorithm, diffusion is an important property, which was proposed by Shannon in [43]. A good encryption system must have good diffusivity. It means that one pixel in the original image is changed, and the encrypted image will be changed completely in an unpredictable way.The important significance of the diffusion depends on how complex the algorithm is, which can resist the analysis of the algorithm by the attacker. The number of pixel change rate (NPCR) is usually used to test the effect of changing a pixel in the encrypted scheme, which calculates the percentage of two different image pixels.The average intensity of the two images is tested by UACI. Here,C1 and C2 are two cipher images whose corresponding plain images have only one pixel difference. Di,j is defined as (28)Di,j=0,C1i,j=C2i,j,1,C1i,j≠C2i,j,NPCR=∑i=1m∑j=1nDi,jmn,and UACI is defined as (29)UACI=∑i=1m∑j=1nC1i,j−C2i,j255×m×n,where m and n are rows and columns of the image, respectively. Ideally, the means of NPCR and UACI are NPCR=1−2−n×100% and UACI=1/22n∑i=12n−1ii+1/2n−1100%. For grayscale image with 256 levels, n=8. The expected values of NPCR and UACI are NPCRE=99.6094070 and UACIE=33.463507, respectively.In the experiment, 100 group pixels of Lena image were selected for encryption. Every group has two images. One is the original image, and the other is image with one pixel changed, which is an image where one pixel is changed randomly in the original image. The results of NPCR and UACI are shown in Figures12 and 13. Results of the proposed algorithm are distributed near the ideal value (horizontal lines in the figure). The mean values of NPCR and UACI in the proposed scheme are 99.6214% and 33.4149%, respectively, which are very close to the ideal values.Figure 12
Test results of NPCR (N is the test group label).Figure 13
Test results of UACI (N is the test group label).The comparison with other algorithms is shown in Table7. The results show that the proposed algorithm can resist plaintext attack, ciphertext attack, and known plaintext attack well, and it is also superior to other algorithms. The reason is, in other schemes, the ciphertext diffusion effect of the algorithm works only in one round of pixel substitution, in which the change of any one pixel in plaintext can only affect the ciphertext behind the changed pixel. In this paper, two or more rounds of diffusion are carried out. Therefore, each pixel in the encrypted image will be affected.Table 7
NPCR and UACI results between the proposed algorithm and other schemes (Lena).
AlgorithmsNPCRUACIProposed algorithm0.99620.3341Reference [59]0.99360.3272Reference [60]0.99610.3346Reference [36]0.99600.3347


## 4.7. Analysis of Chosen Plaintext Attack

The ability of a scheme to resist the chosen plaintext attack should be tested in the following way. The formula is as follows [61]:(30)O1i,j⊕O2i,j=E1i,j⊕E2i,j,where O1 and O2 are two plain images and E1 and E2 are two encrypted images which are encrypted by the same plain images. When the equation holds right, the algorithm will be highly vulnerable to chosen plaintext attack. Figure 14(a) indicates E1⊕E2 (XOR operation to the encrypted images of Lena and baboon), and Figure 14(b) indicates O1⊕O2 (XOR operation to the plain images of Lena and baboon). Obviously, Figures 14(a) and 14(b) are completely different, indicating that the equation is not tenable. Therefore, the algorithm can resist chosen plaintext attack.Figure 14
The result of chosen plaintext attack analysis: (a)E1⊕E2; (b)O1⊕O2.
(a)(b)


## 4.8. Analysis of Plaintext Attacks

In many methods of cryptanalysis, attackers try to identify the relationship between plaintext and ciphertext by searching ways to reduce the key space or the equivalent key space. This kind of attack usually uses white or black pixels to generate ciphertext by the proposed algorithm. Then the key is inferred from the corresponding ciphertext image. In order to resist this attack, this encryption scheme should eliminate any relationship between ciphertext and plaintext.The proposed scheme, even if a specific plaintext is selected, such as black and white images, cannot generate recognizable patterns. It is because the encryption algorithm not only depends on the change of pixel position but also depends on the high complexity of the novel chaotic and good multiple diffusion characteristics of the encryption algorithm. Especially when the algorithm is used to encrypt adjacent columns/rows, the adjacent pixels will have little correlation.The results of our proposed algorithm are depicted in Figure15. The size of the white and black images is 512×512. They are encrypted by the proposed algorithm. From Figures 15(b) and 15(d), the encrypted images are different from the original images. Then, our proposed encryption algorithm can resist the known plaintext attack.Figure 15
Results of the black and white images by the proposed algorithm. (a) Black plaintext; (b) black ciphertext; (c) white plaintext; (d) white ciphertext.
(a)(b)(c)(d)


## 4.9. Analysis of Noise Attack

### 4.9.1. Analysis of Pepper and Salt Noise Attack

The ability of the encryption system to resist noise attack is tested by adding salt and pepper noise with different intensities when encrypting the image. Figure16 shows the decrypted images where densities of 0.05 and 0.1 are added, respectively. The decrypted images become slightly blurred, but the contents of the images can still be recognized.Figure 16
The decryption image with different densities of salt and pepper noise. (a) 0.05 and (b) 0.1.
(a)(b)


### 4.9.2. Analysis of Gaussian Noise

The Gaussian noise with variance of 0.01 and zero mean was added to the encryption process, and the result is shown in Figure17(a). Take the Gaussian noise with variance of 0.5 and zero mean, and the result is shown in Figure 17(b). Although the decrypted image is still fuzzy, it can still distinguish the basic image content. It illustrates that the proposed algorithm can resist the Gaussian noise.Figure 17
The decryption image of the plain image by adding different variance Gaussian noise.
(a)(b)


## 4.9.1. Analysis of Pepper and Salt Noise Attack

The ability of the encryption system to resist noise attack is tested by adding salt and pepper noise with different intensities when encrypting the image. Figure16 shows the decrypted images where densities of 0.05 and 0.1 are added, respectively. The decrypted images become slightly blurred, but the contents of the images can still be recognized.Figure 16
The decryption image with different densities of salt and pepper noise. (a) 0.05 and (b) 0.1.
(a)(b)


## 4.9.2. Analysis of Gaussian Noise

The Gaussian noise with variance of 0.01 and zero mean was added to the encryption process, and the result is shown in Figure17(a). Take the Gaussian noise with variance of 0.5 and zero mean, and the result is shown in Figure 17(b). Although the decrypted image is still fuzzy, it can still distinguish the basic image content. It illustrates that the proposed algorithm can resist the Gaussian noise.Figure 17
The decryption image of the plain image by adding different variance Gaussian noise.
(a)(b)


## 4.10. Information Entropy

Information entropy (EN) can describe the complexity, which can quantify the randomness of a chaotic system. Lets represent a source of information, and the entropy Hs can be calculated by (31)Hs=−∑i=02n−1Psilog2Psi,where Psi is the probability of the symbol si which can appear in the chaotic system. For a random signal consisting of 2n symbols, Hs is equal to 8. The information entropy value of the proposed scheme is calculated. The results between the proposed algorithm and other schemes are shown in Table 8 and our values are 7.9984, 7.9982, and 7.9979, respectively, which are higher than others, ensuring that our scheme is more complex.Table 8
The results of information entropy.
MethodsInformation entropyRedGreenBlueAverageOur proposed algorithm7.99847.99827.99837.9983Reference [62]7.98687.98807.98847.9877Reference [50]———7.9971


## 4.11. Computational Complexity and Speed Test

The computational complexity of algorithms is often used to describe the execution time of programs or the space occupied by algorithms in memory or disk. It is often represented by symbolO.The functionTn represents the time of an algorithm (or the number of steps), where n is the size of the problem to be solved and n↦gn. Theoretically, the function Tn=Ogn. It means that there is a positive constant δ which makes 0≤Tn≤δgn. Given that the size of the image is m×n, the times of scrambling statements are m×n during the image encryption. Take two rounds as an example; the times of the diffusion statement are 2m×n. The times of decrypted statement are the same as those of the encryption. So, we can write the expression as Tn=Omn. Therefore, the complexity of the algorithm is Omn. Thus, the proposed algorithm can resist different cryptographic analysis.The speed of every scheme is shown in Table9. We implement our scheme and other schemes using Matlab R2016b on an Intel Core i5-4590 @ 3.30 GHz Processor, 4 GB RAM, and Windows 10 operating system. Compared with DES, AES, and logistic mapping encryption scheme, our chaotic encrypted algorithm is more quick than traditional ones.Table 9
Encrypted speed of each scheme.
ImageDES time (s)AES time (s)Logistic map time (s)Our proposed time (s)Lena512×5122.396940.900370.763210.68795Baboon256×2560.880760.461583.5478e − 0022.4457e − 002House128×1280.451230.254871.2347e − 0020.4567e − 002


## 5. Conclusion

This paper has proposed a new color image encryption based on 3D-PHM. 3D-PHM shows better chaotic complexity and performance than the original mappings. It enlarges the dimensions of Henon mapping and the complexity of low-dimensional chaotic mapping is increased, and the method can also be applied to other low-dimensional chaotic mappings. At the same time, the parameter range of 3D-PHM is also enlarged, which increases the key space of the original mapping. Based on the new chaotic mapping, this paper proposes the color image encryption scheme, which is associated with the key, plaintext, and intermediate ciphertext. Security and performance evaluation shows that the proposed cipher has various desirable characteristics such as efficiency, flexibility, and resistance against cryptanalytic attacks.



---

*Source: 3837209-2020-12-23.xml*