Image Encryption with Logistic Map and Cheat Image - IEEE Xplore

1 downloads 0 Views 3MB Size Report
Abstract—This paper proposes a novel confusion and diffusion algorithm for image encryption based on logistic map and cheat image. We choose the initial ...
Image Encryption with Logistic Map and Cheat Image

Zhang Yong School of Software and Communication Engineering Jiangxi University of Finance and Economics Nanchang, P.R. China E-mail: [email protected] characteristic of the cryptosystem in Section III. Finally, we conclude the paper in Section IV.

Abstract—This paper proposes a novel confusion and diffusion algorithm for image encryption based on logistic map and cheat image. We choose the initial condition and control parameter of logistic map as the secret key. The cheat image selected from the most common images in public network, together with the chaotic matrices generated by logistic maps, is employed both in encryption and decryption processes to encrypt and recover the plain image. One cheat image can be used to encrypt a great number of plain images if the cheat image does not attract the attention of the attackers. The computer experiments such as statistical analysis, sensitivity analysis, differential attack analysis and cheat characteristic analysis, prove that the proposed image encryption algorithm is robust and secure enough to be used in practical communication.

A. Logistic Map Logistic map shown in (1) is a discrete chaotic system when the parameter μ satisfies 3.57μ4. Here, the initial value x0 and the parameter μ are regarded as the secret key. xn+1 = μxn(1−xn)

(1)

As for the initial value x0=0.12345678 and the parameter μ=3.99995, the 300-point time series and phase portrait are shown in Fig. 1, in which the 100 transient points are discarded. From Fig. 1, we can see the time sequence generated by logistic map has good stochastic property.

Keywords-image encryption; logistic map; cheat image; confusion; diffusion

1.0

1.0

INTRODUCTION

0.8

0.6

0.6

xn

At present, the image information security becomes a world-wide problem which absorbs a great number of researchers to study the robust and secure image cryptosystems to protect the valuable images from leakage. The chaotic systems have some fundamental properties such as ergodicity, mixing property and sensitivity to initial conditions/system parameters, which are analogous to some ideal cryptographic properties, i.e. confusion, diffusion, balance and avalanche properties, et al. The image cryptosystem based on chaotic systems was first proposed in 1998 [1], and since then, many chaotic cryptosystems have been suggested to realize secure image encryption [2-4], among which, the researchers preferred using the high dimensional chaotic maps to the low dimensional ones. It is well known that some image encryption schemes can be easily decrypted by known/chosen plain image attacks. By far, the cryptosystems described in [6-9] have been cryptanalyzed in [10-14], which promotes the researchers to develop new cryptosystems for image encryption. In this paper, a novel image encryption scheme based on logistic map and cheat image is proposed, which is available for resisting the known/chosen plain image attack. We choose one of the most common images in public network as cheat image, and employ it to encrypt the plain image, together with the logistic map generated matrices. We will discuss the proposed cryptosystem in Section II, and analyze the security

0.4

0.4

0.2

0.2

0

(b)

(a)

0.8

x n+1

I.

IMAGE ENCRYPTION SCHEME

II.

0 0

50

100

150

n

200

250

300

0

0.2

0.4

0.6

0.8

1.0

xn

Figure 1. Logistic map. Frame (a) shows the 300-point time series of logistic map with x0=0.12345678 and μ=3.99995, and Frame (b) represents the phase portrait of Frame (a).

B. Pemutation Matrix As for an 8-bit grey scale image A, which matrix is of size M×N, can be represented as a linear array of size 1×MN. Construct array P each value of which represents the pixel location of image A. Given an initial value x0 and parameter μ, use (1) to generate an array X of size 1×MN, then calculate P(i) = int(108X(i)) mod MN +1. Here P is called permutation matrix. The value of P(i) indicates the position (j,k) of element A(j,k) denoted as A(P(i)), where j = (P(i)−1) / N + 1, k = P(i) − N(j−1). For i = 1 to MN, exchange the element A(i) with A(P(i)) to get the confused image Ap, and here A(i) is at the pixel position (j,k) of image A, where j = (i−1) / N + 1, k = i − N(j−1). C. Encryption Scheme Suppose the plain image A is of size M×N, and we choose one of the most common images as cheat image B,

___________________________________ 978-1-61284-840-2/11/$26.00 ©2011 IEEE

97

After getting the matrix Ap, we can derive the original image A from Ap with the use of permutation matrix P1.

whose size is the same as the plain image A. The proposed encryption algorithm can be described in six steps as follows. Step 1. Set secret key by {x0, μ, m, n}, where m and n are positive integers which will be used in Step 4, then use (1) to generate two permutation arrays P1 and P2. Step 2. Use P1 and P2, respectively, permute the plain image A and cheat image B to get matrices Ap and Bp. Step 3. According to (2), an initial matrix X0 for logistic map is derived from Bp. X0(i,j) = 0.1 + 0.8Bp(i,j)/255

E. Computer Experiment We choose the secret key as {0.12345678, 3.99995, 1, 1}, and the plain image A and cheat image B are shown in Fig. 2a and 2b, respectively. The cipher image D is shown in Fig. 2c. Finally, Fig. 2d shows the decrypted image which is exactly equal to image A.

(2)

where i=1 to M, j=1 to N. Step 4. Employ (1) and X0 to iterate n times and n+m times to get matrices Xn and Xn+m, respectively. Step 5. Get matrices Q1 and Q2 from Xn and Xn+m by the methods shown in (3). Q1(i,j) = int(104Xn(i,j)) mod 256 Q2(i,j) = int(104Xn+m(i,j)) mod 256

(3)

where i=1 to M, j=1 to N. Step 6. Forward couple the matrices Ap, Bp and Q1 to get matrix C as shown in (4), then backward diffuse the matrices C, Bp and Q2 to obtain matrix D as in (5), and the matrix D is the cipher image. ­ Ap (i, j ) ⊕ B p (i, j ) ⊕ Q1 (i, j ), i = j =1 °  C (i, j − 1), 1 ≤ i ≤ M ,1 < j ≤ N C (i, j ) = ® Ap (i, j ) ⊕ B p (i, j ) ⊕ Q1 (i, j ) ⊕ ° A (i, j ) ⊕ B (i, j ) ⊕ Q (i, j ) ⊕  C (i − 1, N ), 1 < i ≤ M , j = 1 p 1 ¯ p

­C (i, j ) ⊕ Q2 (i, j ), i = M, j = N °  D(i + 1, j ), 1 ≤ i < M ,1 ≤ j ≤ N D(i, j ) = ®C (i, j ) ⊕ Q2 (i, j ) ⊕ °C (i, j ) ⊕ Q (i, j ) ⊕  D(1, j + 1), i = M ,1 ≤ j < N 2 ¯

6000

1000

2000

500

0

100

200

300

0

(f)

0

100

200

300

Figure 2. The experimental results. Frames (a) and (c) are the plain image A and cipher image D respectively. Frame (b) shows the cheat image B. Frame (d) is the decrypted image. Frames (e) and (f) represent the histograms of plain image A and cipher image D, respectively.

D. Decryption Scheme The decryption process is analogous to the encryption process except that Step 6 in encryption scheme is performed in reverse order shown in (6) and (7).

­C (i, j ) ⊕ B p (i, j ) ⊕ Q1 (i, j ), i = j =1 °  C (i, j − 1), 1 ≤ i ≤ M ,1 < j ≤ N Ap (i, j ) = ®C (i, j ) ⊕ B p (i, j ) ⊕ Q1 (i, j ) ⊕ °C (i, j ) ⊕ B (i, j ) ⊕ Q (i, j ) ⊕  C (i − 1, N ), 1 < i ≤ M , j = 1 p 1 ¯

1500

4000

0

(5)

 ” means addition where “⊕” denotes XOR operation, and “ ⊕ and modulus 256.

­ D(i, j ) ⊕ Q2 (i, j ), i = M, j = N °  D(i + 1, j ), 1 ≤ i < M ,1 ≤ j ≤ N C (i, j ) = ® D(i, j ) ⊕ Q2 (i, j ) ⊕ ° D(i, j ) ⊕ Q (i, j ) ⊕  D(1, j + 1), i = M ,1 ≤ j < N 2 ¯

(e)

(4)

III.

SECURITY AND PERFORMANCE ANALYSIS

A good encryption scheme should be robust against all kinds of cryptanalytic, statistical and brute-force attacks. In this section, we will discuss the security characteristics of the proposed encryption scheme by means of statistical analysis, sensitivity analysis, differential analysis, information analysis and cheat characteristic analysis, et al.

(6)

A. Statistical Analysis To prove the proposed cryptosystem against any statistical attack, the histograms and the correlations of two adjacent pixels in the cipher images are analyzed in following part. 1) Histogram analysis The histograms of several cipher images as well as their plain images have been analyzed, and one example of such

(7)

98

histogram analysis is shown in Fig. 2e and Fig. 2f. Frame (e) of Fig. 2 is the histogram of the plain image shown in Fig. 2a, and Fig. 2f show the histogram of the cipher image shown in Fig. 2c. From Fig. 2, it is clear that the histogram of the cipher image is fairly uniform and significantly different from the histogram of plain image, and hence the proposed encryption scheme can resist the statistical attack. 2) Correlation coefficient analysis It is known that each pixel of plain image is always highly correlated with its adjacent pixels in horizontal, vertical or diagonal directions. We define the correlation coefficient of image A (size of M×N) as follows in (8)-(13).

rHori ( A) =

1 M −1 N −1 ¦¦ ( A(i, j ) − E ( A) )( A(i + 1, j + 1) − E ( A) ) M × N i=1 j =1

cov Hori ( A) D ( A)

, rVert ( A) = covVert ( A) , D ( A)

rDiag ( A) =

cov Diag ( A) D ( A)

D ( A) =

M N 1 ¦¦ A(i, j ) M × N i=1 j =1

100

0

100

200

300

(c)

0

200

100

100

0

100

200

300

(e)

0

200

100

100

0

100

200

300

0

100

200

0

300

(d)

0

100

200

300

200

0

(b)

300

200

300

300

(f)

0

100

200

300

Figure 3. Correlation of two adjacent pixels. Frames (a) and (b), respectively show the distributions of two horizontal adjacent pixels in the plain image shown in Fig. 2a and cipher image shown in Fig. 2c. Frames (c) and (d) represent the distributions of the vertical adjacent pixels in the plain image (Fig. 2a) and the cipher image (Fig. 2c). Frames (e) and (f) represent the distributions of the diagonal adjacent pixels in the plain image (Fig. 2a) and the cipher image (Fig. 2c).

(11)

where E ( A) =

100

0

(10)

300

200

300

N M −1 1 ( A(i, j ) − E ( A) )( A(i + 1, j ) − E ( A) ) (9) ¦¦ M × N j =1 i=1

covVert ( A) =

(a)

200

0

M N −1 1 ( A(i, j ) − E ( A) )( A(i, j + 1) − E ( A) ) (8) ¦¦ M × N i =1 j =1

cov Hori ( A) =

cov Diag ( A) =

300

(12)

M N 1 2 ( A(i, j ) − E ( A) ) ¦¦ M × N i=1 j =1

B. Sensitivity Analysis An ideal image encryption algorithm should be sensitive with respect to the secret key, which means the small change of the secret key would produce a completely different encrypted image. As an example, the plain image shown in Fig. 4a is encrypted by using the secret key {0.12345678001, 3.99995, 1, 1}, {0.12345678, 3.99995, 1, 1}, and {0.12345677999, 3.99995, 1, 1} respectively to get cipher images shown in Fig. 4b-4d. In the encryption process, the cheat image used is the same as the Fig. 2b. The correlation coefficients between these cipher images (Fig. 4b-4d) are listed in Table II. Moreover, we use the secret key {0.12345678001, 3.99995, 1, 1} and {0.12345677999, 3.99995, 1, 1} to decrypt the cipher image (Fig. 4c) to get the images shown in Fig. 4e-4f. The correlation coefficients between the plain image (Fig. 4a) and the decrypted images (Fig. 4e-4f) are also listed in Table II. From Table II, we can see the correlation coefficients are very small, so it is clear that the proposed cryptosystem is highly key sensitive.

(13)

The subscripts “Hori”, “Vert” and “Diag” in (8)-(11) represent the horizontal, vertical and diagonal coefficients, respectively. As an example, the correlation properties of plain image shown in Fig. 2a and cipher image shown in Fig. 2c are illustrated in Fig. 3, and their correlation coefficients are listed in Table I. It is clear from Fig. 3 and Table I that two adjacent pixels in the plain image are highly correlated, and however two adjacent pixels in the cipher image are nearly unrelated. TABLE I.

CORRELATION COEFFICIENTS FOR THE TWO ADJACENT PIXELS IN THE PLAIN AND ENCRYPTED IMAGE SHOWN IN FIG. 2. Plain image (Fig. 2a)

Encrypted image (Fig. 2c)

Horizontal

0.9381

0.0016

Vertical

0.9713

-0.0006

Diagonal

0.9222

-0.0012

C. Key Space Analysis For a secure image encryption scheme, the key space should be large enough to make the brute-force attack infeasible. The key space of the proposed cryptosystem can be designed to be over 1020 which are sufficient for reliable

99

practical use. Further, if the cheat image is considered as some kind of secret key, the proposed encryption scheme has an infinite large key space. We will discuss this in the Part F.

Figure 5. Cheat characteristic analysis. Frame (a) is the plain image. Frame (b) shows the cipher image using secret key {0.12345678, 3.99995, 1, 1} and cheat image shown in Fig. 2b. Frames (c) and (d) represent the wrong cheat images used by the attacker. Frames (e) and (f) show the images after decryption of the image (Frame (a)) using right secret key and wrong cheat images shown in Frames (c) and (d).

Figure 4. Key sensitivity test. Frame (a) shows the plain image. Frames (b), (c) and (d) respectively show the encrypted images using the secret keys {0.12345678001, 3.99995, 1, 1}, {0.12345678, 3.99995, 1, 1}, and {0.12345677999, 3.99995, 1, 1}. Frames (e) and (f) respectively, show the images after the decryption of the encrypted image shown in Frame (c) using the secret keys {0.12345678001, 3.99995, 1, 1} and {0.12345677999, 3.99995, 1, 1}. In the above processes, the cheat image is the same as the Fig. 2b.

D. Differential Attack We calculate the number of pixels change rate (NPCR) to see the influence of changing a single pixel in the plain image on the encrypted image by the proposed image encryption algorithm. The NPCRs for some images of USCSIPI image database (freely available at http://sipi.usc.edu/database) are tested to be over 99% showing thereby that the proposed scheme is very sensitive with respect to small changes in the plain image and can resist the chosen plain image attacks.

TABLE II.

CORRELATION COEFFICIENTS BETWEEN THE PLAIN IMAGE AND ENCRYPTED/DECRYPTED IMAGES SHOWN IN FIG. 4.

Image 1

Image 2

Encrypted image (Fig. 4b)

Encrypted image (Fig. 4c)

Correlation coefficient -0.0013

Encrypted image (Fig. 4b)

Encrypted image (Fig. 4d)

0.0030

Encrypted image (Fig. 4c)

Encrypted image (Fig. 4d)

-0.0002

Plain image (Fig. 4a)

Decrypted image (Fig. 4e)

-0.0018

Plain image (Fig. 4a)

Decrypted image (Fig. 4f)

-0.0015

E. Information Entropy Analysis For a 256-level grey scale image A, its information entropy H(A) is defined as the following form 255 § 1 · H ( A) = ¦ p (i )log 2 ¨ ¸ i =0 © p(i ) ¹

(14)

where p(i) represents the probability of i-th level grey pixels, i.e. p(i) = (the number of pixels whose quantities are equal to i) / (the total number of image pixels). Theoretically, the

100

maximum entropy of 256-level grey image is 8. The entropy value of a grey image is more close to 8, and its noisy characteristic becomes more apparent. The information entropy values of some images of USC-SIPI image database are calculated by using (14) and the results are over 7.99 to show that the proposed scheme is secure against the entropy attack.

REFERENCES [1] [2]

F. Cheat Charateristic Analysis The proposed encryption scheme is a novel method particularly in that it needs an assistant image called cheat image to fulfill the encryption and decryption processes. The cheat image may theoretically be any image, but those images frequently appeared in public network are expected to be cheat images which are easily neglected by attackers. Assume that the attacker obtains the secret key and the procedure of encryption scheme, without knowing the cheat image, the cipher image is still secure. As an example, in Fig. 5, the plain image (Fig. 5a) is encrypted into the cipher image (Fig. 5b) by using the secret key {0.12345678, 3.99995, 1, 1} and the cheat image shown in Fig. 2b. The attacker uses the wrong cheat images (Fig. 5c-5d, and further the Fig. 5d is only one pixel different form the real cheat image shown in Fig. 2b) to decrypt the cipher image (Fig. 5b) and then obtains the images shown in Fig. 5e-5f. We can see from Fig. 5 that knowing secret key without cheat image is impossible to decrypt the cipher image. IV.

[3]

[4] [5]

[6]

[7]

[8] [9] [10]

[11]

CONCLUSION [12]

In this paper, we propose a novel algorithm for image encryption based on logistic map and the cheat image. The initial condition and control parameter of logistic map serve as the secret key. We choose one of the most common images as the cheat image which, together with the diffusion and confusion matrices generated by logistic map, is employed to cipher the plain image. The security characteristics are discussed in detail to demonstrate that the proposed cryptosystem is robust and secure.

[13]

[14]

101

J. Fridrich, “Symmetric ciphers based on two-dimensional chaotic maps,” Int. J. Bifur. Chaos, vol. 8(6), 1998, pp. 1259–1284. X. Tong and M. Cui, “Image encryption with compound chaotic sequence cipher shifting dynamically,” Image. Vision. Comput, vol. 26(6), 2008, pp. 843–850. K. W. Wong, BS. H. Kwok and W. S. Law, “A fast image encryption scheme based on chaotic standard map,” Phys. Lett. A, vol. 372(15), 2008, pp. 2645–2652. S. Lian, “Efficient image or video encryption based on spatiotemporal chaos system,” Chaos. Soliton. Fract, vol. 40(5), 2009, pp. 2509–2519. S. Behnia, A. Akhshani, H. Mahmodi and A. Akhavan, “A novel algorithm for image encryption based on mixture of chaotic maps,” Chaos. Soliton. Fract, vol. 35(2), 2008, pp. 408–419. N. K. Pareek, V. Patidar and K. K. Sud, “Discrete chaotic cryptography using external key,” Phys. Lett. A, vol. 309(1–2), 2003, pp. 75–82. A. N. Pisarchik, N. J. Flores-Carmona and M. Carpio-Valadez, “Encryption and decryption of images with chaotic map lattices,” Chaos, vol. 16(3), 2006, pp. 033118–033123. N. Pareek, V. Patidar and K. K. Sud, “Image encryption using choatic logistic map,” Image. Vision. Comput, vol. 24(9), 2006, pp. 926–934. A. N. Pisarchik and M. Zanin, “Image encryption with chaotically coupled chaotic maps,” Physica D, vol. 237(20), 2008, pp. 2638–2648. G. Alvarez, F. Montoya, M. Romera and G. Pastor, “Cryptanalysis of a discrete chaotic cryptosystem using external key,” Phys. Lett. A, vol. 319(3–4), 2003, pp. 334–339. D. Arroyo, R. Rhouma, G. Alvarez, S. Li and V. Fernandez, “On the security of a new image encryption scheme based on chaotic map lattices,” Chaos, vol. 18(3), 2008, pp. 033112–033118. E. Solak and C. Cokal, “Comment on ‘Encryption and decryption of images with chaotic map lattices’,” Chaos, vol. 18(3), 2008, pp. 038101–038103. C. Li, S. Li, M. Asim, J. Nunez, G. Alvarez and G. Chen, “On the security defects of an image encryption scheme,” Image. Vision. Comput, vol. 27(9), 2009, pp. 1371–1381. D. Arroyo, S. Li, J. M. Amigo, G. Alvarez and R. Rhouma, “Comments on ‘image encryption with chaotically coupled chaotic maps’,” Physica D, vol. 239(12), 2010, pp. 1002–1006.

Suggest Documents