Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

2012 IEEE Symposium on Computers & Informatics

Image Encryption Using Random Pixel Permutation


by Chaotic Mapping
G.A.Sathishkumar1, Srinivas Ramachandran2 Dr.K.Bhoopathy Bagan
Associate Professor1, Under Graduate Student2 Professor
Department of Electronics and Communication Department of Electronics
Madras Institute of Technology
Engineering1,2
Anna University Chrompet Campus
Sri Venkateswara College of Engineering1,2 Chennai, India
Sriperumbudur1,2, Chennai, India Email:kboopathy02@yahoo.com
Email:sathish@svce.ac.in1, srini.ecec@gmail.com2

Abstract— With the fast evolution of digital data exchange, scrambling the pixels [7] and [11]. We have proposed a new
security of information becomes much important in data storage image encryption scheme which provides reasonable security
and transmission. Due to the increasing use of images in even if the generated random sequence from chaotic maps has
industrial processes, it is essential to protect confidential images short periodic orbits. In the proposed algorithm, the pixels of
from unauthorized access. We have proposed a new image
the plaintext image are first scrambled using a pseudorandom
encryption algorithm using random pixel permutation based on
chaos logistic maps and prime modulo multiplicative linear sequence generated using prime modulo multiplicative linear
congruential generators. The random-like nature of chaos is congruential generators (PMMLCG) and then the pixels are
effectively spread into the encrypted image through permutation permuted and transformed using chaos logistic maps. The
and transformation of pixels in the plain image. The pixel pixels in the image are permuted using the pseudorandom
transformation results in the encryption scheme being resistive to sequence as the index of the row or column to be permuted.
cryptanalytic attacks. Simulation results show high sensitivity to However, the pseudorandom permutation discussed above
key, plaintext and cipher text changes. From a cryptanalytic should be repeated several times to provide reasonable
point of view, the scheme is highly resistive to known/chosen security since this approaches shuffles image pixels locally.
plaintext and cipher text attacks. The proposed technique gives
Through the proposed scheme, our main goals are to achieve
good parametric and sensitivity results proving itself an eligible
candidate for image encryption. Moreover it is a lossless high level of security and high robustness against statistical
encryption technique and hence apt for securing medical and cryptanalysis. The remainder of the paper is organized as
military image. follows. In Section II, description of the overall framework of
the proposed image encryption scheme is presented and the
Keywords- Image encryption; Non-linear chaotic dynamic construction of the primitive pseudorandom sequences and
system; Stream generator; Security analysis; Cryptography. chaotic maps is discussed in detail. Section III evaluates the
security of the proposed algorithm via several randomness
I. INTRODUCTION tests and compares it with earlier techniques. Finally, in
With rapid developments in the multimedia and Section IV the conclusion of the paper is presented.
communications industry, a great deal of concern has been II. PROPOSED IMAGE ENCRYPTION TECHNIQUE
raised regarding the security of an image transmitted or stored
over open channels. A major challenge is to protect the The proposed technique first generates a prime modulo
confidentiality of such images in wired and wireless networks. multiplicative linear congruential generator sequence and a
The most effective method is to encrypt the image so that only chaos logistic sequence. The effectiveness of the algorithm
authorized entities with the key can decrypt them. The depends on the randomness of the generated sequences. The
limitations on using encryption for securing images are: (1) PMMLCG sequence is generated depending on the input
Perceptual quality control - An image encryption algorithm secret key and the chaotic binary sequence is generated
can be used to intentionally degrade the quality of the image. depending on the size of the image, secret key and the
However, the degradation must be visually unperceivable, (2) predefined value of µ (3.9876543210001, 4). The choice of µ
Real-time constraint - In many multimedia applications, very affects the dynamics of the system and guarantees the chaotic
efficient encryption and decryption algorithms are needed to state of the system with perfect randomness. The initial seed
access images in a real-time environment. As one of the speed for the random sequence generators are derived from the
up techniques, selected parts of the images are encrypted. secret key, thereby making the technique highly sensitive to
Most chaos-based encryption schemes, are based on key changes. The sequences are then used to scramble the
permutation, and basically produce a long random sequence position of pixels in the plain image and the values of pixels
by using chaos maps as pseudorandom number generators and are transformed by simple bitwise XOR operation between
encrypt a plain image by swapping the original coordinates of adjacent pixel values. The algorithm of the proposed technique
pixels with the random sequence generated, thereby is illustrated in Fig. 1 and described below.

978-1-4673-1686-6/12/$26.00 ©2012 IEEE 247


x1 , x2 ,...xk ,...x N  Step 2: Permute the ith row of the image I with the xith row and
PMMLCG XOR pixel values in adjacent rows. Permute the kth column
Plain image
{MxN} with xkth column and XOR pixel values in adjacent columns,
x1, x2 ,...xk ,...xM  for all values of i from 1 to M and k from 1 to N.
Step 3: If i=M and k = N, end the iteration. Otherwise,
Row scrambling increment i and k and Repeat the previous step.
Step 4: Scramble each pixel I(i, j) in the image to a position
XOR pixels in adjacent rows I(xi , xk ), with xi taken from one sequence and xk taken from the
other.
Step 5: Similarly, we can have an arbitrary chaotic iteration,
Column scrambling xn1   ( xn )(1  xn ) where xn  (0,1) (2)
to generate two chaotic sequences of real numbers of lengths
M and N respectively. The initial seed value x0 for one of the
XOR pixels in adjacent columns
sequences is derived from the secret key and the first element
of this sequence is used as the initial seed for the second
Scramble each pixel sequence.
Step 6: Permute the ith row of the image I with the xith row and
XOR pixel values in adjacent rows. Permute the kth column
x1 , x2 ,...xk ,...x N  with xkth column and XOR pixel values in adjacent columns,
Chaos map for all values of i from 1 to M and k from 1 to N.
Step 7: If i=M and k = N, end the iteration. Otherwise,
increment i and k and repeat the previous step.
x1, x2 ,...xk ,...xM  Step 8: XOR the pixels with the chaos sequence generated and
display the cipher image.
Row scrambling
B. Key Stream Generator
XOR pixels in adjacent rows
The secret key is used along with the initialization
parameters of the random sequence generators, to produce
perfectly random streams whose length depends on the integer
Column scrambling
value of the size of the image. The streams are generated
according to (1) and (2). The initial parameters for the chaotic
stream are the values of µ, the width or height of the image
XOR pixels in adjacent columns depending on whether the stream is used for row or column
scrambling respectively and the initial seed derived from the
XOR pixels in each row with secret key. The proper choice of µ ensures that the system is in
chaos sequence a chaotic state and outputs perfectly random sequences.
Similarly, the initial parameters for the PMMLCG stream are
the large initial seed and the value of the multiplier. A total of
five random sequences are generated and employed at various
stages in the proposed algorithm.
Cipher Image C. Pseudo code
Figure 1. Illustration of the proposed technique READ plain image and key.
GENERATE two PMMLCG sequences defined by (1), using
A. Algorithm
an initial seed derived from the key.
Step 1: Read an input plain image. PERMUTE ROWS of the plain image
For the Gray scale image I of size M x N pixels, we can WHILE i!=M
generate two PMMLCG sequences of real numbers of lengths I(i , :) I(xi , :)
M and N respectively as given by, I(i , :)= I(i , :) I(i+1 , :)
xn1  axn mod q , (1) END
PERMUTE COLUMNS of the resulting image
where, a is a multiplier. The initial seed value x0 for one of WHILE k!=N
the sequences is derived from the secret key and the first I(: , j) I(: , xk )
element of this sequence is used as the initial seed for the I(: , j)= I(: , j) I(: , j+1)
second sequence. END
SCRAMBLE Each Pixel in the Image

248
WHILE (i!=M and k!=N)  Cross–correlation: The cross–correlation coefficient
I(i , j) I(xi , xk ) [1], [2] and [10] CAB between the plain image A and the
END cipher image B quantifies the level to which the
GENERATE two Chaos sequences defined by (2), using an encrypted image pixels are relatively randomized. The
initial seed derived from the key. closer it is to zero, the better. Our proposed algorithm
PERMUTE ROWS of the plain image produces cipher images with cross correlation values
WHILE i!=M (horizontal, vertical and diagonal correlation) that are
I(i , :) I(xi , :) lower than other chaos-based image encryption
I(i , :)= I(i , :) I(i+1 , :) schemes. Fig. 5 compares the correlation results
END obtained using the proposed algorithm and the
correlation results using AES encryption scheme [13].
PERMUTE COLUMNS of the resulting image
The cross- correlation is given by
WHILE k!=N
I(: , j) I(: , xk ) 1 r c
I(: , j)= I(: , j) I(: , j+1)  ( Ai, j  A)( Bi, j  B)
r c i j (4)
END C AB 
r c r c
1 1
XOR pixels in each row with the chaos map. (  ( Ai, j  A) 2 )( r  c 
r c i j
( Bi , j  B) 2 )
WHILE i!=M i j

I(i , :)= I(i , :) (Logistic map) r c 1 r c


Where A  ( 1 ) and B  (  Bi, j ) . (5)
END
r c
 A i, j
r  c i 1 j 1
WRITE the cipher image. i 1 j 1

Ai,j and Bi,j are the pixels in the ith row and jth column of
III. EFFECTIVENESS A and B respectively and r, c represent the no. of rows
and columns in the image.
A. Qualitative analysis
 Net Pixel Change Rate: Net Pixel Change Rate
Qualitative analysis includes perception of the images and (NPCR) [1] and [9], is the measure of the number of
the analysis of histogram [11] (the plot of gray levels in an in cipher text pixels changed between two plaintext
an image against their frequencies of occurrence). Fig. 3 shows images A and A’ differing by only one pixel, and
the result of encrypting the Lena image, shown in Fig. 2, using encrypted using the same encryption algorithm.
the proposed algorithm. Fig. 2 shows several spikes in the
histogram of the plain image due to gray levels which have r c

greater probability of occurrence in the image. After encrypting  d i, j


the image using the proposed encryption technique, the NPCR 
i 1 j 1
100% (6)
histogram is uniform and all gray levels have same frequency r c
of occurrence with the same probability. The histogram of the
0,if , A  A'
cipher image has no statistical relation to the plain image and Where d i , j 1,if , Aii,,jj A'ii,, jj .
hence does not provide any clue for a statistical attack on the
proposed encryption scheme.
The expected NPCR value for a good encryption
technique is 1–n-1 ×100% ≈ 99.6094%. Our results
B. Quantitative Analysis average to 99.58%.
The results of applying the technique over various images
are listed in the Table II, which also presents a comparison  Unified Average Change in Intensity: The Unified
between our technique and earlier chaos-based image Average Change in Intensity (UACI) [1] and [9], is a
encryption techniques [12]. measure of the average intensity difference between
two cipher images.
 Entropy: Entropy [9] h is a cumulative measure of the
c ( A  A'
i, j )
r
frequency of the intensity levels in an image. Due to 1
(
i, j
the characteristics of the human eye, which is
UACI  ) 100% . (7)
r  c i 1 j 1 n 1
insensitive to high frequency components, an image of
high entropy is not visually perceivable. Entropy is The expected UACI for a good encryption scheme is
given by n 1

h   ( pi log 2 pi ) , (3)
1  i(i  1)
i UACI exp ected   i 1
100% (8)
n2 n 1
where pi is the frequency of intensity level i in the
= 33.4635%.
image. The maximum h an 8–bit image can attain is 8.
The average of our results is 7.99. Hence a statistical Our encryption scheme reaches an average UACI of
attack is difficult to make. 20-22%.

249
 Average moving distance of scrambling: The average one bit, is shown in Fig. 4. The results substantiate that
moving distance of scrambling [14] is given by, our technique has high degree of key sensitivity [1], [2]
and [6].
1 r c
D  (w  i) 2  (v  j) 2 ,
r  c i 1 j 1
(9)  Encryption key sensitivity: We have measured the
parametric changes between encrypted images of
where, (i, j) represents a pixel coordinate in the original lena.tif with two keys differing by 1 bit and obtained a
image and (w, v) represents the pixel coordinate of that NPCR of 99.26, thus proving the difficulty of a related
point in the scrambled image. A large value of average key attack [1], [2] and [6].
moving distance of scrambling indicates that the
original image and the scrambled image are less
related, and hence the efficiency of the scrambling
technique is high. The scrambling technique used in
our proposed technique uses four different random
sequences to scramble pixels in 4 stages as explained
in section II. Our proposed technique gives an average
moving distance of scrambling of 135.0582 at each
stage, which substantiates the efficiency of the
proposed algorithm.
 PSNR: Peak Signal-to-Noise Ratio is commonly used Figure 2. Original Lena image and its histogram
as a measure of quality of the encryption technique. In
image encryption, a low value of PSNR for the cipher
image implies that the cipher image is noise-like, i.e.,
the amount of significant signal information available
is very less in the cipher image. The PSNR results
obtained by encrypting sample images with our
proposed technique, in comparison to the PSNR
obtained in earlier chaos-based techniques [11], [13] is
presented in Table I. Our results provide a PSNR lower
than that of currently existing techniques, thereby
showing significant improvement. Figure 3. Encrypted image and its histogram

C. Key Space Analysis


The key space for a good cryptosystem should be
sufficiently large to make the brute force attack infeasible. Key
space implies the total number of different keys which can be
used for the purpose of encryption and decryption. With
respect to the speed of today’s computers, the key space should
be more than 2100 =1030 in order to avoid brute-force attacks
[7]. Our proposed technique uses different chaotic sequences
with different keys, i.e., one sequence for row scrambling, Figure 4. Image decrypted with a wrong key and its histogram
another sequence for column scrambling and another for XOR
at the last stage. Similarly two different PMMLCG’s are used
for row and column scrambling respectively. As a result,
considering the number of iterations involved in generating the
0.1
maps even before the actual encryption/decryption begins, a
very large key-space of the order of ~1050, is logically effected. 0.08
AES
This is sufficient enough to resist brute-force attacks. The 0.06
proposed algorithm is highly sensitivity to changes even in AES+A5
only the least significant bit of the key as demonstrated in Fig.4 0.04 AES+W7
by decrypting the cipher image using wrong key (varying by 0.02 MAES
only one bit from the original key). Proposed
0
Horizontal Vertical
D. Key sensitivity Corrrelation Correlation
Here we analyze 2 scenarios. Figure 5. Comparison of correlation results
 Decryption key sensitivity: The results of decrypting
the encrypted image of Lena, shown in Fig. 3, with a
wrong key differing from the original private key by

250
TABLE I. QUANTITATIVE ANALYSIS (PSNR RESULTS)

Image Our technique Previous techniques [1],[11],[13]


Lena.tif 14.87 16.98
Peppers.tif 12.93 17.88
Flowers.tif 9.88 12.45

TABLE II. QUANTITATIVE ANALYSIS AFTER ENCRYPTION

Statistical parameters [1], [11], [13]


Correlation between plain Vertical Horizontal Diagonal
and cipher image Correlation Correlation Correlation
Image Other
Other chaos Our Other chaos Our Other chaos Our Our
chaos
based proposed based proposed based proposed proposed
based
techniques technique techniques technique technique technique technique
techniques
- 6.1326e- 7.4296e- -
Lena.tif 0.00054724 0.00056377 0.0026055 0.0030529
0.00012303 005 005 0.00036864
- -8.2355e- -
Baboon.tif 0.00029386 0.00085212 -0.0043138 0.0012446 0.0023807
0.00096242 006 0.00077468
- - -
Einstein.tif 0.0017981 -0.0013511 -0.043009 0.0037638 0.0035791
0.00042385 0.00016452 0.00030802
-5.7295e- -
Airplane.tif 0.00047238 -0.0002919 0.0016569 0.00056342 0.0034121 0.00093238
005 0.00082698
- -
Peppers.tif 0.0027676 0.00054033 -0.0018489 0.00070854 0.005644 0.0037482
0.00065191 0.00024765

[4] Gao T, Chen Z. “Image encryption based on a new total shuffling


IV. CONCLUSION algorithm”. Chaos Soliton Fract 2008;38:213–20.
[5] Chen G, Mao Y, Chui CK. “A symmetric image encryption scheme
Chaos theory has been proven as an ideal candidate for a based on 3D chaotic cat maps”. Chaos Soliton Fract 2004;21(3):749–61.
fast and reliable image encryption scheme, with high degree of [6] Kocarev L, Jakimoski G. “Logistic map as a block encryption
algorithm”. Phys Lett A 2001;289(4–5):199–206.
security. We have proposed a new image encryption scheme
[7] Pisarchik AN, Flores-Carmona NJ, Carpio-Valadez M. “Encryption and
based on pixel scrambling using both chaos logistic map and decryption of images with chaotic map lattices”. Chaos: Interdiscipl J
PMMLCG generators, thereby enhancing the security of the Nonlinear Sci2006;16(3):033118.
image over an open channel. The correlation results obtained [8] Li P, Li Z, Halang WA, Chen G. “A stream cipher based on a
by encrypting sample images with our proposed technique in spatiotemporal chaotic system”. Chaos Soliton Fract 2007;32(5):1867–
76.
MATLAB version 7, shows significant improvements in terms
[9] Hossam El-din H. Ahmed, Hamdy M. Kalash, and Osama S. Farag
of security as compared to existing techniques. By analyzing Allah ,” An Efficient Chaos-Based Feedback Stream Cipher (ECBFSC)
the statistical parameters of images encrypted in our for Image Encryption and Decryption”, Informatica 31 (2007) 121–129.
experimental tests, we have shown that the proposed algorithm [10] Sun F, Liu S, Li Z, Lu Z. “A novel image encryption scheme based on
provides good security against statistical cryptanalysis. spatial chaos map”. Chaos Soliton Fract 2008;38(3):631–40.
[11] G.A.Sathish Kumar et al./ Procedia Computer Science 3 (2011) 378-387.
[12] ZHANG YiWei1†, WANG YuMin2 and SHEN XuBang1 “A chaos-
REFERENCES based image encryption algorithm using alternate structure”, Springer-
Verlag, Science in China Series F: Information Sciences (2007).
[13] I.A.Ismail,Mohammed Amin and Hossam Diab “An Efficient Image
[1] V. Patidar, N. Pareek, and K. Sud, “Modified substitution-diffusion Encryption Scheme Based chaotic Logistic Map”, International .Journal
image cipher using chaotic standard and logistic maps”, of Soft Computing,285-291,2007.
Communications in Nonlinear Science and Numerical Simulation, Vol. [14] LIU Xiangdong, Zhang Junxing, Zhang Jinhai, He Xiqin, “Image
15, No 10, pp 2755-2765, 2010. scrambling algorithm based on chaos theory and sorting transformation”,
[2] Chang C, Hwang M, Chen T, “A new encryption algorithm for image International journal of computer science and network security, Vol.8
cryptosystems.”JSyst Software;58:83–91, science, vol. 809, Springer, No.1, January 2008.
Berlin; 1993. p. 71–82, 2001.
[3] Tong X, Cui M. “Image encryption scheme based on 3D baker with
dynamical compound chaotic sequence cipher generator”. Signal
Process 2009;89:480–91.

251

You might also like