# An Effective Framework for Chaotic Image Encryption Based on 3D Logistic Map

Authors: Guodong Ye; Kaixin Jiao; Chen Pan; Xiaoling Huang
Journal: Security and Communication Networks
 (2018)

---

## Abstract

In this paper, an effective framework for chaotic encryption based on a three-dimensional logistic map is presented together with secure hash algorithm-3 (SHA-3) and electrocardiograph (ECG) signal. Following the analysis of the drawbacks, namely, fixed key and low sensitivity, of some current algorithms, this work tries to solve these two problems and includes two contributions:(1) removal of the phenomenon of summation invariance in a plain-image, for which SHA-3 is proposed to calculate the hash value for the plain-image, with the results being employed to influence the initial keys for chaotic map; (2) resolution of the problem of fixed key by using an ECG signal, that can be different for different subjects or different for same subject at different times. The Wolf algorithm is employed to produce all the control parameters and initial keys in the proposed encryption method. It is believed that combining with the classical architecture of permutation-diffusion, the summation invariance in the plain-image and shortcoming of a fixed key will be avoided in our algorithm. Furthermore, the experimental results and security analysis show that the proposed encryption algorithm can achieve confidentiality.


---

## Body

## 1. Introduction

In recent years, there has been a rapid development of multimedia including video, images, and audio. Computer science and network technology also promote the wide use of digital information. Among these categories of multimedia, images as an effective way to understand the colors play an important role in our daily life. However, because of illegal wiretapping, revision, or interception, there is an apparent lack of security for communicating images over the network, particularly some private images such as medical and military image. Structurally, cryptography is categorized into two classes [1, 2], namely, symmetric cryptography and asymmetric cryptography. It has supplied numerous effective ciphers for user information, particularly in the form of textual content. Owing to less computation requirement and high efficiency, we prefer symmetric cryptosystems in coding.An image has some inherent characteristics and is different from textual content, for example, enormous data, high correlation, long redundancy, and bulk data capacity. Therefore, traditional methods such as advanced encryption standard (AES), data encryption standard (DES), or international data encryption algorithm (IDEA) are not effective options for image encryption [3, 4]. Chaos-based methods have recently become attractive for protecting image content. We can employ their superior properties such as control parameter, sensitivity to the initial condition, and nonconvergence in a chaotic system (or map). Numerous image encryption algorithms using chaos have been proposed [5–7], and their efficiency has been partially exhibited. Normally, two processes are adopted by the current image encryption algorithms: pixel permutation and pixel diffusion. First, to reduce the high correlation existing between adjacent pixels, permutation to the pixel positions is considered, for example, Arnold map transformation [8, 9]. However, the exchange of pixel positions alone cannot ensure security because of the nonvariance of the gray distribution in a plain-image. Thus, pixel diffusion is performed as a second step to reformulate the statistical distribution for pixels. It is more important to make a minor change in the plain-image such that it results in an entirely different cipher-image, i.e., realizing an avalanche effect. Compressive sensing was also introduced into the encryption process, and it exhibits a good effect [10].As early as 1989, Matthews [11] proved that a chaotic sequence of random numbers can be obtained from a simple nonlinear iterative function and applied it for cryptographic use. In [12], the authors presented a symmetrical image encryption algorithm using a one-dimensional (1D) skew tent map, in which a bit-level permutation for pixels was employed. Instead of byte-permutation, a structure of diffusion layer followed by a bit-permutation layer was proposed by El Assad and Farajallah [13]. Although bit-level permutation operation can introduce double diffusion effects, it also leads to a longer time consumption. Logistic map is simple and widely used in performing image encryption with less computation [14]. However, it was shown to have some drawbacks such as a small key and weak security. To overcome these disadvantages of logistic map, Wang and Luan [15] proposed a three dimensional (3D) coupled logistic map. Additionally, various new and improved encryption schemes for images have been reported [16–18], which drives the development of chaos-based encryption methods. Chai et al. [19] proposed a new encryption scheme to resist common attacks using DNA sequence. This scheme is very sensitive to the plain-image after applying secure hash algorithm- (SHA-) 256. However, the time cost will be high because of the exchange between the decimal and binary systems. The same problem can be seen in DNA-based method [20]. In [21], a new hyper-chaos based algorithm has been proposed for image encryption. It computed a larger Lyapunov exponent in the new chaotic system. However, it did not consider the summation invariance in the plain-image. A plaintext-related image encryption system was designed in [22], which also employed a hyper-chaotic system to generate a random sequence. Although this system exhibits a good performance, it only uses fixed secret keys.Unfavorably, various image encryption algorithms provide a low security. For example, Fu et al. [23] proposed a bit-level permutation scheme to encrypt an image, in which the diffusion effect can be achieved by a two-stage process of bit-level shuffling function using an Arnold map and chaotic sequences. Compared with some other image encryption algorithms with a permutation-diffusion structure, the algorithm has less computational complexity. However, Jolfaei et al. [24] pointed out that a permutation-only scheme for image encryption can be broken if a chosen-plaintext attack is applied. For a plain-image of size m×n, the number of plain-images required to be chosen is logL(mn) (where L is the number of different color intensities). One cycle of permutation-diffusion architecture was suggested in [25] for image encryption; the row and column permutations were used in the first stage, and an affine cipher was applied to modify the gray values in the diffusion stage. However, by a strategy of divide-and-conquer [26], a chosen-plaintext can efficiently attack this algorithm having a complex linear relation. In addition, there are numerous other cryptanalysis methods [27–30].After conducting a detail analysis of the breaking methods, it can be concluded that the drawbacks of the image encryption algorithms are follows:(1) permutation-only structure, (2) diffusion-only structure, (3) one cycle of permutation-diffusion architecture, (4) key-dependence, and (5) fixed keys. To overcome these limitations, a new image encryption model employing both electrocardiograph (ECG) signals and SHA-3 is proposed in this paper. In this model, an ECG signal is used as the initial condition for the chaotic map to handle the fixed key problem. Next, the hash values are extracted from a plain-image by the SHA-3 function and are employed to update the initial keys, which can avoid key-dependence problem. Similar to the entire algorithm, more than one cycle of the permutation-diffusion operation is considered before obtaining the final cipher-image. Moreover, compared with some recent references, the proposed method has numerous advantages. For example, in reference [3], an image encryption algorithm based on a two-dimensional (2D) chaotic map is presented. However, the keystream used in the encryption process is not related to the plain-image. Thus, secret keys x and y are fixed without considering the different plain-images. A hyperchaotic Rössler map was employed in [31] to design a confusion-permutation-based image encryption algorithm, in which x1(0), x2(0), and x3(0) are the keys. However, keystreams Sren, Scol (for permutation), and Mcc (for diffusion) are the same for any plain-image of the same size. A new encryption method with a confusion-diffusion structure for the confidentiality and privacy of clinical information has been proposed by [32]. A 1D logistic map was used to generate the chaotic sequence. However, it suffers from numerous shortcomings, for example, small secret key space, nonuniform chaotic data distribution, and discontinuous chaotic ranges. Furthermore, sequences P and D used in [32] are also fixed for different ECG signals (original message) of the same length. In [33], a 3D chaotic system was adopted to generate random numbers. However, x and z for the S-box generation algorithm and y for the bit exclusive OR (XOR) are obtained only from the fixed keys. A plain-image-based keystream generation was proposed in [34], in which pixel summation AKR,G,B for the pixels were computed to affect the secret keys. However, if we modify two pixels with same summation for the plain-image, then the keystream will also be the same. Thus, this scheme suffers from summation invariance. To solve the problems of fixed keys and summation invariance, a new image encryption algorithm is designed in this study.The remainder of this paper is organized as follows. Section2 describes in detail the proposed image encryption algorithm. The simulation results are presented in Section 3 together with the security analysis. Finally, some conclusions are drawn in Section 4.


## 2. Proposed Image Encryption Algorithm

### 2.1. 3D Logistic Map and SHA-3

Recently, a 3D logistic map [35] with a better chaotic property than a 1D logistic map was studied. It can be defined by the following equation (1):(1)xi+1=αxi1-xi+βyi2xi+γzi3yi+1=αyi1-yi+βzi2yi+γxi3zi+1=αzi1-zi+βxi2zi+γyi3When 0.35<α<3.81, 0<β<0.022, and 0<γ<0.015 are set, the 3D logistic map (1) exhibits a chaotic behavior if xi,yi,zi∈(0,1). Figure 1(a) shows the chaos phenomena of the 3D logistic map (initial 20 iterated values are discarded) using the initial conditions: α=3.6324, β=0.0193, γ=0.0146, x0=0.4212, y0=0.1436, and z0=0.7108. Figure 1(b) displays the bifurcation diagram for x. Moreover, the Kolmogorov entropy is used to prove the chaos, for example, if α=3.6324, β=0.0193, and 0<γ<0.015, then the Kolmogorov entropy is 0.4230, indicating the chaos behavior of the 3D logistic map.Figure 1
Chaos test: (a) chaotic behavior; (b) bifurcation diagram forx.
(a) (b)SHA-3, designed by Bertoni, Daemen, Peeters, and Asschewest [36], is the newest hash function announced by the national institute of standards and technology (NIST), and it is highly sensitive to the input message and can perform quasi all symmetric cryptographic functions [36]. To solve the summation invariance in the plain-image and the problem of fixed keys, SHA-3 is used to compute the hash values of the plain-image. Here, the length of the output is set as 256 bits that are converted into 32 integer numbers (arranged into a vector h). Currently, the code package of SHA-3 algorithm has been made available to all the users.


### 2.2. Generation of Initial Conditions

To solve the shortcoming of fixed keys, the secret keys will not be assigned ahead by the sender and receiver in our algorithm. It is known that different persons have different ECG signals, and they can even be different for the same person at different times. For example, Figure2 shows two different ECG signals (all the ECG signals used in this study are chosen from [37]). The complexity of the biology of the human body makes it difficult to simulate or produce an ECG signal for any subject. Here, the Wolf algorithm [38] is employed to extract the property of an ECG signal, noted as λ∈[-1,1]. Subsequently, λ is decomposed into several decimal numbers treated as the control parameters and initial conditions for the 3D logistic map through the following equation:(2)α=3.6+λ100β=λ100×2γ=λ100+0.004x0=λ+12×10-λ+12×10y0=λ+12×100-λ+12×100z0=λ+12×1000-λ+12×1000where a represents the absolute value of a, whereas a rounds-off the element of a to the nearest integer toward negative infinity.Figure 2
ECG signals for (a) first person and (b) second person.
(a) (b)


### 2.3. Encryption Process

One cycle of permutation-only, diffusion-only, or permutation-diffusion has been found to be insecure for image encryption. Therefore, to enhance the security with the proposed algorithm, three rounds of permutation-diffusion are employed in our new method. It is supposed that the plain-image isP with size m×n, and the cipher-image is denoted as C.


#### 2.3.1. Permutation Operation

There is a natural strong correlation between adjacent pixels in a relevant plain-image, and a good encryption scheme should have the ability to decrease this correlation and obscure the pixel positions. Given a ECG signal, we can extract its propertyλ and then generate the initial conditions α, β, γ, x0, y0, and z0 for the 3D logistic map. To relate the keystream to the plain-image, SHA-3 is firstly applied to the plain-image P and we obtain hash vector h that is divided into three factors by the following equation:(3)hx=∑i=110hi10×255hy=∑i=1120hi10×255hz=∑i=2132hi12×255Subsequently, initial conditionsx0, y0, and z0 are updated by (4) and form new x¯0, y¯0, and z¯0. If the 3D logistic map is iterated a few times by the updated keys, chaotic sequences {x¯i}, {y¯i}, {z¯i} can be obtained. To increase the randomness degree, the initial iterated values should be discarded. Suppose three vectors X¯, Y¯, and Z¯ with length max⁡{m,n}+200 are produced (here, 200 is a random constant number considered as a control parameter). All the decimal numbers within X¯, Y¯, and Z¯ are transferred using (5), and the summation is calculated for Z¯ Factor τ=∑Z¯mod⁡200 is obtained and is employed to select m numbers from X¯ and n numbers from Y¯. Assume that vectors H={X¯τ+1,X¯τ+2,…,X¯τ+m} and L={Y¯τ+1,Y¯τ+2,…,Y¯τ+n} are generated and then used to perform a circular permutation for the plain-image P along the row and column, respectively. After completing the permutation operation, permuted image A can be obtained.(4)x¯0=x0+hxmod⁡1y¯0=y0+hymod⁡1z¯0=z0+hzmod⁡1(5)X¯=X¯×1014mod⁡nY¯=Y¯×1014mod⁡mZ¯=Z¯×1014mod⁡256


#### 2.3.2. Diffusion Operation

We know that a permutation-only scheme is insecure for any image encryption algorithm owing to the invariance of the statistical property; it only shuffles the pixel positions. Therefore, to ensure the security, a diffusion operation for the above permuted image,A, is further considered in our method. By iterating the 3D Logistic map using the initial conditions x0, y0, and z0, vector S is obtained containing all the elements xi, yi, and zi. Subsequently, it is arranged into matrix D having the same size as the plain-image. Before being used in the diffusion operation, all the elements in D should be transformed into integer numbers between 0 and 255 through (6) to satisfy the pixel interval.(6)Di,j=Di,j×1014mod⁡256,i=1,2,…,m;j=1,2,…,n.For the keystream to be dependent on the permuted image, factorρ is introduced in the function of the diffusion operation. Equation (7) applies the diffusion in the row direction. Here, a natural row is treated as a unit.(7)ρ=∑Ai+1mod⁡256Bi=Ai+ρ+Dimod⁡256,i=1,2,…,m,where Ai represents the ith row of image A. Am+1 is a constant vector. Similarly, the diffusion operation along the column direction can be processed for image B. Finally, cipher-image C is obtained after both permutation and diffusion are completed.


#### 2.3.3. Encryption Steps

For the entire permutation-diffusion structure (see the flowchart in Figure3), our image encryption algorithm can be described by the following steps.Figure 3
Flowchart of the proposed image encryption algorithm.Step 1.
Read the plain-image as matrixP and obtain its size m×n.Step 2.
Use the Wolf algorithm to produce initial conditionsx0, y0, and z0 and the three control parameters for the 3D logistic map from the ECG signal.Step 3.
Calculate the hash values for the plain-image using SHA-3 and convert them into hash vectorh.Step 4.
Generate factorshx, hy, and hz and update initial conditions x0, y0, and z0 to obtain new x¯0, y¯0, and z¯0.Step 5.
Iterate the 3D logistic map with newx¯0, y¯0, and z¯0 and obtain vectors H and L.Step 6.
Perform the circular permutation operation for plain-imageP and obtain permuted image A.Step 7.
Iterate the 3D logistic map byx0, y0, and z0 and obtain matrix D.Step 8.
Compute factorρ for each row and column before the diffusion operation.Step 9.
Perform the diffusion operation for permuted imageA using D along the row and column.Step 10.
Obtain cipher-imageC.In view of the symmetric structure, the decryption steps for our encryption algorithm are the same but in an inverse order.


## 2.1. 3D Logistic Map and SHA-3

Recently, a 3D logistic map [35] with a better chaotic property than a 1D logistic map was studied. It can be defined by the following equation (1):(1)xi+1=αxi1-xi+βyi2xi+γzi3yi+1=αyi1-yi+βzi2yi+γxi3zi+1=αzi1-zi+βxi2zi+γyi3When 0.35<α<3.81, 0<β<0.022, and 0<γ<0.015 are set, the 3D logistic map (1) exhibits a chaotic behavior if xi,yi,zi∈(0,1). Figure 1(a) shows the chaos phenomena of the 3D logistic map (initial 20 iterated values are discarded) using the initial conditions: α=3.6324, β=0.0193, γ=0.0146, x0=0.4212, y0=0.1436, and z0=0.7108. Figure 1(b) displays the bifurcation diagram for x. Moreover, the Kolmogorov entropy is used to prove the chaos, for example, if α=3.6324, β=0.0193, and 0<γ<0.015, then the Kolmogorov entropy is 0.4230, indicating the chaos behavior of the 3D logistic map.Figure 1
Chaos test: (a) chaotic behavior; (b) bifurcation diagram forx.
(a) (b)SHA-3, designed by Bertoni, Daemen, Peeters, and Asschewest [36], is the newest hash function announced by the national institute of standards and technology (NIST), and it is highly sensitive to the input message and can perform quasi all symmetric cryptographic functions [36]. To solve the summation invariance in the plain-image and the problem of fixed keys, SHA-3 is used to compute the hash values of the plain-image. Here, the length of the output is set as 256 bits that are converted into 32 integer numbers (arranged into a vector h). Currently, the code package of SHA-3 algorithm has been made available to all the users.


## 2.2. Generation of Initial Conditions

To solve the shortcoming of fixed keys, the secret keys will not be assigned ahead by the sender and receiver in our algorithm. It is known that different persons have different ECG signals, and they can even be different for the same person at different times. For example, Figure2 shows two different ECG signals (all the ECG signals used in this study are chosen from [37]). The complexity of the biology of the human body makes it difficult to simulate or produce an ECG signal for any subject. Here, the Wolf algorithm [38] is employed to extract the property of an ECG signal, noted as λ∈[-1,1]. Subsequently, λ is decomposed into several decimal numbers treated as the control parameters and initial conditions for the 3D logistic map through the following equation:(2)α=3.6+λ100β=λ100×2γ=λ100+0.004x0=λ+12×10-λ+12×10y0=λ+12×100-λ+12×100z0=λ+12×1000-λ+12×1000where a represents the absolute value of a, whereas a rounds-off the element of a to the nearest integer toward negative infinity.Figure 2
ECG signals for (a) first person and (b) second person.
(a) (b)


## 2.3. Encryption Process

One cycle of permutation-only, diffusion-only, or permutation-diffusion has been found to be insecure for image encryption. Therefore, to enhance the security with the proposed algorithm, three rounds of permutation-diffusion are employed in our new method. It is supposed that the plain-image isP with size m×n, and the cipher-image is denoted as C.


### 2.3.1. Permutation Operation

There is a natural strong correlation between adjacent pixels in a relevant plain-image, and a good encryption scheme should have the ability to decrease this correlation and obscure the pixel positions. Given a ECG signal, we can extract its propertyλ and then generate the initial conditions α, β, γ, x0, y0, and z0 for the 3D logistic map. To relate the keystream to the plain-image, SHA-3 is firstly applied to the plain-image P and we obtain hash vector h that is divided into three factors by the following equation:(3)hx=∑i=110hi10×255hy=∑i=1120hi10×255hz=∑i=2132hi12×255Subsequently, initial conditionsx0, y0, and z0 are updated by (4) and form new x¯0, y¯0, and z¯0. If the 3D logistic map is iterated a few times by the updated keys, chaotic sequences {x¯i}, {y¯i}, {z¯i} can be obtained. To increase the randomness degree, the initial iterated values should be discarded. Suppose three vectors X¯, Y¯, and Z¯ with length max⁡{m,n}+200 are produced (here, 200 is a random constant number considered as a control parameter). All the decimal numbers within X¯, Y¯, and Z¯ are transferred using (5), and the summation is calculated for Z¯ Factor τ=∑Z¯mod⁡200 is obtained and is employed to select m numbers from X¯ and n numbers from Y¯. Assume that vectors H={X¯τ+1,X¯τ+2,…,X¯τ+m} and L={Y¯τ+1,Y¯τ+2,…,Y¯τ+n} are generated and then used to perform a circular permutation for the plain-image P along the row and column, respectively. After completing the permutation operation, permuted image A can be obtained.(4)x¯0=x0+hxmod⁡1y¯0=y0+hymod⁡1z¯0=z0+hzmod⁡1(5)X¯=X¯×1014mod⁡nY¯=Y¯×1014mod⁡mZ¯=Z¯×1014mod⁡256


### 2.3.2. Diffusion Operation

We know that a permutation-only scheme is insecure for any image encryption algorithm owing to the invariance of the statistical property; it only shuffles the pixel positions. Therefore, to ensure the security, a diffusion operation for the above permuted image,A, is further considered in our method. By iterating the 3D Logistic map using the initial conditions x0, y0, and z0, vector S is obtained containing all the elements xi, yi, and zi. Subsequently, it is arranged into matrix D having the same size as the plain-image. Before being used in the diffusion operation, all the elements in D should be transformed into integer numbers between 0 and 255 through (6) to satisfy the pixel interval.(6)Di,j=Di,j×1014mod⁡256,i=1,2,…,m;j=1,2,…,n.For the keystream to be dependent on the permuted image, factorρ is introduced in the function of the diffusion operation. Equation (7) applies the diffusion in the row direction. Here, a natural row is treated as a unit.(7)ρ=∑Ai+1mod⁡256Bi=Ai+ρ+Dimod⁡256,i=1,2,…,m,where Ai represents the ith row of image A. Am+1 is a constant vector. Similarly, the diffusion operation along the column direction can be processed for image B. Finally, cipher-image C is obtained after both permutation and diffusion are completed.


### 2.3.3. Encryption Steps

For the entire permutation-diffusion structure (see the flowchart in Figure3), our image encryption algorithm can be described by the following steps.Figure 3
Flowchart of the proposed image encryption algorithm.Step 1.
Read the plain-image as matrixP and obtain its size m×n.Step 2.
Use the Wolf algorithm to produce initial conditionsx0, y0, and z0 and the three control parameters for the 3D logistic map from the ECG signal.Step 3.
Calculate the hash values for the plain-image using SHA-3 and convert them into hash vectorh.Step 4.
Generate factorshx, hy, and hz and update initial conditions x0, y0, and z0 to obtain new x¯0, y¯0, and z¯0.Step 5.
Iterate the 3D logistic map with newx¯0, y¯0, and z¯0 and obtain vectors H and L.Step 6.
Perform the circular permutation operation for plain-imageP and obtain permuted image A.Step 7.
Iterate the 3D logistic map byx0, y0, and z0 and obtain matrix D.Step 8.
Compute factorρ for each row and column before the diffusion operation.Step 9.
Perform the diffusion operation for permuted imageA using D along the row and column.Step 10.
Obtain cipher-imageC.In view of the symmetric structure, the decryption steps for our encryption algorithm are the same but in an inverse order.


## 2.3.1. Permutation Operation

There is a natural strong correlation between adjacent pixels in a relevant plain-image, and a good encryption scheme should have the ability to decrease this correlation and obscure the pixel positions. Given a ECG signal, we can extract its propertyλ and then generate the initial conditions α, β, γ, x0, y0, and z0 for the 3D logistic map. To relate the keystream to the plain-image, SHA-3 is firstly applied to the plain-image P and we obtain hash vector h that is divided into three factors by the following equation:(3)hx=∑i=110hi10×255hy=∑i=1120hi10×255hz=∑i=2132hi12×255Subsequently, initial conditionsx0, y0, and z0 are updated by (4) and form new x¯0, y¯0, and z¯0. If the 3D logistic map is iterated a few times by the updated keys, chaotic sequences {x¯i}, {y¯i}, {z¯i} can be obtained. To increase the randomness degree, the initial iterated values should be discarded. Suppose three vectors X¯, Y¯, and Z¯ with length max⁡{m,n}+200 are produced (here, 200 is a random constant number considered as a control parameter). All the decimal numbers within X¯, Y¯, and Z¯ are transferred using (5), and the summation is calculated for Z¯ Factor τ=∑Z¯mod⁡200 is obtained and is employed to select m numbers from X¯ and n numbers from Y¯. Assume that vectors H={X¯τ+1,X¯τ+2,…,X¯τ+m} and L={Y¯τ+1,Y¯τ+2,…,Y¯τ+n} are generated and then used to perform a circular permutation for the plain-image P along the row and column, respectively. After completing the permutation operation, permuted image A can be obtained.(4)x¯0=x0+hxmod⁡1y¯0=y0+hymod⁡1z¯0=z0+hzmod⁡1(5)X¯=X¯×1014mod⁡nY¯=Y¯×1014mod⁡mZ¯=Z¯×1014mod⁡256


## 2.3.2. Diffusion Operation

We know that a permutation-only scheme is insecure for any image encryption algorithm owing to the invariance of the statistical property; it only shuffles the pixel positions. Therefore, to ensure the security, a diffusion operation for the above permuted image,A, is further considered in our method. By iterating the 3D Logistic map using the initial conditions x0, y0, and z0, vector S is obtained containing all the elements xi, yi, and zi. Subsequently, it is arranged into matrix D having the same size as the plain-image. Before being used in the diffusion operation, all the elements in D should be transformed into integer numbers between 0 and 255 through (6) to satisfy the pixel interval.(6)Di,j=Di,j×1014mod⁡256,i=1,2,…,m;j=1,2,…,n.For the keystream to be dependent on the permuted image, factorρ is introduced in the function of the diffusion operation. Equation (7) applies the diffusion in the row direction. Here, a natural row is treated as a unit.(7)ρ=∑Ai+1mod⁡256Bi=Ai+ρ+Dimod⁡256,i=1,2,…,m,where Ai represents the ith row of image A. Am+1 is a constant vector. Similarly, the diffusion operation along the column direction can be processed for image B. Finally, cipher-image C is obtained after both permutation and diffusion are completed.


## 2.3.3. Encryption Steps

For the entire permutation-diffusion structure (see the flowchart in Figure3), our image encryption algorithm can be described by the following steps.Figure 3
Flowchart of the proposed image encryption algorithm.Step 1.
Read the plain-image as matrixP and obtain its size m×n.Step 2.
Use the Wolf algorithm to produce initial conditionsx0, y0, and z0 and the three control parameters for the 3D logistic map from the ECG signal.Step 3.
Calculate the hash values for the plain-image using SHA-3 and convert them into hash vectorh.Step 4.
Generate factorshx, hy, and hz and update initial conditions x0, y0, and z0 to obtain new x¯0, y¯0, and z¯0.Step 5.
Iterate the 3D logistic map with newx¯0, y¯0, and z¯0 and obtain vectors H and L.Step 6.
Perform the circular permutation operation for plain-imageP and obtain permuted image A.Step 7.
Iterate the 3D logistic map byx0, y0, and z0 and obtain matrix D.Step 8.
Compute factorρ for each row and column before the diffusion operation.Step 9.
Perform the diffusion operation for permuted imageA using D along the row and column.Step 10.
Obtain cipher-imageC.In view of the symmetric structure, the decryption steps for our encryption algorithm are the same but in an inverse order.


## 3. Simulations and Security Analysis

For the simulations discussed in this section, plain-images Lena and Boat are randomly chosen for the tests. Some common security analyses are also used to evaluate the security of the proposed algorithm.


### 3.1. Simulations

Using a computer equipped by a platform of Windows 7 with Intel(R) Core(TM) i3-2350, 2.30 GHz CPU, all the simulations are performed by the software Matlab R2011b. Figures4(a) and 4(b) show the ECG signals of the same person but with one sample shifting. By considering the ECG signal in Figure 4(a) as the initial condition for the 3D Logistic map, Figure 4(d) shows the cipher-image generated corresponding to plain-image Lena in Figure 4(c), whereas the cipher-image for plain-image Boat in Figure 4(e) is displayed in Figure 4(f) after using our new method. The computational time cost for a plain-image of size 256×256 is 0.1227s on an average.Figure 4
Simulation: (a) ECG signal, (b) ECG signal with one sample shifting, (c) plain-image of Lena, (d) cipher-image of Lena, (e) plain-image of Boat, (f) cipher-image of Boat, (g) wrong depiction of Lena, (h) wrong depiction of Boat, and (i) correct recovery for Lena.
(a) (b) (c) (d) (e) (f) (g) (h) (i)


### 3.2. Key Space and Its Sensitivity

Normally the key space should be kept as large as1030 to resist brute-force attack [39]. In our algorithm, the ECG signals from 1000 samples are taken to generate the initial conditions for the 3D logistic map by the Wolf algorithm. Therefore, the data is sufficiently large to avoid key analysis. Moreover, if there is one sample shifting in the ECG signal, then the correct plain-image cannot be obtained. For example, Figure 4(g) shows the wrong decrypted image for Figure 4(d), whereas Figure 4(h) displays the decryption result for Figure 4(f). Figure 4(i) displays the correct decryption for the Lena image under the condition of using the same ECG signal. Therefore, the proposed algorithm is highly sensitive to the keys.


### 3.3. Sensitivity of the Plain-Image

Any minor change in a plain-image should lead to a significant difference in the cipher-image to satisfy an ideal encryption algorithm. For the plain-image Lena, Figure5(a) shows the cipher-image when there is a one-bit change in the plain-image, whereas Figure 5(b) depicts the difference before and after the one-bit change. Similarly, Figures 5(c) and 5(d) display the case for the Boat image. To numerically evaluate the sensitivity of the plain-image, the unified averaged changed intensity (UACI) and number of changing pixel rate (NPCR) [40, 41] defined by (8) and (9) are usually considered in a cipher design. Various plain-images are randomly chosen to measure the sensitivity and the results are presented in Table 1. It can be seen that the values are approximately 33.4% and 99.6% [42]; i.e., the proposed method has a high sensitivity for the plain-image.(8)UACI=1m×n∑i,jC1i,j-C2i,j255×100%(9)NPCR=∑ijDi,jm×n×100%Table 1
U A C I and NPCR tests.
Images Lena Boat Baboon Peppers UACI 33.3961 33.4685 33.5116 33.4245 NPCR 99.6277 99.6059 99.6315 99.5934Figure 5
Sensitivity tests: (a) cipher-image of Lena with one-bit change in the plain-image, (b) difference before and after one-bit change for Lena, (c) cipher-image of Boat with one-bit change in the plain-image, and (d) difference before and after one-bit change for Boat.
(a) (b) (c) (d)


### 3.4. Histogram Analysis

A statistical attack is a common analysis approach employed by cryptanalysts. If a designed encryption algorithm can generate a uniform distribution of the pixels in the cipher-image, then it can effectively resist the histogram attack [43–45]. Figure 6(a) shows the histogram of the plain-image Lena, whereas Figure 6(b) displays the histogram of its corresponding cipher-image obtained by using our method. Similarly, Figures 6(c) and 6(d) display the histograms for the Boat image before and after the encryption. Furthermore, the cipher-image of Lena is divided into two blocks vertically and horizontally and four blocks averagely. The results for the block histogram tests are displayed in Figures 6(e)–6(l). All confirm that the histogram of the cipher-image is different from that of the plain-image, and that an illegal statistical attack [46–48] will not affect our algorithm.Figure 6
Histogram tests: (a) histogram of plain-image Lena, (b) histogram of cipher-image for Lena, (c) histogram of plain-image Boat, (d) histogram of cipher-image for Boat; cipher-image of Lena: (e) top block, (f) bottom block, (g) left block, (h) right block, (i) top-left block, (j)top-right bock, (k) bottom-left block, and (l) bottom-right bock.
(a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l)


### 3.5. Correlation Coefficients Analysis

For an image in a natural case, a high correlation normally exists among most pairs of adjacent pixels because of pixel continuity. To test the ability of decreasing this correlation and then hiding the original information, the following function is usually employed to calculate the correlation coefficients:(10)rc=Ex-Exy-EyDxDywhere N is the total number of the samples, x and y represent the gray values of two adjacent pixels in the image, and E(x)=1/N∑i=1Nxi, D(x)=1/N∑i=1Nxi-Ex2. Figure 7 shows the visual test results for the Lena image after applying the proposed method. It can be clearly seen that the correlation coefficients can be significantly deduced in the cipher-image compared with that of the plain-image.Figure 7
Correlation tests for Lena: (a) plain-image by horizontally, (b) cipher-image by horizontally, (c) plain-image by vertically, (d) cipher-image by vertically, (e) plain-image by diagonally, and (f) cipher-image by diagonally.
(a) (b) (c) (d) (e) (f)


### 3.6. Some Comparisons

In this subsection, to highlight the better performance of our method, we compare it withUACI, NPCR, and entropy. Table 2 lists the results of the entropy analysis using different images. Clearly, the values from this work are more in agreement with the theoretical value 8. Regarding UACI and NPCR, Table 3 shows the results of a one-bit change (OBC) at position (186,33) and two bits change at positions (186,33) and (105,110) but with the same summation (TBS) for different plain-images. Therefore, the sensitivity to the plain-image is higher particularly when two bits are changed, but the same summation is kept in the plain-image. Regarding the chosen/known plain-image attack, we mainly consider the relationship between the plain-image and generation of the keystream. Table 4 displays the comparisons with some references that show the advantages of our method.Table 2
Entropy comparison.
Images Boat Lena Baboon Barb Plain-image 7.5715 7.5683 7.3579 7.4664 Cipher-image 7.9993 7.9974 7.9993 7.9993 Cipher-image in [40] 7.9915 7.9896 7.9915 7.9913 Cipher-image in [43] 7.9980 7.9974 7.9992 7.9990 Cipher-image in [46] 7.9912 7.9891 7.9912 7.9917 Cipher-image in [49] 7.9994 7.9972 7.9994 7.9993Table 3
UACI and NPCR comparison.
Images Lena Boat OBC ofUACI in [43] 33.3807 33.4903 OBC ofUACI in ours 33.3281 33.4370 OBC ofNPCR in [43] 99.6140 99.6166 OBC ofNPCR in ours 99.5895 99.6201 TBS ofUACI in [43] 1.1968 × 1 0 - 7 2.9919 × 1 0 - 8 TBS ofUACI in ours 33.3461 33.4156 TBS ofNPCR in [43] 3.0518 × 1 0 - 5 7.6294 × 1 0 - 6 TBS ofNPCR in ours 99.6216 99.6128Table 4
Chosen/known plain-image attack.
Methods [31] [32] [33] [34] [35] Ours Pass or not No No No Pass No Pass


### 3.7. Extension to Other Images

Three more images are randomly taken from the SIPI image database as a test. Figure8(a) shows the plain-image of a Chemical plant and Figure 8(b) displays its cipher-image for it. The corresponding images for a tank and truck are shown in Figures 8(c)–8(f).Figure 8
Tests for SIPI image database: (a) plain-image of chemical plant, (b) cipher-image of chemical plant, (c) plain-image of tank, (d) cipher-image of tank, (e) plain-image of truck, and (f) cipher-image of truck.
(a) (b) (c) (d) (e) (f)


### 3.8. Application to Color Image

As to the case of color image, it can be divided into three channels, R, G, and B. Then we treat each of them as a gray image correspondingly. Consequently, the encryption process for each channel is similar using our proposed encryption algorithm. After that, the cipher-image can be obtained by integrating again the encryption result of each channel into a color image. Table5 lists the entropy results for color images Lena and Peppers by the proposed algorithm. All values are near to the ideal case.Table 5
Entropy analysis for color images.
Cipher-images Size R G B Averagely Lena 256 × 256 7.9977 7.9971 7.9973 7.9974 Peppers 512 × 512 7.9993 7.9993 7.9993 7.9993


## 3.1. Simulations

Using a computer equipped by a platform of Windows 7 with Intel(R) Core(TM) i3-2350, 2.30 GHz CPU, all the simulations are performed by the software Matlab R2011b. Figures4(a) and 4(b) show the ECG signals of the same person but with one sample shifting. By considering the ECG signal in Figure 4(a) as the initial condition for the 3D Logistic map, Figure 4(d) shows the cipher-image generated corresponding to plain-image Lena in Figure 4(c), whereas the cipher-image for plain-image Boat in Figure 4(e) is displayed in Figure 4(f) after using our new method. The computational time cost for a plain-image of size 256×256 is 0.1227s on an average.Figure 4
Simulation: (a) ECG signal, (b) ECG signal with one sample shifting, (c) plain-image of Lena, (d) cipher-image of Lena, (e) plain-image of Boat, (f) cipher-image of Boat, (g) wrong depiction of Lena, (h) wrong depiction of Boat, and (i) correct recovery for Lena.
(a) (b) (c) (d) (e) (f) (g) (h) (i)


## 3.2. Key Space and Its Sensitivity

Normally the key space should be kept as large as1030 to resist brute-force attack [39]. In our algorithm, the ECG signals from 1000 samples are taken to generate the initial conditions for the 3D logistic map by the Wolf algorithm. Therefore, the data is sufficiently large to avoid key analysis. Moreover, if there is one sample shifting in the ECG signal, then the correct plain-image cannot be obtained. For example, Figure 4(g) shows the wrong decrypted image for Figure 4(d), whereas Figure 4(h) displays the decryption result for Figure 4(f). Figure 4(i) displays the correct decryption for the Lena image under the condition of using the same ECG signal. Therefore, the proposed algorithm is highly sensitive to the keys.


## 3.3. Sensitivity of the Plain-Image

Any minor change in a plain-image should lead to a significant difference in the cipher-image to satisfy an ideal encryption algorithm. For the plain-image Lena, Figure5(a) shows the cipher-image when there is a one-bit change in the plain-image, whereas Figure 5(b) depicts the difference before and after the one-bit change. Similarly, Figures 5(c) and 5(d) display the case for the Boat image. To numerically evaluate the sensitivity of the plain-image, the unified averaged changed intensity (UACI) and number of changing pixel rate (NPCR) [40, 41] defined by (8) and (9) are usually considered in a cipher design. Various plain-images are randomly chosen to measure the sensitivity and the results are presented in Table 1. It can be seen that the values are approximately 33.4% and 99.6% [42]; i.e., the proposed method has a high sensitivity for the plain-image.(8)UACI=1m×n∑i,jC1i,j-C2i,j255×100%(9)NPCR=∑ijDi,jm×n×100%Table 1
U A C I and NPCR tests.
Images Lena Boat Baboon Peppers UACI 33.3961 33.4685 33.5116 33.4245 NPCR 99.6277 99.6059 99.6315 99.5934Figure 5
Sensitivity tests: (a) cipher-image of Lena with one-bit change in the plain-image, (b) difference before and after one-bit change for Lena, (c) cipher-image of Boat with one-bit change in the plain-image, and (d) difference before and after one-bit change for Boat.
(a) (b) (c) (d)


## 3.4. Histogram Analysis

A statistical attack is a common analysis approach employed by cryptanalysts. If a designed encryption algorithm can generate a uniform distribution of the pixels in the cipher-image, then it can effectively resist the histogram attack [43–45]. Figure 6(a) shows the histogram of the plain-image Lena, whereas Figure 6(b) displays the histogram of its corresponding cipher-image obtained by using our method. Similarly, Figures 6(c) and 6(d) display the histograms for the Boat image before and after the encryption. Furthermore, the cipher-image of Lena is divided into two blocks vertically and horizontally and four blocks averagely. The results for the block histogram tests are displayed in Figures 6(e)–6(l). All confirm that the histogram of the cipher-image is different from that of the plain-image, and that an illegal statistical attack [46–48] will not affect our algorithm.Figure 6
Histogram tests: (a) histogram of plain-image Lena, (b) histogram of cipher-image for Lena, (c) histogram of plain-image Boat, (d) histogram of cipher-image for Boat; cipher-image of Lena: (e) top block, (f) bottom block, (g) left block, (h) right block, (i) top-left block, (j)top-right bock, (k) bottom-left block, and (l) bottom-right bock.
(a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l)


## 3.5. Correlation Coefficients Analysis

For an image in a natural case, a high correlation normally exists among most pairs of adjacent pixels because of pixel continuity. To test the ability of decreasing this correlation and then hiding the original information, the following function is usually employed to calculate the correlation coefficients:(10)rc=Ex-Exy-EyDxDywhere N is the total number of the samples, x and y represent the gray values of two adjacent pixels in the image, and E(x)=1/N∑i=1Nxi, D(x)=1/N∑i=1Nxi-Ex2. Figure 7 shows the visual test results for the Lena image after applying the proposed method. It can be clearly seen that the correlation coefficients can be significantly deduced in the cipher-image compared with that of the plain-image.Figure 7
Correlation tests for Lena: (a) plain-image by horizontally, (b) cipher-image by horizontally, (c) plain-image by vertically, (d) cipher-image by vertically, (e) plain-image by diagonally, and (f) cipher-image by diagonally.
(a) (b) (c) (d) (e) (f)


## 3.6. Some Comparisons

In this subsection, to highlight the better performance of our method, we compare it withUACI, NPCR, and entropy. Table 2 lists the results of the entropy analysis using different images. Clearly, the values from this work are more in agreement with the theoretical value 8. Regarding UACI and NPCR, Table 3 shows the results of a one-bit change (OBC) at position (186,33) and two bits change at positions (186,33) and (105,110) but with the same summation (TBS) for different plain-images. Therefore, the sensitivity to the plain-image is higher particularly when two bits are changed, but the same summation is kept in the plain-image. Regarding the chosen/known plain-image attack, we mainly consider the relationship between the plain-image and generation of the keystream. Table 4 displays the comparisons with some references that show the advantages of our method.Table 2
Entropy comparison.
Images Boat Lena Baboon Barb Plain-image 7.5715 7.5683 7.3579 7.4664 Cipher-image 7.9993 7.9974 7.9993 7.9993 Cipher-image in [40] 7.9915 7.9896 7.9915 7.9913 Cipher-image in [43] 7.9980 7.9974 7.9992 7.9990 Cipher-image in [46] 7.9912 7.9891 7.9912 7.9917 Cipher-image in [49] 7.9994 7.9972 7.9994 7.9993Table 3
UACI and NPCR comparison.
Images Lena Boat OBC ofUACI in [43] 33.3807 33.4903 OBC ofUACI in ours 33.3281 33.4370 OBC ofNPCR in [43] 99.6140 99.6166 OBC ofNPCR in ours 99.5895 99.6201 TBS ofUACI in [43] 1.1968 × 1 0 - 7 2.9919 × 1 0 - 8 TBS ofUACI in ours 33.3461 33.4156 TBS ofNPCR in [43] 3.0518 × 1 0 - 5 7.6294 × 1 0 - 6 TBS ofNPCR in ours 99.6216 99.6128Table 4
Chosen/known plain-image attack.
Methods [31] [32] [33] [34] [35] Ours Pass or not No No No Pass No Pass


## 3.7. Extension to Other Images

Three more images are randomly taken from the SIPI image database as a test. Figure8(a) shows the plain-image of a Chemical plant and Figure 8(b) displays its cipher-image for it. The corresponding images for a tank and truck are shown in Figures 8(c)–8(f).Figure 8
Tests for SIPI image database: (a) plain-image of chemical plant, (b) cipher-image of chemical plant, (c) plain-image of tank, (d) cipher-image of tank, (e) plain-image of truck, and (f) cipher-image of truck.
(a) (b) (c) (d) (e) (f)


## 3.8. Application to Color Image

As to the case of color image, it can be divided into three channels, R, G, and B. Then we treat each of them as a gray image correspondingly. Consequently, the encryption process for each channel is similar using our proposed encryption algorithm. After that, the cipher-image can be obtained by integrating again the encryption result of each channel into a color image. Table5 lists the entropy results for color images Lena and Peppers by the proposed algorithm. All values are near to the ideal case.Table 5
Entropy analysis for color images.
Cipher-images Size R G B Averagely Lena 256 × 256 7.9977 7.9971 7.9973 7.9974 Peppers 512 × 512 7.9993 7.9993 7.9993 7.9993


## 4. Conclusions

To enhance the sensitivity of a plain-image and avoid the summation invariance in a plain-image associated with some algorithms, SHA-3 is employed in our proposed method to calculate the hash value. Then, an ECG signal generated by a human body is used to produce the initial conditions for the chaotic map including the control parameters. Consequently, the fixed key problem can be solved. Related analysis and experimental results have demonstrated that the proposed image encryption algorithm can be a secure model for image communication. There are two contributions, i.e.,(1) avoiding the low sensitivity in case of summation invariance and (2) solving the fixed key and producing the effect of a dynamic key.



---

*Source: 8402578-2018-10-21.xml*