Research Article  Open Access
An Improved Piecewise Linear Chaotic Map Based Image Encryption Algorithm
Abstract
An image encryption algorithm based on improved piecewise linear chaotic map (MPWLCM) model was proposed. The algorithm uses the MPWLCM to permute and diffuse plain image simultaneously. Due to the sensitivity to initial key values, system parameters, and ergodicity in chaotic system, two pseudorandom sequences are designed and used in the processes of permutation and diffusion. The order of processing pixels is not in accordance with the index of pixels, but it is from beginning or end alternately. The cipher feedback was introduced in diffusion process. Test results and security analysis show that not only the scheme can achieve good encryption results but also its key space is large enough to resist against brute attack.
1. Introduction
With the rapid development of network communication technology, multimedia information such as digital images are more commonly and frequently transmitted in public communication network. Therefore, it is particularly important to protect images from piracy. As a result, image encryption technology becomes an important issue of cryptography. Image data have two features, namely, bulky data capacity and strong correlations among adjacent pixels. For this reason conventional cipher algorithms are not directly suitable for image encryption. Chaotic cryptography then was drawn attention by researchers due to its many good properties, such as ergodicity, sensitive dependence on initial conditions, randomlike behavior, and high efficiency in image encryption.
In recent years, many image encryption algorithms have been proposed [1–11]. The confusion and diffusion processes in cryptography proposed by Shannon [12] are applied in image encryption successfully. These processes include a permutationdiffusion structure, while many proposed chaotic image encryption systems [8–11] adopted Arnold cat map to shuffle the positions of the pixels by confuse phase, and the permutation process was separated from diffusion process. Arnold cat map has some weaknesses [13]. One is that the periodic states appear in very limited iteration times. Another one is that the width and height of the processed image must be equal, or the image cannot be permuted directly. What is more, each pixel position of different images in same size is fixed after the diffuse phase. Thus it is not suitable for the practical application in chaotic cryptography. If the permutation process was separated from diffusion process, efficiency will be reduced. In [14], Wang and Jin proposed an image encryption algorithm. They confuse the plain image by using logistic map and Game of Life instead of Arnold cat map firstly. Then they use piecewise linear chaotic map (PWLCM) to diffuse each pixel of the image. In this paper, we firstly proposed a improved piecewise linear chaotic map (MPWLCM) model. Then we use the MPWLCM to shuffle positions and diffuse values of pixels in plain image simultaneously. Test results and security analysis not only show that the scheme can achieve good encryption result but also show that the key space is large enough to resist against brute attack.
2. The MPWLCM Map
The PWLCM can be described as where , when control parameter , (1) evolves into a chaotic state [14], and can be served as a secret key. PWLCM system has uniform invariant distribution and very good ergodicity, confusion, and determinacy, so it can provide excellent random sequence, which is suitable for information encryption.
Based on the PWLCM, we propose an improved piecewise linear chaotic map (MPWLCM) model, which can be denoted by (2) (see also Figure 1): where is the control parameter and . denote the maximal integer less than or equal to .
Figures 2(a) and 2(b) show the state sequences of PWLCM and MPWLCM, respectively. From Figures 2(a) and 2(b), one can see that the sequence of MPWLCM has better performance in randomness than MPWLCM. Hence, MPWLCM is more suitable for information encryption.
(a)
(b)
3. The Proposed Cryptosystem
For a 256grayscale image of size , it is an integer matrix of rows columns, in which the values range from 0 to 255. Its data can be treated as a onedimensional vector , where denotes the gray level of the image pixel at ceil row and column.
3.1. Generating Permutation Sequence
Given and , we firstly generate permutation sequence to change the position of image pixel. Different from most proposed methods, our scheme is based on ergodic matrix instead of sorting chaotic sequence. Suppose that is an ergodic matrix of size , where are integers, , and if . Our scheme takes the following steps.
Step 1. Iterate the PWLCM by using (2) for times to get rid of transient effect, where is a constant; set a onedimensional matrix flag, which length is and each of its elements is zero; initialize the permutation sequence .
Step 2. Let .
Step 3. To iterate the PWLCM to obtain a new , compute a integer by using current according to the following formula:
Step 4. Checking the values and , if , or then repeat Step 3; else then go to Step 5.
Step 5. ; .
Step 6. Let , return to Step 3 until reaches .
3.2. Generating Diffusion Sequence
Step 1. Supposing the diffusion sequence is denoted by , set , .
Step 2. Let .
Step 3. To iterate the PWLCM to obtain a new , compute by using current according to the following formula:
Step 4. Checking , if , then .
Step 5. Let , return to Step 3 until reaches .
3.3. Encryption Algorithm
The encryption process uses the permutation sequence to shuffle the positions of image pixels and uses the diffusion sequence to diffuse the values of image pixels simultaneously. Namely, permutation process will move the pixel of position in plain image to the position in cipher image, where . At the same time, the pixel value of position in plain image is altered by using diffusion key and the previous encrypted pixel value. Different from most of usual algorithms, the process order is not equivalent to the pixel index , but it is from beginning or end alternately. Namely, . If is even, then the processed pixel index is . At other times the processed pixel index is . Figure 3 illustrates the block diagram of the proposed encryption algorithm.
The permutation and diffusion process may repeat rounds ( to , ). In the first round , denotes the th pixel in original plain image and denotes the th pixel in current ciphered image , where is the previously outputted cipher pixel value. For , is equal to a presetting value . In the th round , denotes the th pixel in the ciphered image outputted in the th turn and denotes the th pixel in current ciphered image . is the previously outputted cipher pixel value. For , is the last outputted cipher pixel value in the previous round, where denotes the nonlinear encryption function. The encryption formulas in our scheme are as follows:where and .
Our encryption algorithm takes the following steps.
Step 1. Let .
Step 2. If is even, then ; otherwise .
Step 3. Obtain by using the permutation sequence .
Step 4. Use (5a) or (5b) to permute and diffuse the current pixel simultaneously.
Step 5. Let .
Step 6. If , then return to Step 1; otherwise one round encryption is complete.
4. Experimental Results and Security Analysis
In our experiments, The images for testing are the traditional images with 8bit grayscale. The system parameter and initial state of MPWLCM are and . , , and .
4.1. Key Space Analysis
Key space size is the total number of different keys which can be used in the encryption process. In the proposed algorithm, the secret keys set , where and are doubleprecision numbers, is a constant integer and , and is a integer. If the computational precision of and is , then . Therefore, the key space is bigger than , which is much larger than 2^{124}. So the encryption algorithm has a large enough key space to resist all kinds of bruteforce attacks.
4.2. Statistical Analysis
Shannon suggested two methods of diffusion and confusion for frustrating the powerful statistical analysis. Here, we demonstrated the confusion and diffusion properties of our MPWLCM chaotic encryption system. This is shown by a test on the histogram and the correlations of adjacent pixels in the cipher image.
Histograms of Encrypted Images. Select several 256 graylevel images with size of which have different contents and calculate their histograms. One typical example (Sailboat) among them is shown in Figure 4. From Figure 4, we can see that the histogram of the cipher image is fairly uniformed and is significantly different from that of the original image.
(a)
(b)
(c)
(d)
(2) Correlation Coefficients of two adjacent pixels. To test the correlation between two adjacent pixels in plain image and cipher image, all pairs of twoadjacent pixels (in vertical, horizontal, and diagonal direction) from plain image and cipher image were selected and the correlation coefficients were calculated by using the following formulas: where and are grayscale values of twoadjacent pixels in the image and is the correlation coefficient of two adjacent pixels. The test results are shown in Table 1. It also shows the results of the existing algorithms in [14]. From Table 1, it can be seen that the encryption scheme satisfies zero cocorrelation, which is of highlevel security. Compared with the algorithms proposed by [14], it shows superior performance.

4.3. Information Entropy Analysis
Information entropy is the most important feature of randomness. Let be the information source, and the formula for calculating information entropy is where denotes the probability of symbol and is the total states of the information source. For a true random source emitting symbols, the entropy should be . Take a 256grayscale image, for example, and the pixel data have 2^{8} possible values, so the ideal entropy of a 256grayscale image must be 8. The information entropy of the cipherimages is shown in Table 2. The obtained values are very close to the theoretical value 8.

4.4. Differential Attack
Generally speaking, an opponent may make a slight change (e.g., modify only one pixel) of the encrypted image to observe the change in the result. In this way, we may be able to find out a meaningful relationship between the plain image and the cipher image. This is known as the differential attack. However, if one minor change in the plain image can cause a significant change in the cipher image, with respect to diffusion and confusion, then the differential attack would become very inefficient and useless.
The proposed cryptosystem can ensure two ciphered images different completely, even if there is only one bit difference between plain images. We have done differential analysis by calculating the NPCR (net pixel change rate) and UACI (unified average changing intensity) for several images. Here are the formulas: where represents the difference between and . If , then ; otherwise . For an 8bit gray image, the expected estimates are and .
We have done plaintext sensitivity analysis (differential analysis) by calculating the NPCR and UACI for plainimage Lena, Sailboat, Pepper, and Cameraman. In particular, we have randomly chosen 100 different pixels (one at a time, including the very first and very last pixels of the image) in each plainimage and changed their values slightly, and then we have computed NPCR and UACI for all the cases using (8). The results of NPCR and UACI for the plainimage Cameraman are shown in Figures 5(a) and 5(b), respectively. It is clear that the NPCR and UACI values remain in the vicinity of the expected values (shown by the horizontal lines); that is, the proposed image encryption technique shows extreme sensitivity on the plaintext. Also, Table 3 shows the average values of NPCR and UACI for the plainimage Lena, Sailboat, Pepper, and Cameraman. We can find that the mean NPCR is over 99% and the mean UACI is over 33%. The results show that the proposed algorithm is very sensitive to tiny changes in the plain image; even if there is only one bit difference between two plain images, the encrypted images will be different completely. Thus, the algorithm is robust against differential attack.

(a)
(b)
A good encryption algorithm should also be sensitive to the secret keys. For the MPWLCM system, the sensitivity to and is considered as ; Figure 6 shows the sensitivity to the key. Figure 6(a) is the decrypted Cameraman by correct key and Figure 6(b) is the decrypted Cameraman by the wrong key with a tiny change .
(a)
(b)
5. Conclusion
This paper proposes a symmetric cryptographic system using MPWLCM chaotic system to encrypt grayscale image. We can see that the proposed cryptosystem can process any size of image. Security analysis and experimental results demonstrated the effectiveness of the proposed scheme. The key space is large enough to resist bruteforce attacks. Statistical analysis shows that the scheme can well protect the image from the statistical attack. The scheme possesses high sensitivity to plain image and key, so it has a good ability to resist differential attack. With highlevel security, it can be used in secure image communications.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgments
This work is supported by the National Natural Science Foundation of China (nos. 61073187, 61373028, and 61070154) and Guangzhou City Science and Technology Planning Project of China (11C42140691).
References
 X. Tong and M. Cui, “Image encryption with compound chaotic sequence cipher shifting dynamically,” Image and Vision Computing, vol. 26, no. 6, pp. 843–850, 2008. View at: Publisher Site  Google Scholar
 F. Sun, S. Liu, Z. Li, and Z. Lü, “A novel image encryption scheme based on spatial chaos map,” Chaos, Solitons and Fractals, vol. 38, no. 3, pp. 631–640, 2008. View at: Publisher Site  Google Scholar
 H. Liu and X. Wang, “Color image encryption based on onetime keys and robust chaotic maps,” Computers and Mathematics with Applications, vol. 59, no. 10, pp. 3320–3327, 2010. View at: Publisher Site  Google Scholar
 Z. Liu, Q. Guo, L. Xu, M. A. Ahmad, and S. Liu, “Double image encryption by using iterative random binary encoding in gyrator domains,” Optics Express, vol. 18, no. 11, pp. 12033–12043, 2010. View at: Publisher Site  Google Scholar
 G. Zhang and Q. Liu, “A novel image encryption method based on total shuffling scheme,” Optics Communications, vol. 284, no. 12, pp. 2775–2780, 2011. View at: Publisher Site  Google Scholar
 M. François, T. Grosges, D. Barchiesi, and R. Erra, “A new image encryption scheme based on a chaotic function,” Signal Processing, vol. 27, no. 3, pp. 249–259, 2012. View at: Publisher Site  Google Scholar
 S. M. Seyedzadeh and S. Mirzakuchaki, “A fast color image encryption algorithm based on coupled twodimensional piecewise chaotic map,” Signal Processing, vol. 92, no. 5, pp. 1202–1215, 2012. View at: Publisher Site  Google Scholar
 Z. Zhu, W. Zhang, K. Wong, and H. Yu, “A chaosbased symmetric image encryption scheme using a bitlevel permutation,” Information Sciences, vol. 181, no. 6, pp. 1171–1186, 2011. View at: Publisher Site  Google Scholar
 Z. Guan, F. Huang, and W. Guan, “Chaosbased image encryption algorithm,” Physics Letters A, vol. 346, no. 1–3, pp. 153–157, 2005. View at: Publisher Site  Google Scholar
 D. Xiao, X. Liao, and P. Wei, “Analysis and improvement of a chaosbased image encryption algorithm,” Chaos, Solitons and Fractals, vol. 40, no. 5, pp. 2191–2199, 2009. View at: Publisher Site  Google Scholar
 T. Gao and Z. Chen, “A new image encryption algorithm based on hyperchaos,” Physics Letters A, vol. 372, no. 4, pp. 394–400, 2008. View at: Publisher Site  Google Scholar
 C. E. Shannon, “Communication theory of secrecy systems,” Bell System Technical Journal, vol. 28, no. 4, pp. 656–715, 1949. View at: Google Scholar
 H. Liu and X. Wang, “Color image encryption using spatial bitlevel permutation and highdimension chaotic system,” Optics Communications, vol. 284, no. 1617, pp. 3895–3903, 2011. View at: Publisher Site  Google Scholar
 X. Wang and C. Jin, “Image encryption using Game of Life permutation and PWLCM chaotic system,” Optics Communications, vol. 285, no. 4, pp. 412–417, 2012. View at: Publisher Site  Google Scholar
Copyright
Copyright © 2014 Yuping Hu et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.