[IEEE 2011 International Conference on Signal Processing, Communication, Computing and Networking...

4
Proceedings of 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies (ICSCCN 2011) Image Encryption Using Affine Transform and XOR Operation Amitava Nag, Jyoti Prakash Singh, Srabani Khan, Saswati Ghosh Dept. ofInformation Technolog y , Aca d em y of Technolog y Ban d el, In d ia Abstract-Image encryption is a suitable method to protect image data. Image and text data has their unique features. The available encryption algorithms are good for text data. They may not be suitable for multimedia data. In fact the pixels of natural images are highly correlated to their neighboring pixels. Due to this strong correlation any pixel can be practically predicted from the values of its neighbors. In this article, we propose a new location transformation based encryption technique. We redistribute the pixel values to different location using affine transform technique with four 8-bit keys. The transformed image then divided into 2 pixels x 2 pixels blocks and each block is encrypted using XOR operation by four 8-bit keys. The total key size used in our algorithm is 64 bit which proves to be strong enough. The experimental results proved that aſter the affine transform the correlation between pixel values was significantly decreased. Keywords- Image Correlation, Image encryption, Image histogram, Affine transform, Symmetric key encryption. I. INTRODUCTION The exchange of eleconic d ata exchange is increasing rapi d l y . With the st evolution of electronic d ata exchange, the unauthorize d d ata access is also increasing. To protect this unauthorize d access information securit y is becoming ver y crucial in d ata storage an d ansmission. Images are a ver y popular form of information an d are use d in ever y aspect of life. The protection of image d ata om unauthorize d access is ver y essential. Encryption techniques [1, 2] are ver y usel tools to protect secret information. The y protect the secret information b y converting the secret information to some unintelligible form using a ke y . To get back the information the encrypte d information shoul d be converte d back to original information using some ke y s. Base d on the ke y , the encryption algorithm can be classifie d into two categories. The y are (i) Symmetric ke y encryption an d (ii) Asymmetric ke y encryption. Symmetric ke y encryption algorithms uses same ke y for both encryption an d d ecryption where as asymmetric ke y encryption algorithms uses d ifferent ke y s for encryption an d d ecryption. Asymmetric ke y algorithm has ver y higher computational costs which are most of the time prohibitive for multime d ia d ata. Symmetric ke y encryption algorithms are comparativel y lower cost an d ma y be use d for multime d ia d ata. But the 978-1-61284-653-8/11/$26.00 ©2011 IEEE Sushanta Biswas, D. Sarkar, Partha Pratim Sarkar Dept. of Engg. an d Technological Universit y of Kal y ani Kal y ani, In d ia characteristic of multime d ia d ata is totall y d ifferent om text d ata. Text d ata d oes not possess an y re d un d anc y where as all multime d ia d ata has got a lot of re d un d anc y . The pixel value of a location is highl y correlate d to values of its neighboring pixels. Similarl y , a soun d sample is correlate d to its next sample an d its previous samples. This correlation proves to be attack points to an y stan d ar d encryption algorithm. Because, if one can fin d out pixel value at a location or one soun d sample, then the y can pre d ict the values of neighboring pixels or next soun d sample with reasonable accurac y . Most of the available encryption algorithms such as DES, AES [1], RSA [1] an d IDEA [1] are use d for text d ata. Even though DES [1], AES[I], RSA[I] an d IDEA[I] can achieve high securit y , it ma y not be suitable for images an d vi d eos encryption d ue to the ininsic characters of images an d vi d eos such as large d ata size an d high re d un d anc y , encryption on which nee d s their own special requirements an d thus requiring d ifferent encryption algorithms [9,10]. The image encryption algorithms can be classifie d into three major groups: (i) position permutation base d algorithm [6, 7], (ii) value transformation base d algorithm [3, 4, 5, 8] an d visual transformation base d algorithm [6]. Younes et al. [14] propose d a permutation base d encryption algorithm. The y d ivi d e d the original image into 4 pixels x 4 pixels blocks, which were re ge d into a permute d image using a given permutation process. The pmute d image was then encrypte d using the RijnDael algorithm. Their results showe d that the correlation between image elements was siificantl y d ecrease d b y using the combination technique. Man y encryption algorithms are base d on chaotic maps [11]. Fridrich [ ] propose d an encryption algorithm base d on chaotic maps. He use d invertible chaotic two- d imensional maps to create new symmetric block encryption schemes. His scheme is foun d to be usel for encryption of large amount of d ata, such as d igital images. Guo an d Yen [7] propose d an image encryption algorithm base d on a binar y sequence generate d om a chaotic s y stem. The y scramble d an image accor d ing to the generate d binar y sequence. This algorithm possesses low computational complexit y , high securit y an d no d istortion. In this paper, we propose a two phase encryption an d d ecryption algorithms that is base d on shuffling the image pixels using affine ansform an d the y encrypting the resulting 309

Transcript of [IEEE 2011 International Conference on Signal Processing, Communication, Computing and Networking...

Page 1: [IEEE 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies (ICSCCN) - Thuckalay, Tamil Nadu, India (2011.07.21-2011.07.22)] 2011

Proceedings of 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies (ICSCCN 2011)

Image Encryption Using Affine Transform and

XOR Operation

Amitava Nag, Jyoti Prakash Singh, Srabani Khan, Saswati Ghosh

Dept. ofInformation Technology, Academy of Technology Bandel,

India

Abstract-Image encryption is a suitable method to protect image

data. Image and text data has their unique features. The

available encryption algorithms are good for text data. They may

not be suitable for multimedia data. In fact the pixels of natural

images are highly correlated to their neighboring pixels. Due to

this strong correlation any pixel can be practically predicted

from the values of its neighbors. In this article, we propose a new

location transformation based encryption technique. We

redistribute the pixel values to different location using affine

transform technique with four 8-bit keys. The transformed image

then divided into 2 pixels x 2 pixels blocks and each block is

encrypted using XOR operation by four 8-bit keys. The total key

size used in our algorithm is 64 bit which proves to be strong

enough. The experimental results proved that after the affine

transform the correlation between pixel values was significantly

decreased.

Keywords- Image Correlation, Image encryption, Image

histogram, Affine transform, Symmetric key encryption.

I. INTRODUCTION

The exchange of electronic data exchange is increasing rapidly. With the fast evolution of electronic data exchange, the unauthorized data access is also increasing. To protect this unauthorized access information security is becoming very crucial in data storage and transmission. Images are a very popular form of information and are used in every aspect of life. The protection of image data from unauthorized access is very essential. Encryption techniques [1, 2] are very useful tools to protect secret information. They protect the secret information by converting the secret information to some unintelligible form using a key. To get back the information the encrypted information should be converted back to original information using some keys. Based on the key, the encryption algorithm can be classified into two categories. They are (i) Symmetric key encryption and (ii) Asymmetric key encryption. Symmetric key encryption algorithms uses same key for both encryption and decryption where as asymmetric key encryption algorithms uses different keys for encryption and decryption.

Asymmetric key algorithm has very higher computational costs which are most of the time prohibitive for multimedia data. Symmetric key encryption algorithms are comparatively lower cost and may be used for multimedia data. But the

978-1-61284-653-8/11/$26.00 ©2011 IEEE

Sushanta Biswas, D. Sarkar, Partha Pratim Sarkar

Dept. of Engg. and Technological University of Kalyani Kalyani,

India

characteristic of multimedia data is totally different from text data. Text data does not possess any redundancy where as all multimedia data has got a lot of redundancy. The pixel value of a location is highly correlated to values of its neighboring pixels. Similarly, 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, if one can find out pixel value at a location or one sound sample, then they can predict the values of neighboring pixels or next sound sample with reasonable accuracy. Most of the available encryption algorithms such as DES, AES [1], RSA [1] and IDEA [1] are used for text data. Even though DES [1], AES[I], RSA[I] and IDEA[I] can achieve high security, it may not be suitable for images and videos encryption due to the intrinsic characters of images and videos such as large data size and high redundancy, encryption on which needs their own special requirements and thus requiring different encryption algorithms [9,10]. The image encryption algorithms can be classified into three major groups: (i) position permutation based algorithm [6, 7], (ii) value transformation based algorithm [3, 4, 5, 8] and visual transformation based algorithm [6]. Younes et al. [14] proposed a permutation based encryption algorithm. They divided the original image into 4 pixels x 4 pixels blocks, which were rearranged into a permuted image using a given permutation process. The permuted image was then encrypted

using the RijnDael algorithm. Their results showed that the correlation between image elements was significantly decreased by using the combination technique. Many encryption algorithms are based on chaotic maps [11]. Fridrich [ ] proposed an encryption algorithm based on chaotic maps. He used invertible chaotic two-dimensional maps to create new symmetric block encryption schemes. His scheme is found to be useful for encryption of large amount of data, such as digital images. Guo and Yen [7] proposed an image encryption algorithm based on a binary sequence generated

from a chaotic system. They scrambled an image according to the generated binary sequence. This algorithm possesses low computational complexity, high security and no distortion.

In this paper, we propose a two phase encryption and decryption algorithms that is based on shuffling the image pixels using affine transform and they encrypting the resulting

309

Page 2: [IEEE 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies (ICSCCN) - Thuckalay, Tamil Nadu, India (2011.07.21-2011.07.22)] 2011

Proceedings of 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies (ICSCCN 2011)

image using XOR operation. We have used a key of 64 bit length which is quite good for practical purposes. The affine transform fractures the correlation between adjacent pixels of an image. Affine cipher is one-to-one mapping, that is, a symbol in the plaintext can be transformed to a unique symbol in the cipher text. In Affine cipher, the relationship between the plaintext P and the cipher text C is given in equations 1 and 2.

C = f{ .L K P itn.oa ,. 011 III 011 III "' "' 1

P' -., -

Wheregcd .S\. , = 1 , l{!- ! is the multiplicative inverse of K! and (-K is the additive inverse of·K . The rest of the article is organized as follows: In section 2, we propose our encryption and decryption algorithms. Section 2 also describes the key selection procedure. The experimental results are discussed in section 3. We conclude the paper with a discussion on current work and some directions to future

works in section 4.

II. PROPOSED SCHEME

We propose our two phase encryption symmetric key algorithm in this section. We have used a 64 bit symmetric key. The 64 bits of key is divided into 8 sub-keys J( , K!, K� , ... 11.3' K., Ke, K , and K of 8 bits each. The key is chosen is in such a way that the first sub-key is relatively prime to width of the image and the fourth sub-key is relatively prime to the height of the image i.e. 9 " i· .,! ;; 1 (UI " c '! "a ,,\1, ;; 1. The reason of choosing gcd K ,M = 1 (wd gcd K3, f = 1 is that the transformed coordinate will be unique in the range of 1 and M due to

gcd K ., ... 1 = 1 iand 1 to N due to gcd K;,. = 1. If the

sub-keys are not prime to height and width of the image the transformation process may map more than one location to same destinations. For example if Kl =32 and K2=6, then 5 and 37 will map to the same location as follows:

5 32 + 6 % 256 = 166 and 37 * 32 + 6 %256 = 166

The fIrst four sub-keys .S\. , J[ , K� , all d K3 are used for location transformation of the pixel values of the image using

affine cipher algorithm. Next four keys i{ , K , K , and K are used for second level of encryption using simple XOR operation. We use a location transformation of pixel values of the image because image data has strong correlation among adjacent pixels. This strong correlation proves to be a weak point for any encryption algorithm. Anyone knowing a pixel value may predict the neighbor pixel values reasonably well using some prediction techniques. So, first of all, we break this correlation among image pixels by transforming them into new locations using affine transform. The detailed implementation of affine transform is described by equations 3 and 4. Say, we have an image of size M X N with pixel

978-1-61284-653-8/11/$26.00 ©2011 IEEE

locations ranging from (1, 1) to (M, N). The pixel location (x, y) where x E {O, 1,2, .. ,M -I} and y E {O, 1,2, .. ,N -I} of secret image is transformed to new location " , y' by . ' - lnod !I·t ,., '" ." '" ." '" 3 and y' = i( + K] X) '!fwd < '" '" ." '" ." '" 4

' .. The transformed image is then decomposed into � - number

of 2 2 blocks. Pixels inside each block are encrypted using

sub-keys K , Ke, K , and R . The details of the encryption process are given in detail in algorithm 1.

Algorithm 1: Encryption Algorithm Input: A 256 gray level secret Image S of size M . Hf and a 64 bits secret Key

Output: A 256 gray level cipher Image B·t • f

Steps

1. Split 64 bits secret key into

K , K1, K'2.' K3, K .. ' Ks ' KG' an.d K

2. For each pixel P:.: . .y, transform the location ,

(x, y) in S to x, in C using the formula

:,."()= K , = 'K, - K., x · m.od III - .,

,"1 .'Ii 3. Decompose C into -;- X � number of 2 X 2

blocks

4. For each block Bij of C do

(a) Pt1,1 :P1,1 :.L: K

(b) pt1,'2 =P1 .. '2 :.L: Ks

(c) pt'2.,l =P'2 .. 1 :.L: KG

(d) pt'2.'2= P'2,'2 :.L: K7

(Where EB denotes XOR operation)

5. End.

310

Page 3: [IEEE 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies (ICSCCN) - Thuckalay, Tamil Nadu, India (2011.07.21-2011.07.22)] 2011

Proceedings of 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies (ICSCCN 2011)

Figure 1: 8-bit gray scale image of Lena

Decryption Technique For decryption, the cipher image is first decomposed into

" N' -=- x: -=- nwnber of 2 2 blocks. Each pixel of every block is

decrypted using XOR operation with 4 least significant bits

sub keys K , K", K., ami R, . The decrypted pixels are then restored back to their original position using equation 5 and 6.

- .1 + -i{ x le man H ) = ) 1 + - K ' Ka- man

Figure 3: XOR encrypted affine transformed image of Lena

Algorithm 2: Decryption Algorithm

Input: A"1 1 Cipher Image C and a 64 bits secret Key

Output: A IH .

Steps

1. Split

H Secret Image S

64 bits secret

978-1-61284-653-8/11/$26.00 ©2011 IEEE

key into

2. Decompose C into blocks

- number of 2 x 2

3. For each block Bij of C do

(a) Decrypt P'1.,l asP1..1 .;pr 1.,1 :.t.: K (b) Decrypt P \, � asP 1 .. � .;p \. � :.t.: K 5

(c) Decrypt p' �,1 asP�.l .;p' �,1 ffi K6

(d) Encrypt p'� .. � as pt�,�= p�.� tJ K7

4. For each pixel �'r!f,yf , transform the location

(x'" in C to (x,y) in S using the formula .1

) = )1 T

� - j!l,

-l('

X K! -! than ;.I·f

K3-! n,.oa 1

5. End

III. EXPERIMENTAL RESULTS

To validate our proposal we implemented our algorithm in Matlab 7 running on Windows XP platform. We have used ten 8-bit gray scale images of size 256 X 256. One such image of 8-bit gray scale images of Lena of size 256 x 256 is shown in Figure 1. The affine transformed image is shown in Figure 2 and fmal encrypted image is shown in Figure 3. The histograms of original image, the affine transformed image and XOR encrypted image is shown in Figure 4, 5 and 6. Affine cipher transformation relocates the pixel values but does not change those values as can be seen from the histogram of fig 4 and 5. The histogram using XOR, changes pixel values as shown in Figure 6. As the histogram in figure 6 shows the pixel values gets uniformly distributed which resist any statistical attacks. The average correlation of neighboring pixel values after the affine transform and the XOR operations are shown in Tablel. As can be seen from Table 1 that the correlation between neighboring pixel values are around .9 after affine transform and around 0.15 after XOR operation.

700

600

500

400

300

200

100

o

o 50 100 150 200

Figure 4: Histogram of initial image of Lena

311

Page 4: [IEEE 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies (ICSCCN) - Thuckalay, Tamil Nadu, India (2011.07.21-2011.07.22)] 2011

Proceedings of 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies (ICSCCN 2011)

700

600

500

400

300

200

100

o

o 50 100 150 200 250

Figure 5: Histogram of affine transformed image of Lena

700

600

500

400

300

200

100

o

o 50 100 150 200 25[

Figure 5: Histogram ofXOR encrypted affine transformed image of Lena

Table 1: Average correlation between pixels values.

Image name Correlation after Correlation

affine transform after XOR

Lena 0.9468 0.5088

Xplane 0.9283 0.4983

Airplane 0.9971 0.2873

IV. CONCLUSION

In this article, we proposed a symmetric key image encryption technique that first scramble the locations of the pixels using 4 8-bit sub keys and then encrypt the pixel values by XOR the selected 8-bit key. The scrambling operation is done using affine cipher techniques that breaks the correlations of the

978-1-61284-653-8/11/$26.00 ©2011 IEEE

neighboring pixels and make the image unidentifiable. The XOR operation then change the pixel values making the image very meaningless. The encryption and decryption process are simple enough to be carried out on any large sized image or video files, but provides enough security. The authors are currently engaged in randomizing the application of keys so that the security level is further increased.

REFERENCES

[I) w. Stallings, Cryptography and Network Security principles and practices, 3rd ed., Pearson Education, 2003.

[2) H. EI-din H. Ahmed, M. K Hamdy, and O. S. Farag Allah, "Encryption quality analysis of the RC5 block cipher algorithm for digital images," Optical Engineering, Vol. 45, Issue 10107003,2006

[3) Aloha Sinha, Kehar Singh, "A technique for image encryption using digital signature", Optics Communications, Vol-2 I 8 (2203),229-234.

[4) S.S.Maniccam, N.G. Bourbakis, "Lossless image compression and encryption using SCAN", Pattern Recognition 34 (2001),1229-1245

[5) Chin-Chen Chang, Min-Shian Hwang, Tung-Shou Chen, "A new encription algorithm for image cryptosystems", The Journal of Systems and Software 58 (200 I), 83-9 I.

[6) Jiun-In Guo, Jui-Cheng Yen, "A new mirror-like image encryption algorithm and its VLSI architecture", Pattern Recognition and Image Analysis, vol.IO, no.2, pp.236-247, 2000.

[7) Jui-Cheng Yen and J. I. Guo, "A New Chaotic Image Encryption Algorithm," Proc. 1998 National Symposium on Telecommunications, pp.358-362, Dec, 1998.

[8) Shuqun Zhang and Mohammed A Karim, "Color image encryption using double random phase encoding", MICROWAVE AND OPTICAL TEC HNOLOGY LETTERS Vol. 21, No. 5, June 5 1999,318-322

[9)M. V. Droogenbroech, R. Benedett, "Techniques for a selective encryption of u ncompressed and compressed images," in Proceedings of Advanced Concepts for Intelligent Vision Systems, 2002, pp 9-1 I.

[IO)S. Changgui, B. K Bharat, "An efficient MPEG video encryption algorithm," Proceedings of the symposium on rei iable distributed systems, 1998, pp. 38 I -386.

[I I) J. Cheng; J.1. Guo, "A new chaotic key-based design for image encryption and decryption," The 2000 IEEE International Symposium on Circuits and Systems, volA, no. 4, pp. 49 - 52, May. 2000.

[12) S.Behnia,AAkhshani,S.Ahadpour,H.Mahmodi,A Akha-van, A fast chaotic encryption scheme based on piecewise nonl inear chaotic maps, Physics Letters A 6(2007):39 I -396.

[13)Jiri Fridrich, "Image Encryption Based on Chaotic Maps", Proceeding of IEEE Conference On Systems, Man, and Cybernetics, pp. 1 105-I I 10, 1997.

[14) Mohammad Ali Bani Younes and Aman Jantan, Image Encryption Using Block-Based Transformation Algorithm, lAENG International Journal of Computer Science, 35: I, 2008

312