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

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.


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][2][3][4]. e 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][7][8][9][10][11][12][13][14][15][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]. en, researchers tried to design image encryption schemes by using various deformation or combinations of these well-known chaotic maps and other mathematical manipulation [23][24][25][26], such as the composition of logistic and tent map [27], the Logistic-Sine-coupling map [28], and baker map and logistic map [29]. ese 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][31][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. en, 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. e rest of this paper is organized as follows. Some preliminaries are given in Section 2. 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.

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. erein, this paper exploits the effectiveness of the Lorenz chaotic system to generate pseudorandom numbers. e Lorenz system is formally defined as 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. 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 S1 i � mod round x i + y i * 10 12 , 2 ; i � 1, 2, . . . , where x i , y i , and z i 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]. e standard NIST SP800-22 test is applied to evaluate the performance of two pseudorandom number generators, and the test results are summarized in Table 1. 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.

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

Image Encryption Process.
Let I be an image with the size of M × N, which can be turned into the vector form as follows: where I i denotes the image pixel at i-th position, for i � 1, 2, . . . , M · N.

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: e proposed method then sort two these chaotic sequences R and L to yield the following sets: Finally, marking the positions of each point in the sequences SR and SL in the original sequences R and L, we can get two random permutations denoted as follows: 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. e switch control mechanism can be designed as follows:

Security and Communication Networks
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 (f 1 ): rearrange the positions of the rows in I according to the order of TR, e.g., move the TR 1 row to the first row, the TR 2 row to the second row, . . ., the TR M row to the M th row.
Column transformation (f 2 ): rearrange the positions of the columns in I according to the order of TL, e.g., move the TL 1 column to the first column, the TL 2 column to the second column, . . ., the TL N column to the Nth column.
Based on the above switch control rule, the confusion process can be described as follows: Step 1: select the first K points from S1 and let θ � S1 i i � 1, 2, . . . , K, where K represents the maximum value of M and N.
Step 2: relocate the pixels of image I according to the switch control rule represented by equation (8) along with the pseudorandom sequence S1. at is, if θ � 0, a row transformation will be performed on the plain image; otherwise, column transformation works.
Step 3: a new matrix I 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.

Image Diffusion Process.
To further increase the security level of the proposed image encryption, the scrambled image I1 ′ 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. e image diffusion can simply perform by utilizing the following computation: where C i is the current ciphered value, C i−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 C 0 � 0.

e Decryption Process.
e 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. e same keys as used in the encryption process are introduced into the Lorenz chaotic system to obtain three output sequences x i , y i , and z i , i � 1, 2, . . . , N. en, the same method employed above to calculate S1 and S2 was used. e formula of the decryption is given as where C i is the current ciphered value, C i−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. e confusion of decryption: extract K 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.

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 to 256 × 256 for convenience. Setting the parameters and initial values of the Lorenz chaotic system as a � 10, b � 8/3, c � 28, x 0 � 10, y 0 � 5, and z 0 � 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 Figure 2 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. e 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. us, the encryption scheme is effective.
en, 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.

Key Space and Sensitivity Analysis.
e 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 than 2 128 to make brute force attack ineffective. Given that the secret keys include the initial value x 0 , y 0 , and z 0 and system parameters a, b, and c, the size of the key space can reach 10 6L with computing precision 10 L . In the case, the key space is far more than 10 84 ( ≈ 2 128 ) if the precision L ≥ 14. erefore, 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.

Security and Communication Networks
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 parameters a � 10, b � 8/3, c � 28, x 0 � 10, y 0 � 5, and z 0 � 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, x 0 , y 0 , and z 0 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 (x 0 �10.00000000000001). Hence, the algorithm is sensitive to tiny changes of keys.

Histogram Analysis.
e 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. e images before and after encryption are shown in Figure 4. 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.

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: where W and H are the width and height of C 1 or C 2 . C 1 or C 2 is the encrypted image before and after one pixel of the plain image is changed. D(i, j) can be defined as follows: if And the expectation of the NPCR and UACI with 8 bits representation can be described as [40] where n denotes the digit. It can be calculated that NPCR E and UACI E 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 Tables 2 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.
To further show the superiority of the algorithm, comparisons with other existing schemes have been made here, as depicted in Table 4. It is clear from the analysis result that the algorithm has higher ability to resist differential attack.

Correlation Analysis.
e correlation between image pixels is an important indicator to measure whether the ciphered image can resist the chosen-plaintext attack. e correlation between adjacent pixels can be characterized by correlation coefficients, which can be defined as follows: where x and y are the grayscale values of two adjacent pixels in the given image. D(x) and D(y) are the variance of x and y, respectively. Cov(x, 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. e mean value of the correlation coefficients for different images is shown in Table 5. 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 chosenplaintext attack. All these results indicate the proposed image encryption algorithm is effective and has higher security.

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]. e 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. e information entropy H(x) of an information source x can be calculated as where p(x) 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.
at 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.
at is, the probability of information leakage is very small, which means the encryption scheme is effective. Ref. [26] Ref. [34] Ref. [12] Ref. [    Generally, the more evenly distributed, the less likely new patterns are to emerge and the greater the ApEn value is. As shown in Table 8, 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.
Furthermore, we compare the entropy performance of the proposed algorithm with other existing chaos-based image encryption schemes. As shown in Table 9, 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.

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. e simulation results show that the proposed algorithm has a good performance, and the comparisons of entropy and other indicators also show its superiority.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.