# Design and Analysis of a Novel Chaos-Based Image Encryption Algorithm via Switch Control Mechanism

Authors: Shenyong Xiao; ZhiJun Yu; YaShuang Deng
Journal: Security and Communication Networks
 (2020)

---

## Abstract

Chaos has been widely used in image encryption due to its rich properties. However, it remains an irreconcilable contradiction for security and implementation efficiency for image encryption schemes. In this paper, a novel chaos-based image encryption scheme has been proposed, where the Lorenz chaotic system is applied to generate pseudorandom sequences with good randomness, and a random switch control mechanism is introduced to ensure the security of the encryption scheme. Experimental results demonstrate the effectiveness and superiority of the algorithm.


---

## Body

## 1. Introduction

Mass data transmission on various communication networks has led to a security risk in multimedia data. Digital images have become an important expression in the network of information transmission due to its intuitive and vivid attribute; meanwhile, a great deal of researches on image processing has emerged [1–4]. The increasingly rampant network crime makes the digital image security particularly important. In the past few decades, many encryption algorithms such as Data Encryption Standard (DES), International Data Encryption Algorithm (IDEA), and Advanced Encryption Standard (AES) have been put forward. However, those methods are more suitable for text encryption rather than image encryption owing to the special properties of images including large amount of data, high redundancy, and strong correlation between pixels. Chaotic system has features such as sensitivity to initial conditions and control parameters, dense periodic points, and topological transitivity, which make it especially suitable for image encryption. A chaotic image encryption algorithm was firstly proposed in 1989 [5]. Ever since then, a variety of chaos-based image encryption algorithms have been put forward [6–16].Early chaotic image encryption schemes were mostly based on simple low-dimensional chaotic systems, such as Logistic chaotic map [17], tent chaotic map [18], cat chaotic map [11], Baker chaotic map [19], and so on [20]. Specific can elaborate as: El Assad and Farajallah [11] proposed an image encryption system based on 2D cat map, where a diffusion layer along with a bit-permutation layer was contained. Li et al. [18] proposed a novel image encryption scheme based on the tent map, which had been proved to perform well. Zhang and Wang [21] proposed a new multiple-image encryption algorithm based on the mixed image element and piecewise linear chaotic map, which is a quite fast way to encrypt, and the like. However, some existing schemes have been revealed to be security risk owing to the simple structure of the applied chaotic maps [22]. Then, researchers tried to design image encryption schemes by using various deformation or combinations of these well-known chaotic maps and other mathematical manipulation [23–26], such as the composition of logistic and tent map [27], the Logistic-Sine-coupling map [28], and baker map and logistic map [29]. These solutions have enhanced the security of algorithms and were effective to some certain extent. With the further study of chaotic systems, more and more image encryption schemes based on higher-dimensional chaotic systems, especially for hyperchaos and spatiotemporal chaos, emerge gradually [13, 30–32]. Actually, most of these schemes have a high level of security, as opposed to a high implementation cost. Moreover, some new technologies have been introduced to the design and security analysis of image encryption schemes such as neural network [33], DNA coding [34], genetic recombination [31], compressed sensing [35], and machine leaning [36]. In general, there exists an irreconcilable contradiction between the security and implementation complexity of cryptographic algorithms.Switch control technology has been addressed in many fields such as biological and medical systems [37], electric power systems [38], and others. It is worth mentioning that switch control can be used to realize the chaotification of given dynamical systems or make an original simple system become complex, etc. Motivated by the above discussion, in this paper, we introduce the switch control mechanism into the chaos-based image encryption scheme, where the required pseudorandom numbers for encryption are still generated by chaos, and substitutions of rows or columns of image in the permutation of plain images are determined by the designed random switch control mechanism. Moreover, the confusion of the permuted image is completed to ensure the security of the whole image encryption. Finally, experimental results are carried out to show the effect of the scheme. Given that the process of image encryption can hide any information about the original image as much as possible, the whole process can be regarded as the process of decreasing entropy. Then, performance comparisons with some existing image schemes are carried out by using information entropy along with other indicators to show the superiority of the proposed image encryption algorithm.The rest of this paper is organized as follows. Some preliminaries are given in Section2. In Section 3, we present a novel image encryption scheme via switch control mechanism. In Section 4, some numerical examples are given to illustrate the validity and superiority of image encryption algorithm. Section 5 concludes this paper.


## 2. Pseudorandom Number Generator Based on Lorenz Chaotic System

For a given plain image, the whole encryption requires a series of random numbers to produce secret image. Therein, this paper exploits the effectiveness of the Lorenz chaotic system to generate pseudorandom numbers. The Lorenz system is formally defined as(1)x˙=ay−x,y˙=cx−y−xz,z˙=xy−bz,where a, b, and c are system parameters. It is well known that the system has a strange chaotic attractor over the parameters a = 10, b = 8/3, and c = 28, as depicted in Figure 1.Figure 1
Lorenz chaotic attractor. (a) All directions. (b)x-y direction. (c) x-z direction. (d) y-z direction.
(a)
(b)
(c)
(d)Motivated by the idea in [39] that proper stretch transformation along with modular operation can make the chaotic system generate pseudorandom numbers with good randomness, two new pseudorandom number generators are designed as(2)S1i=modroundxi+yi∗1012,2;i=1,2,…,(3)S2i=modroundzi∗1012,256;i=1,2,…,where xi, yi, and zi are sample sequences of the Lorenz chaotic system over the sampling interval T = 0.1. Actually, the chaotic signal can be completely described by its samples for this sampling interval [39].The standard NIST SP800-22 test is applied to evaluate the performance of two pseudorandom number generators, and the test results are summarized in Table1. As shown in the table, two pseudorandom number generators have passed all the tests, which indicate that both of them have good randomness, thus can be used in the next image encryption process.Table 1
NIST SP800-22 test results of two generators.
Test name
S1
S2
p value
Results
p value
Results
Frequency
0.115026
SUCCESS
0.852445
SUCCESS
Block frequency
0.479345
SUCCESS
0.335341
SUCCESS
Cumulative sums
0.133011
SUCCESS
0.739284
SUCCESS
Runs
0.628042
SUCCESS
0.648365
SUCCESS
Longest runs of ones
0.746332
SUCCESS
0.269936
SUCCESS
Rank
0.955981
SUCCESS
0.057146
SUCCESS
FFT
0.713570
SUCCESS
0.818546
SUCCESS
Overlapping template matching
0.360195
SUCCESS
0.434233
SUCCESS
Universal statistical
0.689639
SUCCESS
0.693656
SUCCESS
Random excursions
0.364557
SUCCESS
0.504450
SUCCESS
Random excursions variant
0.490487
SUCCESS
0.490322
SUCCESS
Serial
0.880692
SUCCESS
0.157533
SUCCESS
Nonperiodic template
0.541996
SUCCESS
0.474985
SUCCESS
Linear complexity
0.519593
SUCCESS
0.736412
SUCCESS
Apen
0.909288
SUCCESS
0.401933
SUCCESS


## 3. Proposed Image Encryption Scheme

This section presents the proposed image encryption in detail. The encryption scheme consists of two main parts: image confusion and image diffusion. The confusion process generates scrambled images from a series of plain images by relocating image pixels, where it is determined by a switch control rule. The diffusion increases the security of permutated images by using mixed operation on relocated pixel values of images.


### 3.1. Image Encryption Process

LetI be an image with the size of M×N, which can be turned into the vector form as follows:(4)I=I1,I2,…,IMN,where Ii denotes the image pixel at i-th position, for i=1,2,…,M⋅N.


#### 3.1.1. Image Confusion via Switch Control Mechanism

To perform the image confusion, the proposed method exploits the Lorenz chaotic system to generate two chaotic sequences denoted as follows:(5)R=R1,R2,…,RM,L=L1,L2,…,LN.The proposed method then sort two these chaotic sequencesR and L to yield the following sets:(6)SR=SR1,SR2,…,SRM,SL=SL1,SL2,…,SLN.Finally, marking the positions of each point in the sequencesSR and SL in the original sequences R and L, we can get two random permutations denoted as follows:(7)TR=TR1,TR2,…,TRM,TL=TL1,TL2,…,TLN.To increase the randomness of rearrangement of image pixels, a switch control mechanism is injected into the image confusion step, which can be used to determine whether a row or column transformation will be performed on plain images. The switch control mechanism can be designed as follows:(8)I¯=f1I,ifS1i=0,f2I,ifS1i=1,where I is the plain image, I¯ is the scrambled image, and S1 is the pseudorandom number generator expressed by equation (2), whose randomness determines that the proposed switch control law is also random. f1 and f2 represent row and column transformation described as follows.Row transformation (f1): rearrange the positions of the rows in I according to the order of TR, e.g., move the TR1 row to the first row, the TR2 row to the second row, …, the TRM row to the M th row.Column transformation (f2): rearrange the positions of the columns in I according to the order of TL, e.g., move the TL1 column to the first column, the TL2 column to the second column, …, the TLN column to the Nth column.Based on the above switch control rule, the confusion process can be described as follows:Step 1: select the firstK points from S1 and let θ = S1i i=1,2,…,K, where K represents the maximum value of M and N.Step 2: relocate the pixels of imageI according to the switch control rule represented by equation (8) along with the pseudorandom sequence S1. That is, if θ=0, a row transformation will be performed on the plain image; otherwise, column transformation works.Step 3: a new matrixI¯ can be got after MN times transformations. If the pixel in the image has not been permutated completely, discard the first MN points in S1, and repeat Step 1-Step 2 until the results perform well.


#### 3.1.2. Image Diffusion Process

To further increase the security level of the proposed image encryption, the scrambled imageI1′ can be made more confusing via the pseudorandom numbers S2 designed previously, where the whole image can be processed as a sequence with length of MN.The image diffusion can simply perform by utilizing the following computation:(9)Ci=modCi−1+I¯i+I¯i−1,256⊕S2,where Ci is the current ciphered value, Ci−1 is the previous ciphered value, I¯i is the current scrambled image value, and I¯i−1 is the previous scrambled image value, and S2 has been calculated by equation (3). Set the initial value C0=0.


### 3.2. The Decryption Process

The inverse process of image diffusion aims to recover back the diffused image into its original value, which can be viewed as the reverse of the encryption part. The same keys as used in the encryption process are introduced into the Lorenz chaotic system to obtain three output sequencesxi, yi, and zi, i=1,2,…,N. Then, the same method employed above to calculate S1 and S2 was used.The formula of the decryption is given as(10)I¯i=modCi⊕S2−Ci−1−I¯i−1,256,where Ci is the current ciphered value, Ci−1 is the previous ciphered value, I¯i is the current scrambled image value, and I¯i−1 is the previous scrambled image value, and S2 has been calculated by equation (3) . Without loss of generality, set initial value I¯0 = 0.The confusion of decryption: extractK points from S1 to get θ. If θ=0, the corresponding part will be performed by row transformation; else, the column transformation works. And it is determined by the random permutation TR and TL how the image transforms. It is worth noting that the round of permutation part used here should be the same as the one designed in the encryption process. In this way, the plain image I can be recovered.


## 3.1. Image Encryption Process

LetI be an image with the size of M×N, which can be turned into the vector form as follows:(4)I=I1,I2,…,IMN,where Ii denotes the image pixel at i-th position, for i=1,2,…,M⋅N.


### 3.1.1. Image Confusion via Switch Control Mechanism

To perform the image confusion, the proposed method exploits the Lorenz chaotic system to generate two chaotic sequences denoted as follows:(5)R=R1,R2,…,RM,L=L1,L2,…,LN.The proposed method then sort two these chaotic sequencesR and L to yield the following sets:(6)SR=SR1,SR2,…,SRM,SL=SL1,SL2,…,SLN.Finally, marking the positions of each point in the sequencesSR and SL in the original sequences R and L, we can get two random permutations denoted as follows:(7)TR=TR1,TR2,…,TRM,TL=TL1,TL2,…,TLN.To increase the randomness of rearrangement of image pixels, a switch control mechanism is injected into the image confusion step, which can be used to determine whether a row or column transformation will be performed on plain images. The switch control mechanism can be designed as follows:(8)I¯=f1I,ifS1i=0,f2I,ifS1i=1,where I is the plain image, I¯ is the scrambled image, and S1 is the pseudorandom number generator expressed by equation (2), whose randomness determines that the proposed switch control law is also random. f1 and f2 represent row and column transformation described as follows.Row transformation (f1): rearrange the positions of the rows in I according to the order of TR, e.g., move the TR1 row to the first row, the TR2 row to the second row, …, the TRM row to the M th row.Column transformation (f2): rearrange the positions of the columns in I according to the order of TL, e.g., move the TL1 column to the first column, the TL2 column to the second column, …, the TLN column to the Nth column.Based on the above switch control rule, the confusion process can be described as follows:Step 1: select the firstK points from S1 and let θ = S1i i=1,2,…,K, where K represents the maximum value of M and N.Step 2: relocate the pixels of imageI according to the switch control rule represented by equation (8) along with the pseudorandom sequence S1. That is, if θ=0, a row transformation will be performed on the plain image; otherwise, column transformation works.Step 3: a new matrixI¯ can be got after MN times transformations. If the pixel in the image has not been permutated completely, discard the first MN points in S1, and repeat Step 1-Step 2 until the results perform well.


### 3.1.2. Image Diffusion Process

To further increase the security level of the proposed image encryption, the scrambled imageI1′ can be made more confusing via the pseudorandom numbers S2 designed previously, where the whole image can be processed as a sequence with length of MN.The image diffusion can simply perform by utilizing the following computation:(9)Ci=modCi−1+I¯i+I¯i−1,256⊕S2,where Ci is the current ciphered value, Ci−1 is the previous ciphered value, I¯i is the current scrambled image value, and I¯i−1 is the previous scrambled image value, and S2 has been calculated by equation (3). Set the initial value C0=0.


## 3.1.1. Image Confusion via Switch Control Mechanism

To perform the image confusion, the proposed method exploits the Lorenz chaotic system to generate two chaotic sequences denoted as follows:(5)R=R1,R2,…,RM,L=L1,L2,…,LN.The proposed method then sort two these chaotic sequencesR and L to yield the following sets:(6)SR=SR1,SR2,…,SRM,SL=SL1,SL2,…,SLN.Finally, marking the positions of each point in the sequencesSR and SL in the original sequences R and L, we can get two random permutations denoted as follows:(7)TR=TR1,TR2,…,TRM,TL=TL1,TL2,…,TLN.To increase the randomness of rearrangement of image pixels, a switch control mechanism is injected into the image confusion step, which can be used to determine whether a row or column transformation will be performed on plain images. The switch control mechanism can be designed as follows:(8)I¯=f1I,ifS1i=0,f2I,ifS1i=1,where I is the plain image, I¯ is the scrambled image, and S1 is the pseudorandom number generator expressed by equation (2), whose randomness determines that the proposed switch control law is also random. f1 and f2 represent row and column transformation described as follows.Row transformation (f1): rearrange the positions of the rows in I according to the order of TR, e.g., move the TR1 row to the first row, the TR2 row to the second row, …, the TRM row to the M th row.Column transformation (f2): rearrange the positions of the columns in I according to the order of TL, e.g., move the TL1 column to the first column, the TL2 column to the second column, …, the TLN column to the Nth column.Based on the above switch control rule, the confusion process can be described as follows:Step 1: select the firstK points from S1 and let θ = S1i i=1,2,…,K, where K represents the maximum value of M and N.Step 2: relocate the pixels of imageI according to the switch control rule represented by equation (8) along with the pseudorandom sequence S1. That is, if θ=0, a row transformation will be performed on the plain image; otherwise, column transformation works.Step 3: a new matrixI¯ can be got after MN times transformations. If the pixel in the image has not been permutated completely, discard the first MN points in S1, and repeat Step 1-Step 2 until the results perform well.


## 3.1.2. Image Diffusion Process

To further increase the security level of the proposed image encryption, the scrambled imageI1′ can be made more confusing via the pseudorandom numbers S2 designed previously, where the whole image can be processed as a sequence with length of MN.The image diffusion can simply perform by utilizing the following computation:(9)Ci=modCi−1+I¯i+I¯i−1,256⊕S2,where Ci is the current ciphered value, Ci−1 is the previous ciphered value, I¯i is the current scrambled image value, and I¯i−1 is the previous scrambled image value, and S2 has been calculated by equation (3). Set the initial value C0=0.


## 3.2. The Decryption Process

The inverse process of image diffusion aims to recover back the diffused image into its original value, which can be viewed as the reverse of the encryption part. The same keys as used in the encryption process are introduced into the Lorenz chaotic system to obtain three output sequencesxi, yi, and zi, i=1,2,…,N. Then, the same method employed above to calculate S1 and S2 was used.The formula of the decryption is given as(10)I¯i=modCi⊕S2−Ci−1−I¯i−1,256,where Ci is the current ciphered value, Ci−1 is the previous ciphered value, I¯i is the current scrambled image value, and I¯i−1 is the previous scrambled image value, and S2 has been calculated by equation (3) . Without loss of generality, set initial value I¯0 = 0.The confusion of decryption: extractK points from S1 to get θ. If θ=0, the corresponding part will be performed by row transformation; else, the column transformation works. And it is determined by the random permutation TR and TL how the image transforms. It is worth noting that the round of permutation part used here should be the same as the one designed in the encryption process. In this way, the plain image I can be recovered.


## 4. Experimental Results and Performance Analysis

Series of images are chosen here to verify the performance of the proposed image encryption algorithm, where all image sizes are normalized to256×256 for convenience. Setting the parameters and initial values of the Lorenz chaotic system as a=10, b=8/3, c = 28, x0 = 10, y0 = 5, and z0 = 9, we carry out the encryption scheme.We first invest the performance of the proposed encryption algorithm for different images. It can be shown from Figure2 that the algorithm destroys the obvious pattern of the plain image and makes the ciphered image display a space filling with a noise-like pattern. The shuffling process of pixels of the image hides the information of the original plain image and makes the ciphered image seem random to the intruder. Thus, the encryption scheme is effective.Figure 2
Encryption and decryption of images. (a) Plaintext of Lena. (b) Encryption of Lena. (c) Decrypion of Lena. (d) Plaintext of bird. (e) Encryption of bird. (f) Decryption of bird. (g) Plaintext of flower. (h) Encryption of flower. (i) Decryption of flower. (j) Plaintext of photographer. (k) Encryption of photographer. (l) Decryption of photographer.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(i)
(j)
(k)
(l)Then, we analyze the security of the proposed encryption scheme. Generally, a good encryption scheme not only can hide any information of the plain image but also can resist some attacks. Some commonly used test indicators have been applied to analyse the security of the proposed image encryption scheme, which include key space and key sensitivity analysis, histogram analysis, NPCR (number of pixel change rate) and UACI (unified average changing intensity) analysis, entropy analysis, and correlation analysis.


### 4.1. Key Space and Sensitivity Analysis

The size of key space is an important indicator to measure the ability of resistance to exhaustion attack. In general, the smaller the key space, the more vulnerable the scheme is to attack. From the cryptographic point of view, the size of key space should be no smaller than2128 to make brute force attack ineffective. Given that the secret keys include the initial value x0, y0, and z0 and system parameters a, b, and c, the size of the key space can reach 106L with computing precision 10L. In the case, the key space is far more than 1084(≈2128) if the precision L≥14. Therefore, the key space is large enough to resist the exhaustion attack.A good image encryption scheme should also be sensitive to tiny changes of keys, which means any tiny changes of the keys can induce huge changes of the encrypted images. In this way, the attacker cannot decode the original image by using the keys similar to the real ones.Without loss of generality, we choose randomly system parameters and initial values to carry out the process of encryption and decryption and observe the influence of tiny changes on the decryption. For each secret key, suppose that the last one bit is changed in it and other keys are unchanged and then investigate if the original images can be restored using the changed key. Setting the parametersa = 10, b = 8/3, c = 28, x0 = 10, y0 = 5, and z0 = 9, the decrypted images using the same settings can be shown in Figure 2 in front. Meanwhile, the decrypted image with the keys a, b, c, x0, y0, and z0 changed to 0.00000000001 is shown in Figure 3. To be exact, the key a is changed to 10.00000000001. Similar conclusions can be got for other keys. As shown in Figure 3, the encrypted image cannot be cracked by using a similar key (x0 = 10.00000000000001). Hence, the algorithm is sensitive to tiny changes of keys.Figure 3
Key Sensitivity Analysis. (a) Changea restoring diagram. (b) Change b restoring diagram. (c) Change c restoring diagram. (d) Change x0 restoring diagram. (e) Change y0 restoring diagram. (f) Change z0 restoring diagram.
(a)
(b)
(c)
(d)
(e)
(f)


### 4.2. Histogram Analysis

The histogram of an image is an important statistical property which can reflect the relation between gray level and its corresponding frequency. For a good image encryption algorithm, its encrypted image should have a histogram with uniform distribution to hide the statistical characteristic. The images before and after encryption are shown in Figure4. It can be seen from Figures 4(a)–4(d) that the frequency distributions of given images are not uniform for different gray levels, which makes attackers often easily get information from them. It can be found from Figures 4(e)–4(h) that the frequency distribution becomes quite uniform after encryption, which indicates that the statistical characteristic has been hidden and will not leak any information of the plain images, thus enhance the security of the images.Figure 4
Histograms of plain and ciphered images. (a–d) Histograms of Lena, bird, flower, and photographer. (e–h) Histograms of ciphered Lena, bird, flower, and photographer.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)


### 4.3. NPCR and UACI Analysis

NPCR and UACI are two measures to examine the performance of an image encryption algorithm to resist differential attack. Actually, NPCR depicts the number of pixels change rate while one pixels of plain image changed, while UACI stands for the average intensity of difference between the plain image and the ciphered image. Two these indicators can be defined as follows:(11)NPCR=∑i,jDi,jW×H×100%,UACI=1W×H∑i,jC1i,j−C2i,j255×100%,where W and H are the width and height of C1 or C2. C1 or C2 is the encrypted image before and after one pixel of the plain image is changed. Di,j can be defined as follows: if C1≠C2, Di,j=1; else, Di,j=0.And the expectation of the NPCR and UACI with 8 bits representation can be described as [40](12)NPCRE=1−2−n×100%UACIE=122n∑i=12n−1ii+12n−1×100%,where n denotes the digit. It can be calculated that NPCRE and UACIE are close to 99.6094070 and 33.4635070 for 8 bits digits.We invest the NPCR and UACI results of the encrypted Lena images for different positions and different images separately, and the results are shown in Tables2 and 3, respectively. As shown in two these tables, the values of NPCR are close to the ideal value, which means the encryption scheme is very sensitive to small changes in the plain image. With respect to UACI, the values for different images are also close to the ideal value, which indicates that the rate of influence due to one pixel change is very large. In this way, the algorithm has strong ability to resist differential attacks.Table 2
NPCR and UACI of different positions.
Position
(1, 1)
(64, 64)
(128, 128)
(1, 256)
(256, 1)
(256, 256)
NPCR (%)
99.6063
99.6048
99.6201
99.5880
99.6048
99.5926
UACI (%)
33.4621
33.2419
33.4538
33.3603
33.3034
33.3788Table 3
NPCR and UACI of proposed algorithm.
Image
Lena
Bird
Flower
Photographer
NPCR (%)
99.6063
99.6002
99.5834
99.6086
UACI (%)
33.4621
33.4665
33.4696
33.4434To further show the superiority of the algorithm, comparisons with other existing schemes have been made here, as depicted in Table4. It is clear from the analysis result that the algorithm has higher ability to resist differential attack.Table 4
Comparison of NPCR and UACI with other methods.
Scheme
Proposed
Ref. [26]
Ref. [34]
Ref. [12]
Ref. [16]
NPCR (%)
99.6063
99.62000
99.6173
99.6552
99.6094
UACI (%)
33.4621
33.46000
29.5664
33.4846
28.6181


### 4.4. Correlation Analysis

The correlation between image pixels is an important indicator to measure whether the ciphered image can resist the chosen-plaintext attack. The correlation between adjacent pixels can be characterized by correlation coefficients, which can be defined as follows:(13)rx,y=Covx,yDx∗Dy,where x and y are the grayscale values of two adjacent pixels in the given image. Dx and Dy are the variance of x and y, respectively. Covx,y shows the covariance of x and y.To measure the correlation of adjacent pixels, we first select 2000 pairs of adjacent pixels (in vertical, horizontal, and diagonal directions) randomly from plain images and ciphered images, respectively, and calculate their correlation coefficients. The mean value of the correlation coefficients for different images is shown in Table5. Obviously, the correlation between two adjacent pixels can be greatly reduced after encryption. Figures 5 and 6 also depict the correlations of plain and ciphered images in horizontal, vertical and diagonal adjacent pixels, respectively. In addition, correlation performance comparison with other existing image encryption algorithms is made, as shown in Table 6. It can be observed that the correlation between two adjacent pixels of plain images has been eliminated to a large extent and then enhances the ability to resist the chosen-plaintext attack. All these results indicate the proposed image encryption algorithm is effective and has higher security.Table 5
Correlation coefficients of images.
Image
Plain image
Ciphered image
Horizontal
Vertical
Diagonal
Horizontal
Vertical
Diagonal
Lena
0.9728
0.9281
0.9050
−0.0011
0.0014
0.0005
Bird
0.9687
0.9596
0.9298
0.0004
−0.0020
0.0028
Flower
0.9694
0.9528
0.9301
0.0026
−0.0041
−0.0023
Photographer
0.9626
0.9231
0.9496
0.0029
−0.0024
−0.0008Figure 5
Correlations of plain images in horizontal, vertical, and diagonal adjacent pixels. (a–c) Lena. (d–f) Bird. (g–i) Flower. (j–l) Photographer.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(i)
(j)
(k)
(l)Figure 6
Correlations of ciphered images in horizontal, vertical, and diagonal adjacent pixels. (a–c) Lena. (d–f) Bird. (g–i) Flower. (j–l) Photographer.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(i)
(j)
(k)
(l)Table 6
Comparison of correlation coefficients with other methods.
Scheme
Lena
Proposed
Ref. [26]
Ref. [34]
Ref. [12]
Ref. [16]
Horizontal
0.9728
−0.0011
−0.0285
0.0027
−0.0038
−0.0245
Vertical
0.9281
0.0014
0.0014
0.0005
−0.0026
−0.0226
Diagonal
0.9050
0.0005
0.0013
−0.0045
0.0017
−0.0193


### 4.5. Entropy Analysis

For a given image, it is ideal that the character information of the image can be hidden entirely after being encrypted, and thus the intruder cannot carry an effective attack on it. To measure the complexity or uncertainty of given images, two entropy indicators are introduced here: information entropy and approximate entropy (ApEn) [41]. The former mainly measures the uncertainty of an information source, while the latter depicts the probability of new patterns appearing in the information source. Normally, the more complicated the sequence, the higher the entropy, and the less likely it is to leak information.The information entropyHx of an information source x can be calculated as(14)Hx=−∑​pxlog2px,where px represents the probability of source x. Normally, the greater the uncertainty of source x, the higher the entropy. A source with uniform distribution has the greatest uncertainty, and the information entropy is at its maximum. That is, the more information entropy closes to 8, the more uncertainty there is, and less information the system may leak. As shown in Table 7, the information entropy of images is enhanced to be in close proximity to the maximum value 8 under the current digit after encryption. That is, the probability of information leakage is very small, which means the encryption scheme is effective.Table 7
Information entropy of images.
Image
Lena
Bird
Flower
Photographer
Plain
7.5545
7.6515
6.6792
6.5786
Ciphered
7.9974
7.9973
7.9970
7.9971Generally, the more evenly distributed, the less likely new patterns are to emerge and the greater the ApEn value is. As shown in Table8, the ApEn values of the ciphered images are enhanced to be more than 2.5 times than the ones of the original images and even be close to the mean value (about 2.1773nat) of the random images with uniform distribution, which further ensure the validity of the proposed scheme.Table 8
Approximate entropy of images.
Image
Lena
Bird
Flower
Photographer
Plain
0.6434
0.7828
0.4613
0.2723
Ciphered
2.1733
2.1785
2.1815
2.1734Furthermore, we compare the entropy performance of the proposed algorithm with other existing chaos-based image encryption schemes. As shown in Table9, the information entropy of the proposed scheme is not only larger than that of other schemes but also closer to the maximum value of 8. In this way, the proposed scheme has higher security.Table 9
Comparison of information entropy with other methods.
Scheme
Plain image
Encrypted image
Ref. [26]
Ref. [34]
Ref. [12]
Ref. [16]
Entropy
7.5545
7.9997
7.9993
7.9972
7.9874
7.9975


## 4.1. Key Space and Sensitivity Analysis

The size of key space is an important indicator to measure the ability of resistance to exhaustion attack. In general, the smaller the key space, the more vulnerable the scheme is to attack. From the cryptographic point of view, the size of key space should be no smaller than2128 to make brute force attack ineffective. Given that the secret keys include the initial value x0, y0, and z0 and system parameters a, b, and c, the size of the key space can reach 106L with computing precision 10L. In the case, the key space is far more than 1084(≈2128) if the precision L≥14. Therefore, the key space is large enough to resist the exhaustion attack.A good image encryption scheme should also be sensitive to tiny changes of keys, which means any tiny changes of the keys can induce huge changes of the encrypted images. In this way, the attacker cannot decode the original image by using the keys similar to the real ones.Without loss of generality, we choose randomly system parameters and initial values to carry out the process of encryption and decryption and observe the influence of tiny changes on the decryption. For each secret key, suppose that the last one bit is changed in it and other keys are unchanged and then investigate if the original images can be restored using the changed key. Setting the parametersa = 10, b = 8/3, c = 28, x0 = 10, y0 = 5, and z0 = 9, the decrypted images using the same settings can be shown in Figure 2 in front. Meanwhile, the decrypted image with the keys a, b, c, x0, y0, and z0 changed to 0.00000000001 is shown in Figure 3. To be exact, the key a is changed to 10.00000000001. Similar conclusions can be got for other keys. As shown in Figure 3, the encrypted image cannot be cracked by using a similar key (x0 = 10.00000000000001). Hence, the algorithm is sensitive to tiny changes of keys.Figure 3
Key Sensitivity Analysis. (a) Changea restoring diagram. (b) Change b restoring diagram. (c) Change c restoring diagram. (d) Change x0 restoring diagram. (e) Change y0 restoring diagram. (f) Change z0 restoring diagram.
(a)
(b)
(c)
(d)
(e)
(f)


## 4.2. Histogram Analysis

The histogram of an image is an important statistical property which can reflect the relation between gray level and its corresponding frequency. For a good image encryption algorithm, its encrypted image should have a histogram with uniform distribution to hide the statistical characteristic. The images before and after encryption are shown in Figure4. It can be seen from Figures 4(a)–4(d) that the frequency distributions of given images are not uniform for different gray levels, which makes attackers often easily get information from them. It can be found from Figures 4(e)–4(h) that the frequency distribution becomes quite uniform after encryption, which indicates that the statistical characteristic has been hidden and will not leak any information of the plain images, thus enhance the security of the images.Figure 4
Histograms of plain and ciphered images. (a–d) Histograms of Lena, bird, flower, and photographer. (e–h) Histograms of ciphered Lena, bird, flower, and photographer.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)


## 4.3. NPCR and UACI Analysis

NPCR and UACI are two measures to examine the performance of an image encryption algorithm to resist differential attack. Actually, NPCR depicts the number of pixels change rate while one pixels of plain image changed, while UACI stands for the average intensity of difference between the plain image and the ciphered image. Two these indicators can be defined as follows:(11)NPCR=∑i,jDi,jW×H×100%,UACI=1W×H∑i,jC1i,j−C2i,j255×100%,where W and H are the width and height of C1 or C2. C1 or C2 is the encrypted image before and after one pixel of the plain image is changed. Di,j can be defined as follows: if C1≠C2, Di,j=1; else, Di,j=0.And the expectation of the NPCR and UACI with 8 bits representation can be described as [40](12)NPCRE=1−2−n×100%UACIE=122n∑i=12n−1ii+12n−1×100%,where n denotes the digit. It can be calculated that NPCRE and UACIE are close to 99.6094070 and 33.4635070 for 8 bits digits.We invest the NPCR and UACI results of the encrypted Lena images for different positions and different images separately, and the results are shown in Tables2 and 3, respectively. As shown in two these tables, the values of NPCR are close to the ideal value, which means the encryption scheme is very sensitive to small changes in the plain image. With respect to UACI, the values for different images are also close to the ideal value, which indicates that the rate of influence due to one pixel change is very large. In this way, the algorithm has strong ability to resist differential attacks.Table 2
NPCR and UACI of different positions.
Position
(1, 1)
(64, 64)
(128, 128)
(1, 256)
(256, 1)
(256, 256)
NPCR (%)
99.6063
99.6048
99.6201
99.5880
99.6048
99.5926
UACI (%)
33.4621
33.2419
33.4538
33.3603
33.3034
33.3788Table 3
NPCR and UACI of proposed algorithm.
Image
Lena
Bird
Flower
Photographer
NPCR (%)
99.6063
99.6002
99.5834
99.6086
UACI (%)
33.4621
33.4665
33.4696
33.4434To further show the superiority of the algorithm, comparisons with other existing schemes have been made here, as depicted in Table4. It is clear from the analysis result that the algorithm has higher ability to resist differential attack.Table 4
Comparison of NPCR and UACI with other methods.
Scheme
Proposed
Ref. [26]
Ref. [34]
Ref. [12]
Ref. [16]
NPCR (%)
99.6063
99.62000
99.6173
99.6552
99.6094
UACI (%)
33.4621
33.46000
29.5664
33.4846
28.6181


## 4.4. Correlation Analysis

The correlation between image pixels is an important indicator to measure whether the ciphered image can resist the chosen-plaintext attack. The correlation between adjacent pixels can be characterized by correlation coefficients, which can be defined as follows:(13)rx,y=Covx,yDx∗Dy,where x and y are the grayscale values of two adjacent pixels in the given image. Dx and Dy are the variance of x and y, respectively. Covx,y shows the covariance of x and y.To measure the correlation of adjacent pixels, we first select 2000 pairs of adjacent pixels (in vertical, horizontal, and diagonal directions) randomly from plain images and ciphered images, respectively, and calculate their correlation coefficients. The mean value of the correlation coefficients for different images is shown in Table5. Obviously, the correlation between two adjacent pixels can be greatly reduced after encryption. Figures 5 and 6 also depict the correlations of plain and ciphered images in horizontal, vertical and diagonal adjacent pixels, respectively. In addition, correlation performance comparison with other existing image encryption algorithms is made, as shown in Table 6. It can be observed that the correlation between two adjacent pixels of plain images has been eliminated to a large extent and then enhances the ability to resist the chosen-plaintext attack. All these results indicate the proposed image encryption algorithm is effective and has higher security.Table 5
Correlation coefficients of images.
Image
Plain image
Ciphered image
Horizontal
Vertical
Diagonal
Horizontal
Vertical
Diagonal
Lena
0.9728
0.9281
0.9050
−0.0011
0.0014
0.0005
Bird
0.9687
0.9596
0.9298
0.0004
−0.0020
0.0028
Flower
0.9694
0.9528
0.9301
0.0026
−0.0041
−0.0023
Photographer
0.9626
0.9231
0.9496
0.0029
−0.0024
−0.0008Figure 5
Correlations of plain images in horizontal, vertical, and diagonal adjacent pixels. (a–c) Lena. (d–f) Bird. (g–i) Flower. (j–l) Photographer.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(i)
(j)
(k)
(l)Figure 6
Correlations of ciphered images in horizontal, vertical, and diagonal adjacent pixels. (a–c) Lena. (d–f) Bird. (g–i) Flower. (j–l) Photographer.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(i)
(j)
(k)
(l)Table 6
Comparison of correlation coefficients with other methods.
Scheme
Lena
Proposed
Ref. [26]
Ref. [34]
Ref. [12]
Ref. [16]
Horizontal
0.9728
−0.0011
−0.0285
0.0027
−0.0038
−0.0245
Vertical
0.9281
0.0014
0.0014
0.0005
−0.0026
−0.0226
Diagonal
0.9050
0.0005
0.0013
−0.0045
0.0017
−0.0193


## 4.5. Entropy Analysis

For a given image, it is ideal that the character information of the image can be hidden entirely after being encrypted, and thus the intruder cannot carry an effective attack on it. To measure the complexity or uncertainty of given images, two entropy indicators are introduced here: information entropy and approximate entropy (ApEn) [41]. The former mainly measures the uncertainty of an information source, while the latter depicts the probability of new patterns appearing in the information source. Normally, the more complicated the sequence, the higher the entropy, and the less likely it is to leak information.The information entropyHx of an information source x can be calculated as(14)Hx=−∑​pxlog2px,where px represents the probability of source x. Normally, the greater the uncertainty of source x, the higher the entropy. A source with uniform distribution has the greatest uncertainty, and the information entropy is at its maximum. That is, the more information entropy closes to 8, the more uncertainty there is, and less information the system may leak. As shown in Table 7, the information entropy of images is enhanced to be in close proximity to the maximum value 8 under the current digit after encryption. That is, the probability of information leakage is very small, which means the encryption scheme is effective.Table 7
Information entropy of images.
Image
Lena
Bird
Flower
Photographer
Plain
7.5545
7.6515
6.6792
6.5786
Ciphered
7.9974
7.9973
7.9970
7.9971Generally, the more evenly distributed, the less likely new patterns are to emerge and the greater the ApEn value is. As shown in Table8, the ApEn values of the ciphered images are enhanced to be more than 2.5 times than the ones of the original images and even be close to the mean value (about 2.1773nat) of the random images with uniform distribution, which further ensure the validity of the proposed scheme.Table 8
Approximate entropy of images.
Image
Lena
Bird
Flower
Photographer
Plain
0.6434
0.7828
0.4613
0.2723
Ciphered
2.1733
2.1785
2.1815
2.1734Furthermore, we compare the entropy performance of the proposed algorithm with other existing chaos-based image encryption schemes. As shown in Table9, the information entropy of the proposed scheme is not only larger than that of other schemes but also closer to the maximum value of 8. In this way, the proposed scheme has higher security.Table 9
Comparison of information entropy with other methods.
Scheme
Plain image
Encrypted image
Ref. [26]
Ref. [34]
Ref. [12]
Ref. [16]
Entropy
7.5545
7.9997
7.9993
7.9972
7.9874
7.9975


## 5. Conclusion

Given that there exists a contradiction between the security and implementation for most existing chaotic image encryption schemes, a novel chaos-based encryption scheme via switch control technology has been proposed. In this scheme, the three-dimensional Lorenz chaotic system is introduced to generate pseudorandom sequences with good randomness, and a switch control law is designed to realize the random permutation of the given images. The simulation results show that the proposed algorithm has a good performance, and the comparisons of entropy and other indicators also show its superiority.



---

*Source: 7913061-2020-03-16.xml*