 Open Access
 Total Downloads : 1416
 Authors : Rinki Pakshwar, Asst Prof. Vijay Kumar Trivedi, Prof.& Hod Vineet Richhariya
 Paper ID : IJERTV2IS3297
 Volume & Issue : Volume 02, Issue 03 (March 2013)
 Published (First Online): 23032013
 ISSN (Online) : 22780181
 Publisher Name : IJERT
 License: This work is licensed under a Creative Commons Attribution 4.0 International License
Image Encryption Using Random Scrambling And XOR Operation
Image Encryption Using Random Scrambling and XOR Operation.
Rinki Pakshwar 1, Asst Prof. Vijay Kumar Trivedi 2, Prof.& HOD Vineet Richhariya 3
1Dept. of Computer Science
Lakshmi Narain College of Technology, Bhopal(India)
2Asst. Prof. Dept. of Computer Science Lakshmi Narain College of Technology, Bhopal(India)
3 Prof. & HOD Dept. of Computer Science Lakshmi Narain College of Technology, Bhopal(India)
Abstract This paper aims at improving the level of security and secrecy provided by the digital gray scale image encryption. The image encryption and decryption algorithm is designed and implemented to provide confidentiality and security in transmission of the image based data as well as in storage. Since the pixel of image is highly correlated to their neighboring pixels. Due to this strong correlation any pixel can be practically predicted from a value of its neighbors. So there is a need of a technique that can shuffle the pixels to reduce the correlation between the neighbor pixels. Hence we used Scrambling technique that Shuffles the pixels of image .This Scrambled image is called transformed image. The transformed image then divided into 2 pixels x 2 pixels blocks and each block is encrypted using XOR operation by four 8bit keys. The total size of key in our algorithm is 32 bit long which proves to be strong enough. The proposed encryption algorithm in this study has been tested on some Gray Scale images and showed good results.
KeywordsImage encryption, image reconstruction, BitPlane Decomposition, Random Scrambling XOR.

Image Encryption is the process of encoding messages in such a way that eavesdroppers or hackers cannot read it, however that authorized parties. With the huge growth of computer networks and the latest advances in digital technologies, a huge amount of digital data is being exchanged over various types of networks. It is often true that a large part of this information is either confidential or private. As a result, different security techniques have been used to provide the required protection [1]. The security of digital images has attracted more attention recently, and many different image encryption methods have been proposed to enhance the security of these images [2].
Image encryption techniques try to convert an image to another one that is hard to understand [2]. On the other hand, image decryption retrieves the original image from the encrypted one. There are various image encryption systems to encrypt and decrypt data, and there is no single encryption algorithm satisfies the different image types. They protect the secret information by converting the secret information to some unintelligible form using a key. By using a key, we protect the secret information by converting the secret information to some incomprehensible form. We get back information through encrypted information should be converted back to original information. On the Basis of key, the encryption algorithm can be classified into two categories. They are (i) Symmetric key encryptionThis algorithm uses same key for both encryption and decryption and (ii) Asymmetric key encryptionThis algorithms uses different keys for encryption and decryption [3]. Asymmetric key algorithm [3] has very higher computational costs than Symmetric key encryption algorithms which have comparatively lower cost. Asymmetric key algorithms are most time prohibitive for multimedia data. But the characteristic of multimedia data is totally different from text data. All multimedia data has got a lot of redundancy but text data does not possess any redundancy. The pixel value of a location is highly correlated to values of its neighboring pixels. Like, a sound sample is correlated to its next sample and its previous samples. This correlation proves to be attack points to any standard encryption algorithm. Because they can predict the values of neighboring pixels or next sound sample by finding out pixel value at a location or one sound sample with reasonable accuracy [3].
Nearly all the available encryption algorithms like .DES, AES [4], RSA [4] and IDEA [4] are used for text data. Act of them DES [4], AES[4], RSA[4] and IDEA[4] can achieve high security, it is not be suitable for images and videos encryption
due to the intrinsic characters of images and videos .So we need some other technique for encrypt image and videos. For large data size and high redundancy, encryption special requirements and different encryption algorithms [5, 6] is needed. The image encryption algorithms divided into three major groups: (i) position permutation based algorithm [7, 8], (ii) value transformation based algorithm [9, 10, 11, 12] (iii) visual transformation based algorithm [7].several encryption algorithms are based on chaotic maps. In this paper, we propose image encryption using Random Scrambling and XOR operation . Affine transform that is based on shuffling the image pixels and they encrypting the resulting image using XOR operation. We used 32 bit key that is good for practical purposes.

BITPLANEDECOMPOSITIONAND
RECONSTRUCTION
The gray level of every pixel of an image explained by multi
bits, in which all bits the same in the level are created of a
algorithm .The method transforms an MÃ—N digital image X into a 1D vector V. Then it uses a random natural number generator and select a couple of different seeds to produce two random sequences RS and RD with the same length as V, and scrambles the 1D vector V as follows [14]:
V RS i V RD ii 0,1,…,M N 1
Where the sign denotes the interchanging of two relevant elements in sequences RS and RD.
Due to the interchanging rule is reversible. There for, when two random sequences RS and RD in antiscrambling are same as that of in scrambling, the antiscrambling can also be completed by the rule , namely, equation is the rule of antiscrambling as well as the rule of scrambling.
For bitplane scrambling and antiscrambling, in which we transform the bitplane image X (l) into a 1D vector V (l) firstly. Relative to Eq. 5, the rule of bitplane scrambling and anti
scrambling will be rearrange as.
binary plane, so it is called bitplane [13]. Let X is an M Ã— N
V (l ) R
i V (l ) R
ii 0,1,….M N 1;l 0,1,….L 1
digital image with L bits. After decomposing it, we can get L bitplane images, which are described by X(l) (l = 0, 1,,1
). Let B(l) (Â·) be the operator of bitplane decomposition, then the decomposition of lth bitplane is expressed by.
X(l ) B(l ) X
If X (m, n) is a pixel located at (m , n), then the lth bit of X (m ,
S D
III . PROPOSED ALGORITHM
Algorithm 1: Encryption Algorithm at Sender Side
Image encryption process starts with selecting a gray scale image X of MÃ—N pixel size with L bit per pixel .which is to be converted into encrypted form before transmitting to the other end.
n) is:
X(l ) m, n B(l )
X(l ) m, n B(l )
1 if x m, n / 2(l ) mod 2 1
Input: A Gray scale image X.
Output: Cipher image XC.

Input a gray scale image X of M Ã— N size with L bits
0

Reconstruction of Image.
otherwise
per pixel.


Then we decomposed a gray image into l bitplane
Suppose B1(l)(Â·) are the image reconstruction operator, we have,
L1
images.
X(l ) B(l ) X ..(1)
T/p>
T
X B1(l ) X (l )
l 0
If X (m, n) is a pixel located at (m, n), then the lth bit of
For a pixel at position (m, n), we also have
L1
X (m,n) is:
1 if x m, n / 2(l ) mod 2 1
X m, n 2(l ) X (l ) m, n
X(l ) m, n B(l )
T 0
otherwise
l 0

Random Scrambling and Antiscrambling of Image.
The random scrambling method and antiscrambling gives in the reference [14] is easy as well as, more stable and safer than the classical method Arnold transforms [15].We describe it our
.. (2)


We transform the bitplane image X(l) into a 1D vector V(l).

Then it uses a random natural number generator and chooses a couple of different seeds to produce two random sequences RS and RD with the same length as

and scrambles the 1D vector V.
V RS i V RD ii 0,1,…,M N 1
(3)
We merged the scrambled bitplane images according to their original levels on bitplanes and gained a Transformed image XT.
Decompose into l bitplane images
Decompose into l bitplane images
L1
Gray Image X of size MXN
Gray Image X of size MXN
Start
Transform the bit plane image X(l) into a 1D vector V.
Transform the bit plane image X(l) into a 1D vector V.
T
T
X B1(l ) X (l )
l 0
For a pixel at position (m,n) ,we also have
L1
Scrambles the 1D Vector V
Scrambles the 1D Vector V
T
T
X m, n 2(l ) X (l ) m, n
l 0
.(4)
Merge the Scrambled bitplane images according to their Original level.
Merge the Scrambled bitplane images according to their Original level.


The transformed image then divided into 2 pixels Ã— 2
pixels blocks.

Each block Bi,j of XT is encrypted using XOR operation by four 8bit keys (K1,K2,K3,K4).
Encrypted using XOR operation with keys (K1,K2,K3,K4)
Encrypted using XOR operation with keys (K1,K2,K3,K4)
P1.1=P1.1 K1 P1.2=P1.2 K2…………………..(5)
P2.1=P
2.1
K3
P2.2=P2.2 K4
Cipher image XC
Cipher image XC
Where Pi,j is the pixel value at ith and jth location in block
resulted image called by cipher image XC receiver site.

End.
is ready to be sent to
End.
Figure 1: Flowchart of Encryption Algorithm at Sender side.
Algorithm 2: Decryption Algorithm at Receiver Side:
The input is a gray scale encrypted image XC of M Ã— N pixel size with L bit per pixel.Which is to be converted in to its original form as before sending.
Input: Cipher image XC.
Output: A Gray scale image X.

For Decryption, the cipher image XC is first divided into 2 pixels Ã— 2 pixels blocks.

Each pixel of every block is decrypted using XOR operation with keys (K1, K2, K3, K4) .
Decrypt P1.1 as P1.1=P1.1 K1 Decrypt P1.2 as P1.2=P1.2 K2 ..(6) Decrypt P2.1 as P2.1=P2.1 K3 Decrypt P2.2 as P2.2=P2.2 K4
Decompose into l bitplane images.
Decompose into l bitplane images.

The decrypted image XD is then decomposed again into
l bitplane images by using the formula used in eq. (2).

We then transform the bitplane image XD(l) into a 1D vector V(l) .Then we use again random natural number generator and use the same a couple of seeds used at encryption time to produce same random sequences RS
and RD with the same length as V. and antiscrambles the 1D vector V .
Cipher image XC.
Cipher image XC.
Encrypted using XOR operation with keys (K1,K2,K3,K4)
Encrypted using XOR operation with keys (K1,K2,K3,K4)
Start
Transform the bit plane image X(l) into a 1D vector V.
Transform the bit plane image X(l) into a 1D vector V.
S D
S D
V (l ) R i V (l ) R
ii 0,1,….M N 1;l 0,1,….L 1
Antiscrambles the 1D Vector V.
Antiscrambles the 1D Vector V.
(7)

Lastly, we merged the antiscrambled bitplane images according to their original levels on bitplanes and gained an Original image X.

End.
Merge the Antiscrambled bit plane images according to their Original level.
Merge the Antiscrambled bit plane images according to their Original level.
Original image X.
Original image X.
End.
Figure 2: Flowchart of Decryption Algorithm at Receiver side.

SIMULATION RESULTS
Our Proposal we implement our algorithm in Mat lab 7.8.0 running on windows XP platform. we have used Seven 8 bit gray scale image of size 256Ã—256.One such image of 8bit gray image of Rose flower of size 256Ã—256 is shown in figure 3. The encrypting process of the Image by taking the initial condition, the encrypted image hides the totality of the information contained therein, as seen in figure 3(a) and figure 3(c), Here the
random scrambling and XOR operation condition is treated as the key for the encryption of the image. The distribution of intensities of the encrypted image varies when changing the value of the initial condition. When the decryption process is done with the same initial condition, we recover the original image, as shown in figure 3(e).If the keys used in the decryption process are equal to the keys used in the encryption process, the image will be recovered. Shown figure 3 in image Encryption and Decryption.

Original Image. (b) Scrambled Image.


(c) Scrambled Encrypted Image. (d) Decryption Image.
(e) Image after Antiscrambling
Figure 3: Encrypted and Decrypted Image.

Histogram of original Image (b) Histogram of the
Scrambled Image
(c )Histogram of the Scrambled (d) Histogram of the Encrypted Image Decryption Image
(e) Histogram of the Antiscrambled Decrypted Image.
Figure 4: Histograms of the Encrypted and Decrypted image.
Histogram Deviation Calculation.
The Histogram Deviation calculation of the Seven Gray scale encrypted images Flower, Bird, Lena, Hours, Nature, XPlane and Airplane XPlane and Airplane are tabulated in Table1, from which it can be said that the Histogram Deviation than that obtained using Random Scrambling and XOR operation .
Image Name
Histogram Deviation
Flower
1.5716
Bird
1.4615
Lena
0.7257
Hours
0.7165
Nature
0.6895
XPlane
0.6103
Airplane
0.8335
Table 1: Show Histogram Deviation Calculation
Average Correlation Coefficient between pixel values.
The Average correlation coefficients between the corresponding pixels values of the three encrypted images Lena, XPlane and Airplane are tabulated in Table 2, from which it can be said that the correlation coefficients are worse than that obtained using secret key of an image XOR operation and Compare average correlation coefficient between pixel values on three different images encryption method.
Image Name
Chaotic Baker map [16]
Affine Transformed XOR [3]
Proposed Method.
Lena
0.3247
0.5088
0.14
Xplane
0.8762
0.4983
0.28
Airplane
0.2877
0.2873
0.04
Table 2: Sow average Correlation between pixel values and compare different image Encryption Methods.

CONCLUSION
The image encryption and decryption algorithm is designed and implemented to provide confidentiality and security in transmission of the gray image based data as well as in storage. The scheme presented in this paper has a simple implementation module. The proposed encryption algorithm can ensure multiple criteria such as lossless, maximum distortion, maximum performance and maximum speed. The proposed encryption method in this study has been tested on different gray images and showed good results. Future work will be focused on the development of this algorithm to get color image.
ACKNOWLEDGMENT.
The author would like to express their thanks & gratitude to all those who gave suggestions and valuable contributions to this work. The authors would also like to thank the reviewers for their comments to improve this paper. Our special thanks to Prof Vineet Richaria, Head, Computer Science and Engg Dept.,LNCT, Bhopal, India. And Asst Prof Vijay Kumar Trivedi Computer Science and Engg Dept., LNCT, Bhopal, India whose help, stimulating suggestions, experience and encouragement helped us in all the times of study and analysis of this work.

Eldin. H. Ahmed, H. M. Kalash, and O. S. Farag Allah, Encryption quality analysis of the RC5 block cipher algorithm for digital images, Menoufia University, Department of Computer Science and Engineering, Faculty of Electronic Engineering, sMenouf32952, Egypt, 2006.

Li. Shujun, X. Zheng Cryptanalysis of a chaotic image encryption method,Inst. of Image Process. Xi'an ssJiaotong Univ, Shaanxi, This paper appears in: Circuits and Systems, ISCAS 2002. IEEE International Symposium on Publication Date: 2002, Vol. 2, page(s):708,711, 2002.

Amitava Nag, Jyoti Prakash Singh, Srabani Khan, Saswati Ghosh and Sushanta Biswas, D. Sarkar, Partha Pratim Sarkar, Image Encryption Using Affine Transform and XOR Operation, IEEE on Signal processing communication Computing and Networking Technologies, 2011.

National Institute of Standards and Technology, Data EncryptionStandard(DES), http://csrc.nist.gov/publications/fips/fips463/fips46 3.pdf, 1999.

M. V. Droogenbroech, R. Benedett, "Techniques for a selective encryption of uncompressed and compressed images," in Proceedings of Advanced Concepts for Intelligent Vision Systems, pp 911,2002.

S.Changgui , B. K Bharat, "An efficient MPEG video encryption algorithm," Proceedings of the symposium on reliable distributed systems, pp. 38 I 386,1998.

JiunIn Guo, JuiCheng Yen, "A new mirrorlike image encryption algorithm and its VLSI architecture", Pattern Recognition and Image Analysis, vol.IO, no.2, pp.236247, 2000.

JuiCheng Yen and J. I. Guo, "A New Chaotic Image Encryption Algorithm,"Proc. 1998 National Symposium on Telecommunications,pp. 358362, Dec, 1998.

Aloha Sinha, Kehar Singh, "A technique for image encryption using digital signature", Optics Communications, Vol2 18 (2203), 229234.

S.S.Maniccam, N.G. Bourbakis, "Lossless image compression and encryption using SCAN", Pattern Recognition 34,12291245,2001

ChinChen Chang, MinShian Hwang, TungShou Chen, "A new encription algorithm for image cryptosystems", The Journal of Systems and Software 58 , 8391,2001.

Shuqun Zhang and Mohammed A Karim, "Color image encryption using double random phase encoding", Microwave and Optical Technology Letters Vol. 21, No. 5,318322, June 5 1999.

Z. J. Tang, X. Lu, W. M. Wei, S. Z. Wang, et al, Image Scrambling Based on Bit Shuffling of Pixels, Journal of Optoelectronics . Laser, vol. 18, no. 12, pp. 14861488, 1495, 2007.

Q. D. Sun, W. X. Ma, W. Y. Yan, H. Dai, A Random Scrambling Method for Digital Image Encryption: Comparison with the Technique Based on Arnold Transform, Journal of Shanghai Second Polytechnic University, vol. 25, no. 3, pp. 159163, 2008.

W. Ding, W. Q. Yan, D. X. Qi, Digital Image Scrambling Technology Based on Arnold Transformation, Journal of Computeraided Design & Computer Graphics, vol. 13, no. 4, pp. 338341, 2001.

Ibrahim Fathy ElAshry, Digital Image Encryption, Master Thesis Report in Menofia University, 2010 .

Vol. 2 Issue 3, March – 2013