Page 1 of 15 COLOR IMAGE ENCRYPTION BASED ON LOGISTIC MAPPING AND DOUBLE RANDOM PHASE ENCODING HUIQING HUANG 1,2, SHOUZHI YANG 1, Abstract. In this paper, we propose a novel method to encrypt a color image by use of Logistic mapping and double random phase encoding. Firstly, use Logistic mapping to diffuse the color image, then the RGB components of the result are scrambled by replacement matrixes generated by Logistic mapping. Secondly, by utilizing double random phase encoding to encrypt the three scrambled images into one encrypted image. Experiment results reveal the fact that the proposed method not only can achieve good encryption result, but also that the key space is large enough to resist against common attack. 1. Introduction With the rapid development of networks, people s economic life is increasingly dependent on the network, so network security has become increasingly important in recent years. Data communications has become largely networking in nature with imaging capabilities being embedded in a myriad of portable devices, such as smart phones and tablet computers. Simultaneously, communication channels, such as internet and wireless networks, these techniques brings great convenience to our life, but it also brings new challenge to the privacy. To meet this challenge, various encryption algorithms have been Key words and phrases. Color image encryption; Double random phase encoding; Logistic mapping. Corresponding author. 1 Department of Mathematics, Shantou University, Shantou 51563, Guangdong, P. R. China, Email: szyang@stu.edu.cn. 2 School of Mathematics, Jiaying University, Meizhou 51415, Guangdong, P. R. China, email: hqhuang3@stu.edu.cn. This work was supported by the National Natural Science Foundation of China (Grant No. 1171152, 1161188, 6143164), the Natural Science Foundation of Guangdong Province (Grant No. 215A3313443). 1
Page 2 of 15 2 H. HUANG,S. YANG designed [2, 9, 15, 16, 17, 18, 21, 24, 25]. Such as image encryption based on pixel permutation, image encryption based on double random phase encoding, image encryption technology based on modern cryptography [1, 19], image encryption technology based on chaotic, etc. Among them, due to chaotic have shown some exceptionally good properties that are desirable for the cipher system, pseudo-randomness, extremely sensitive for initial value, ergodicity and a period, etc, more and more researchers pay attention to chaotic encryption algorithm. In [5], Socek et al. proposed a enhanced 1-D chaotic key-based algorithm for image encryption. A novel block cryptosystem based on iterating a chaotic map has been proposed in [7]. Later in 27, Li et al. [4] pointed out the encryption scheme presented in the reference [7] is not only insecure against chosen-plaintext attack, but also insecure against a differential known-plaintext attack. Subsequently, a new block based image shuffling is proposed to achieve good shuffling effect using two chaotic maps and the encryption of the shuffled image is performed using a third chaotic map to enforce the security of the proposed encryption process [1]. In recent years, plenty of color image encryption approaches have been proposed. In some encryption algorithms, color image is decomposed into the components of red, green and blue (RGB). The corresponding color components are encoded by an encryption method of gray-level image. The RGB components of color image are encrypted by chaotic systems. Chaos-based image encryption algorithm to encrypt color images by using Coupled Nonlinear Chaotic Map [3] has been reported. In [23], Liu et al. proposed a color image encryption by using the rotation of color vector in Hartley transform domains. Later in 211, Liu et al. [12] presented a color image encryption algorithm is designed by use of Arnold transform and discrete cosine transform. Subsequently, Chen et al. have reported a color image encryption based on the affine transform and gyrator transform [6]. Liu et al. [8] proposed a novel color image hiding scheme with three channels of cascaded Fresnel domain phase-only filtering. In this paper, we propose a color image encryption by use of Logistic mapping and phase encoding. Firstly, diffuse the color image by using Logistic mapping, then the RGB components of the result are scrambled and encoded by Logistic mapping and double random phase encoding. And finally the numerical results are given to illustrate the feasibility and effectiveness of the proposed algorithm.
Page 3 of 15 COLOR IMAGE ENCRYPTION BASED ON LOGISTIC MAPPING AND DRPE 3 Figure 1. The bifurcation graph of system (2.2) when λ [.49,.686] 2. Preliminaries for proposed technique 2.1. Logistic chaotic mapping. Logistic mapping is also known as pest model, it is a typical mathematical model for describing the evolution of species, which can be showed with a nonlinear repeated equation as follows [2]: x k+1 = µx k (1 x k ), (2.1) where µ is called branch parameter, and x k (, 1). Logistic mapping is in chaotic state when µ (3.5699456, 4] [22]. Logistic mapping can be generalized to the two-dimensional logistic mapping, which is defined as [13]: x k+1 = x k + λ(x k x 2 k + y k), y k+1 = y k + λ(y k yk 2 + x (2.2) k). When.6 < λ.686, the system of equations (2.2) is in chaotic state. The bifurcation graph shown in Fig. 1 with the initial point (.4,.5) and.49 λ.686. For more detailed analysis of the complex dynamics of the system, please see relative reference [13]. 2.2. Double random phase encoding. In 1995, Refregier and Javidi proposed the double random-phase encoding technique [11]. The encoded image is obtained by random-phase encoding in both the input and the
Page 4 of 15 4 H. HUANG,S. YANG Figure 2. Schematic of encryption Fourier planes. If two random-phase masks are used to encrypt the image in the input and Fourier planes, respectively, the input image is transformed into a complex-amplitude stationary white noise. Let f(x, y) denote the image to be encoded and g(x, y) denote the encoded image. Let ϕ(x, y) and φ(u, v) denote two independent white sequences uniformly distributed in [; 1], (x, y) and (u, v) denote the spatial plane and the Fourier plane coordinates, respectively. The encoding and decoding procedures are shown as follows. g(x, y) = F 1 {F{f(x, y)exp[i2πϕ(x, y)]}exp[i2πφ(u, v)]}, f(x, y) = F 1 {F{g(x, y)}exp[ i2πφ(u, v)]}exp[ i2πϕ(u, v)]. (2.3) where F and F 1 represent the Fourier transform and inverse Fourier transform, respectively. 3. The proposed color image encryption scheme This section presents the proposed scheme for color image encryption by using Logistic and phase encoding. Assume that the size of original color image I is N N. The schematic diagram of the proposed encryption is illustrated in Fig. 2, and the proposed image encryption algorithm consists of the following steps:
Page 5 of 15 COLOR IMAGE ENCRYPTION BASED ON LOGISTIC MAPPING AND DRPE 5 Step 1. Set the values of x, y, and λ. Step 2. For the size (N N) of the color image, after iterating the Logistic mapping of Eq. (2.2) for L times, we iterate the Logistic mapping continuously. For each iteration, we can get two values x i and y i. These decimal values are preprocessed first to get four decimal sequences U, V, W and Z, as shown in follows. U = {u 1, u 2,, u 3N 2}, V = {v 1, v 2,, v 3N 2}, (3.1) W = {w 1, w 2,, w 3N 2}, Z = {z 1, z 2,, z 3N 2}, where u i = 1 k x i floor(1 k x i ), v i = 1 k y i floor(1 k y i ), w i = floor((1 k x i floor(1 k x i ))1 k ) mod 256, z i = floor((1 k y i floor(1 k y i ))1 k ) mod 256. (3.2) Here floor(x) returns the nearest integer less than or equal to x, and mod returns the remainder after division. Step 3. By taking N successive elements of sequence U or V, a vector H = (u k+1,, u k+n ) is obtained, where k 3N 2 N. Then we reorder vector H from small to large order to get new vector H. Via H and H we can construct a scrambling matrix A, which satisfy H = H A. (3.3) So, by this way we can construct six scrambling matrixes A 1, A 2, A 3, A 4, A 5 and A 6. Step 4. By taking N N successive elements of sequence U, and we convert it into a random matrix Q 1 of size N N. Similarly, we can obtained another random matrix Q 2 by using sequence V. Step 5. Let M 1 (x, y) = exp(i2πq 1 ) and M 2 (x, y) = exp(i2πq 2 ) present the two random phase masks. Step 6. Reshape the sequences W and Z respectively, we obtain the three-dimensional matrixes Y and J with the same size as the original image, then we use the matrixes Y and J to diffuse the color image. This is mathematically represented as follows: F (i, j, k) = ((I(i, j, k) + Y (i, j, k)) mod 256) J(i, j, k). (3.4)
Page 6 of 15 6 H. HUANG,S. YANG Here i, j = 1, 2 256 and k = 1, 2, 3. The symbol represents the exclusive OR operation bit-by-bit. Step 7. The matrix F is converted into its RGB components. Afterwards, each colors matrix (R, G or B) is scrambled by scrambling matrixes {A i i = 1,, 6}. This is mathematically represented as follows: R = A 1 R A 2, G = A 3 G A 4, B = A 5 B A 6. (3.5) To enhance the security, we can perform more rounds this step, that is, multiple scramble. In this paper, we take 5 rounds. Step 8. The normalization is processed to the matrixes R, G, B, and we can obtain R, G, B, respectively. Step 9. Combine R (x, y) and G (x, y) to obtain the complex amplitude image Step 1. C(x, y) = R (x, y)exp(i2πg (x, y)). (3.6) C(x, y) is first multiplied by the first random phase mask M 1 (x, y), then transformed by FFT, the amplitude part B 1 (x, y) and phase part K 1 (x, y) of the result after FFT can be represented as respectively. B 1 (x, y) = P T {F[C(x, y)m 1 (x, y)]}, K 1 (x, y) = AT {F[C(x, y)m 1 (x, y)]}, (3.7) among them, P T {} denotes the extracting amplitude part operator, AT {} denotes the extracting phase part operator and F[] denotes the FFT. Step 11. Except replace FFT with IFFT in step 1, repeat steps 9-1 for B 1 (x, y), M 2 (x, y) and B (x, y), we can obtain B 2 (x, y) and K 2 (x, y). Then K 1, K 2 and B 2 are converted into a color image E. In the encryption process, E is saved for encrypted image. And the decryption is the reverse process of the encryption. 4. Numerical simulation and discussion Some numerical simulations are performed to verify the proposed encryption algorithm for one image. In the numerical simulations, color image of Lena having a size of 256 256 pixels is shown in Fig. 3(a) and serves as input original image. For convenience, the
Page 7 of 15 COLOR IMAGE ENCRYPTION BASED ON LOGISTIC MAPPING AND DRPE 7 (a) (b) (c) Figure 3. (a) Original color image; (b) The encrypted image; (c) The decrypted image. encryption key (λ, x, y, L) is fixed at (.65, 1,.1, 2), and it also is the decryption key. Fig. 3(b) shows the encrypted output for the original color image. It is observed that the encryption images is completely unintelligible, and does not reveal any information about the original color image. Fig. 3(c) shows the decrypted image with correct keys. 4.1. Key space and sensitivity analysis. It is well known that high sensitive to initial conditions is inherent to any chaotic system. A good image encryption algorithm should be sensitive to the cipher keys, and the key space should be large enough to make any brute-force attacks infeasible. Fig. 4(a) shows the decrypted image with an incorrect independent parameter x = 1 + 1 14, while the other keys are all correct. Fig. 4(b) is the decrypted image with an incorrect independent parameter y =.1 + 1 14, while the other keys are all correct. This is observed that even the tiny change of 1 14, the decrypted image is absolutely different from the plain image. Fig. 4(c) shows the decrypted image with an incorrect independent parameter λ =.65 + 1 16, while the other keys are all correct. So the key spaces for x, y and λ are S x = S y 1 14, S λ 1 16. The iteration times L is 16-bit integers, so S L = 2 16. The total key space S = S x S y S λ S L 6.5536 1 48. While AES is an acknowledged secure encryption algorithm and the key space of the 128-bit AES algorithm is about 2 128. So it can be seen that the proposed color image encryption algorithm is good at resisting brute-force attack. The
Page 8 of 15 8 H. HUANG,S. YANG (a) (b) (c) Figure 4. The decrypted images with a tiny change of the keys. key space of the proposed algorithm and the algorithms in [21], [5] and [16] are compiled in Table 1, which shows that the proposed algorithm has larger key space than them. Table 1. Comparison of key space. Algorithm Proposed algorithm Ref. [21] Ref. [5] Ref. [16] Key space 6.5536 1 48 2 8 2 128 2 78 The mean square error (MSE) between decrypted image and original image is an important factor to evaluate the key sensitivity of an image encryption algorithm: MSE = 1 M N 3 M N i=1 j=1 k=1 3 (I(i, j, k) H(i, j, k)) 2, where I(i, j, k) and H(i, j, k) mean the pixel values at point (i, y, k) of original color image and decrypted image, respectively. M N denotes the color image size. The MSE curves for x, L are computed and shown in Fig. 5. The MSE is very large with a little deviation to the correct keys and the MSE is very small only when the main keys are correct. Thus the decrypted image can be recognized if and only if the keys are correct. 4.2. Statistical analysis. By [14] we know the statistical attack is launched by exploiting the predictable relationship between data segments of the original and the encrypted image. So in order to demonstrating the proposed color image encryption having strongly resist statistical attacks, we test on the histograms of the enciphered images and on the correlations of adjacent pixels in the ciphered image.
Page 9 of 15 COLOR IMAGE ENCRYPTION BASED ON LOGISTIC MAPPING AND DRPE 9 1 (a) 1 (b) 9 9 8 8 7 7 6 6 MSE 5 MSE 5 4 4 3 3 2 2 1 1.5.6.7.8.9 1 1.1 1.2 1.3 1.4 1.5 x 1.994 1.996 1.998 2 2.2 2.4 2.6 L 1 4 Figure 5. MSE curves: (a) x and (b) L. (a) Red component Distribution 8 6 4 2 (b) Red (c) Green component.2.4.6.8 1 (d) Green Distribution 6 4 2 (e) Blue component.2.4.6.8 1 (f) Blue Distribution 8 6 4 2.2.4.6.8 1 Figure 6. Grayscale image of the original image of lena in the (a) red, (c) green, (e) blue components, histogram of the original image of lena in the (b) red, (d) green, (f) blue components. Histograms of RGB colors for the original and the encrypted image are indicated in Fig. 6 and Fig. 7, respectively. It is observed that the histogram of the encrypted image and histogram of the original image significantly different, it illustrates non-existent correlation between the two images. It is well known that adjacent image pixels are highly correlated either in horizontal, vertical or diagonal directions. To test the correlations of adjacent pixels in original image and encrypted image, randomly select 4 pairs of two adjacent pixels (in horizontal, vertical, and diagonal direction) from an image. Then, the correlation coefficient can be
Page 1 of 15 1 H. HUANG,S. YANG (a) Red component 6 (b) Red Distribution 4 2 (c) Green component.2.4.6.8 1 (d) Green 6 Distribution 4 2 (e) Blue component.2.4.6.8 1 (f) Blue Distribution 1 5.2.4.6.8 1 Figure 7. Grayscale image of the encrypted image of lena in the (a) red, (c) green, (e) blue components, histogram of the encrypted image of lena in the (b) red, (d) green, (f) blue components. calculated by using the following formulas [3]: r xy = E(x) = 1 N D(x) = 1 N cov(x, y) D(x) D(y) (4.1) N x i (4.2) i=1 N (x i E(x)) 2 (4.3) i=1 cov(x, y) = 1 N N (x i E(x))(y i E(y)) (4.4) i=1 where x and y denote two adjacent pixels and N is the total number of duplets (x, y) obtained from the image. The results of correlation analysis are showed in Table 2. The result indicates that the correlation of two adjacent pixels of the original image is close to 1 in each direction of each component, while that of the encrypted image is close to in each direction of each component, so the encryption effect is rather good. 4.3. Robustness analysis.
Page 11 of 15 COLOR IMAGE ENCRYPTION BASED ON LOGISTIC MAPPING AND DRPE 11 Table 2. Correlation coefficients of two adjacent pixels in two images. Scan direction Horizontal Vertical Diagonal Original image Red.9566.9812.9295 Green.9432.9695.9199 Blue.9269.9586.92 Encrypted image Red.27 -.13.39 Green.34 -.34 -.21 Blue.46.38.13 In this section, we focus on analyzing performance of the proposed algorithm in noisy and lossy. In the first test, we check the tolerance against the loss of encrypted data. We occlude 1.5625%, 25% and 5% of the encrypted image pixels. Fig. 8(a)-(c) indicates the occluded encrypted images of Fig. 3(b), while Fig. 8(e)-(h) illustrates the decrypted output for these images. As we can see, in the case of the small percentage pixels of Fig. 3(b) are occluded, in addition to having some noise, the decryption image and original image pretty much the same. while in the case of large percentage pixels of Fig. 3(b) are occluded, although only some information about the original image can be retrieved from the decrypted output, the basic outline of the original image can be retrieved. In the second test, we employ three noises in the simulation, which are random noise, Speckle noise and Gaussian noise, respectively. The noise effected encrypted images are then decrypted, output for which is shown in Fig. 9, Fig. 9(a) shows the recovered image when a random noise is added to the encrypted image of Fig. 3(b). Fig. 9(b) shows the recovered image when speckle noise of variation.1 is added to the encrypted image of Fig. 3(b). Fig. 9(c) shows the recovered image when a Gaussian noise with a zero mean and standard deviation of.1 is added to the encrypted image of Fig. 3(b). As shown in Fig. 9, the recovered image in high noise polluted, but some information about the original image can be retrieved from the decrypted output. By above tests, it is shown that the presented algorithm can decrypt the approximate image to the original image even if the encrypted image has been damaged. Therefore, the proposed algorithm has good robustness. 4.4. Differential analysis.
Page 12 of 15 12 H. HUANG,S. YANG (a) (b) (c) (d) (e) (f) Figure 8. The occluded encrypted images of Fig. 3(b) and the corresponding recovered images with correct keys. (a) (b) (c) Figure 9. Decrypted output for noise attacked images. We have also measured the number of pixels change rate (NPCR) to see the influence of changing a single pixel in the original image on the encrypted image by the proposed algorithm. The N P CRR,G,B measure the number of pixels in difference of a colour component between two images. We take two encrypted images, CR,G,B and CR,G,B, whose corresponding original images have only one-pixel difference. We also define a two dimensional array D, having the same size as the image CR,G,B (i, j) or CR,G,B (i, j). The DR,G,B (i, j) is determined from CR,G,B (i, j) and CR,G,B (i, j). If CR,G,B (i, j) = CR,G,B (i, j) then DR,G,B (i, j) = otherwise DR,G,B (i, j) = 1. The N P CRR,G,B is evaluated through
Page 13 of 15 COLOR IMAGE ENCRYPTION BASED ON LOGISTIC MAPPING AND DRPE 13 the following formula [15]: NP CR = i,j D R,G,B(i, j) 1%, (4.5) N M where N M is the color image size. In order to test our proposed scheme, each color component is encrypted first. Then, one similar pixel in each component is randomly selected and toggled. The modified component is encrypted again by using the same keys so as to generate a new ciphercomponent. And the expected values are presented in Table 3. From Table 3, it can be found that the percentage of pixel changed in the cipher image is over 99.9985% even with a one-bit difference in the plain-image. Thus, the proposed encryption scheme is able to resist the differential attack. Table 3. Sensitivity to plaintext Lena Red Green Blue NPCR.999985.999985.999985 5. Conclusion By combining Logistic mapping with double random-phase encoding, a novel color image encryption algorithm is proposed. To encrypting original color image involves the XOR, fully phase encoding and pixel scrambling techniques. We use the Logistic mapping to diffuse the color image, then the RGB components of the result is scrambled and encoded by Logistic mapping and double random phase encoding. The performance is analyzed with numerical simulations, it is shown that the key space of the new algorithm is large enough to make brute-force attacks infeasible, and is sensitive to the parameters of Logistic mapping during decryption. Robustness analysis in lossy and noisy demonstrate the proposed method is robust against the loss of data. References [1] M. Ahmad and M. S. Alam. A new algorithm of encryption and decryption of images using chaotic mapping. International Journal on computer science and engineering, 2(1): 46 5, 29.
Page 14 of 15 14 H. HUANG,S. YANG [2] R. Rhouma, S. Meherzi, S Belghith. Ocml-based colour image encryption. Chaos, Solitons and Fractals, 4: 39 318, 29. [3] S. Mazloom, A. M. Eftekhari-Moghadam. Color image encryption based on coupled nonlinear chaotic map. Chaos, Solitons and Fractals, 42: 1745 1754, 29. [4] C. Li, S. Li, G. Alvarez, et al. Cryptanalysis of two chaotic encrypion schemes based on circular bit shift and xor operations. Physics Letters A, 369(1): 23 3, 27. [5] D. Socek, S. Li, S. M. Spyros, et al. Enhanced 1-D chaotic key-based algorithm for image encryption. In First International Conference on Security and Privacy for Emerging Areas in Communications Networks (SECURECOMM 5), pages 46 47. IEEE, 25. [6] H. Chen, X. Du, Z. Liu, et al. Color image encryption based on the affine transform and gyrator transform. Optics and Lasers in Engineering, 51(6): 768 775, 213. [7] T. Xiang, X. Liao, G Tang, et al. A novel block cryptosystem based on iterating a chaotic map. Physics Letters A, 349(1-4): 19 115, 26. [8] Z. Liu, C. Guo, J. Tan, et al. Securing color image by using phase-only encoding in fresnel domains. Optics and Lasers in Engineering, 68: 87 92, 215. [9] N. Taneja, B. Raman, I. Gupta. Selective image encryption in fractional wavelet domain. Int. J. Electron. Commun, 65: 338 344, 211. [1] W. Diffe, M. Hellman. New directions in cryptography. IEEE Trans on Information Theory, IT-22(6): 644 654, 1976. [11] P. Refregier, B. Javidi. Optical image encryption based on input plane and fourier plane random encoding. Optics Letters, 2(7): 767 769, 1995. [12] Z. J. Liu, L. Xu, T. Liu. Color image encryption by using arnold transform and color-blend operation in discrete cosine transform domains. Optics Communications, 284: 123 128, 211. [13] X. Y. Wang, C. Luo. Bifurcation and fractal of the coupled logistic maps. Acta Mechanica Sinica, 37(3): 346 355, 25. [14] A. Marion. An introduction to image processing. Chapman and Hall,London, 1991. [15] S. M. Seyedzadeh, S. Mirzakuchaki. A fast color image encryption algorithm based on coupled two-dimensional piecewise chaotic map. SignalProcessing, 92: 122 1215, 212.
Page 15 of 15 COLOR IMAGE ENCRYPTION BASED ON LOGISTIC MAPPING AND DRPE 15 [16] S. N. George, D. P. Pattathil. A secure lfsr based random measurement matrix for compressive sensing. Sensing and Imaging, 15(1): 1 29, 214. [17] K. Martin, R. Lukac, K. N. Plataniotis. Efficient encryption of wavelet-based coded color images. Pattern Recognition, 38: 1111 1115, 25. [18] R. Lukac, K. N. Plataniotis. A cost-effective encryption scheme for color images. Real-Time Imaging, 11: 454 464, 25. [19] C. E. Shannon. Communication theory of secrecy systems. Bell System Technical Journal, 28(4): 656 715, 1949. [2] W. F. Shi. Research on logistic map and its chaotic characteristics. Electro-optic Technology Application, (2): 53 56, 24. [21] N. K. Pareek, V. Patidar, K. K. Sud. Image encryption using chaotic logistic map. Image and Vision Computing, 24(9): 926 934, 26. [22] J. Yang, J. Gao, B Sun. An improved approach of logistic chaotic series encryption. Automatic Technology and Application, 23(4): 58 61, 24. [23] Z. Liu, J. Dai, X. Sun. Color image encryption by using the rotation of color vector in hartley transform domains. Optics and Lasers in Engineering, 48(7): 8 85, 21. [24] W. Chen, C. Quan, C. J. Tay. Optical color image encryption based on arnold transform and interference method. Optics Communications, 282: 368 3685, 29. [25] H. Liu, X. Wang. Color image encryption using spatial bit-level permutation and high-dimension chaotic system. Optics Communications, 284: 3895 393, 211.