Image Encryption Using Advanced Hill Cipher Algorithm
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Image Encryption Using Advanced Hill Cipher Algorithm

on

  • 1,630 views

The Hill cipher algorithm is one of the symmetric ...

The Hill cipher algorithm is one of the symmetric
key algorithms that have several advantages in data
encryption. But, the inverse of the key matrix used for
encrypting the plaintext does not always exist. Then if the
key matrix is not invertible, then encrypted text cannot be
decrypted. In the Involutory matrix generation method the
key matrix used for the encryption is itself invertible. So, at
the time of decryption we need not to find the inverse of the
key matrix. The objective of this paper is to encrypt an
image using a technique different from the conventional Hill
Cipher. In this paper a novel advanced Hill (AdvHill)
encryption technique has been proposed which uses an
involutory key matrix. The scheme is a fast encryption
scheme which overcomes problems of encrypting the images
with homogeneous background. A comparative study of the
proposed encryption scheme and the existing scheme is
made. The output encrypted images reveal that the
proposed technique is quite reliable and robust.

Statistics

Views

Total Views
1,630
Views on SlideShare
1,630
Embed Views
0

Actions

Likes
0
Downloads
24
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Image Encryption Using Advanced Hill Cipher Algorithm Document Transcript

  • 1. ACEEE International Journal on Signal and Image Processing Vol 1, No. 1, Jan 2010 Image Encryption Using Advanced Hill Cipher Algorithm Bibhudendra Acharya1, Saroj Kumar Panigrahy2, Sarat Kumar Patra3, and Ganapati Panda3 1 Department of E & TC, NIT Raipur, Chhattisgarh-492010, India bibhudendra@gmail.com 2 Department of CSE, NIT Rourkela, Orissa-769008, India skp.nitrkl@gmail.com 3 Department of ECE, NIT Rourkela, Orissa-769008, India {skpatra, gpanda}@nitrkl.ac.inAbstract—The Hill cipher algorithm is one of the symmetric engineering [1].key algorithms that have several advantages in data Substitution cipher is one of the basic components ofencryption. But, the inverse of the key matrix used for classical ciphers. A substitution cipher is a method ofencrypting the plaintext does not always exist. Then if the encryption by which units of plaintext are substitutedkey matrix is not invertible, then encrypted text cannot bedecrypted. In the Involutory matrix generation method the with ciphertext according to a regular system; the unitskey matrix used for the encryption is itself invertible. So, at may be single letters (the most common), pairs of letters,the time of decryption we need not to find the inverse of the triplets of letters, mixtures of the above, and so forth. Thekey matrix. The objective of this paper is to encrypt an receiver deciphers the text by performing an inverseimage using a technique different from the conventional Hill substitution [8]. The units of the plaintext are retained inCipher. In this paper a novel advanced Hill (AdvHill) the same sequence as in the ciphertext, but the unitsencryption technique has been proposed which uses an themselves are altered. There are a number of differentinvolutory key matrix. The scheme is a fast encryption types of substitution cipher. If the cipher operates onscheme which overcomes problems of encrypting the images single letters, it is termed a simple substitution cipher; awith homogeneous background. A comparative study of theproposed encryption scheme and the existing scheme is cipher that operates on larger groups of letters is termedmade. The output encrypted images reveal that the polygraphic. A monoalphabetic cipher uses fixedproposed technique is quite reliable and robust. substitution over the entire message, whereas a polyalphabetic cipher uses a number of substitutions atIndex Terms—Encryption, Decryption, Hill Cipher, Image different times in the message— such as withEncryption, Advanced Hill Cipher. homophones, where a unit from the plaintext is mapped to one of several possibilities in the ciphertext. Hill I. INTRODUCTION cipher is a type of monoalphabetic polygraphic substitution cipher. Hill cipher is a block cipher that has Owing to the advance in network technology, several advantages such as disguising letter frequenciesinformation security is an increasingly important of the plaintext, its simplicity because of using matrixproblem. Popular application of multimedia technology multiplication and inversion for enciphering andand increasingly transmission ability of network deciphering, its high speed, and high throughput [5,7].gradually leads us to acquire information directly and In this paper, we have proposed an advanced Hillclearly through images. Cryptography, the science of (AdvHill) cipher algorithm which uses an Involutory keyencryption, plays a central role in mobile phone matrix for encryption [1]. The objective of this paper is tocommunications, pay-TV, e-commerce, sending private overcome the drawback of using a random key matrix inemails, transmitting financial information, security of Hill cipher algorithm for encryption, where we may notATM cards, computer passwords, and touches on many be able to decrypt the encrypted message, if the keyaspects of our daily lives. Cryptography is the art or matrix is not invertible. Also the computationalscience encompassing the principles and methods of complexity can be reduced by avoiding the process oftransforming an intelligible message (plaintext) into one finding inverse of the matrix at the time of decryption, asthat is unintelligible (ciphertext) and then retransforming we use Involutory key matrix for encryption. Using thisthat message back to its original form. In modern times, key matrix we encrypted gray scale as well as colorcryptography is considered to be a branch of both images. Our algorithm works well for all types of graymathematics and computer science, and is affiliated scale as well as color images except for the images withclosely with information theory, computer security, and background of same gray level or same color. The organization of the paper is as follows. Following This research work was carried out at the Department of ECE, NIT the introduction, the basic concept of Hill Cipher isRourkela, Orissa-769008, India. outlined in section II. Section III discusses about theCorresponding author: bibhudendra@gmail.com modular arithmetic. In section IV, a method of generating 37© 2010 ACEEEDOI: 01.ijsip.01.01.08
  • 2. ACEEE International Journal on Signal and Image Processing Vol 1, No. 1, Jan 2010Involutory key matrix is explained. Section V presents III. MODULAR ARITHMETICthe proposed method of image encryption using advanced The arithmetic operation presented here are addition,Hill Cipher (AdvHill) algorithm. Experimental results are subtraction, unary operation, multiplication and divisiondiscussed in section VI. Finally, section VII describes the [9]. Based on this, the Involutory matrix for Hill cipherconcluding remarks. algorithm is generated. The congruence modulo operator has the following properties: II. HILL CIPHER It is developed by the mathematician Lester Hill. The 1. a ≡ b mod p if n (a − b )core of Hill cipher is matrix manipulations. Forencryption, algorithm takes m successive plaintext 2. (a mod p ) = (b mod p ) ⇒ a ≡ b mod pletters and instead of that substitutes m cipher letters. InHill cipher, each character is assigned a numerical valuelike a = 0, b = 1, ... , z = 25 [5, 9]. The substitution of 3. a ≡ b mod p ⇒ b ≡ a mod pciphertext letters in the place of plaintext letters leads to m linear equation. For m = 3 , the system can be 4. a ≡ b mod p and b ≡ a mod p ⇒ a ≡ c mod p Let Z p = [0, 1,..., p − a ] the set of residues modulo p .described as follows: C1 = ( K 11 P1 + K 12 P2 + K 13 P3 ) mod 26 If modular arithmetic is performed within this set Z p , C 2 = ( K 21 P1 + K 22 P2 + K 23 P3 ) mod 26 … (1) the following equations present the arithmetic operations: C1 = ( K 31 P1 + K 32 P2 + K 33 P3 ) mod 26 Addition: This case can be expressed in terms of column vectors (a + b ) mod p = [(a mod p )+ (b mod p )] mod pand matrices: Negation: ⎛ C1 ⎞ ⎡ K11 K12 K13 ⎤⎛ P ⎞ ⎜ ⎟ ⎢ ⎜ 1⎟ ⎜ C2 ⎟ = ⎢ K 21 K 22 K 23 ⎥⎜ P2 ⎟ ⎥ … (2) − a mod p = p − ( a mod p ) ⎜ C ⎟ ⎢K ⎝ 3 ⎠ ⎣ 31 K 32 K 33 ⎥⎜ P3 ⎟ ⎦⎝ ⎠ Subtraction: or simply we can write as C = KP , where C and Pare column vectors of length 3, representing the plaintext (a − b ) mod p = [(a mod p ) − (b mod p )] mod pand ciphertext respectively, and K is a 3 × 3 matrix,which is the encryption key. All operations are performed Multiplication:mod 26 here. Decryption requires using the inverse of (a ∗ b ) mod p = [(a mod p ) ∗ (b mod p )] mod pthe matrix K . The inverse matrix K −1 of a matrix K isdefined by the equation KK -1 = K -1 K = I , where I is Division:the Identity matrix. But the inverse of the matrix does notalways exist, and when it does, it satisfies the preceding (a / b ) mod p = c when a = (b ∗ c ) mod pequation. K −1 is applied to the ciphertext, and then theplaintext is recovered [2,6]. In general term we can write The following exhibits the properties of modularas follows: arithmetic. For encryption: Commutative Law: C = E k ( P) = K p … (3) (ω + x ) mod p = ( x + ω ) mod p (ω ∗ x ) mod p = (x ∗ω ) mod p For decryption: Associative law: P = D k (C ) = K C = K K p = P -1 -1 … (4) [(ω + x ) + y ] mod p = [ω + (x + y )] mod p Distribution Law: If the block length is m, there are 26 different mm [ω ∗ (x + y )] mod p = [{(ω ∗ x )mod p}∗ {(ω ∗ y )mod p}]mod pletters blocks possible, each of them can be regarded as aletter in a 26m -letter alphabet. Hills method amounts to a Identities:monoalphabetic substitution on this alphabet [5]. (0 + a ) mod p = a mod p and (1∗ a ) mod p = a mod p 38© 2010 ACEEEDOI: 01.ijsip.01.01.08
  • 3. ACEEE International Journal on Signal and Image Processing Vol 1, No. 1, Jan 2010 ⎡10 2⎤ Let A22 = ⎢ ⎥, Inverses: ⎣ 3 4⎦ For each x ∈ Z p , ∃y such that ⎡ 3 11⎤ (x + y ) mod p = 0 then y = − x then, A11 = ⎢ ⎥. ⎣10 9 ⎦ For each x ∈ Z p ∃y such that (x ∗ y ) mod p = 1 If k is selected as 2, IV. GENERATION OF INVOLUTORY KEY MATRIX ⎡9 4 ⎤ then, A12 = k ( I − A11 ) = ⎢ ⎥, The proposed AdvHill algorithm uses an involutory ⎣6 10⎦key matrix for encryption technique. The variousproposed methods can be found in literature [1]. One of ⎡2 12⎤the methods is explained below. and A21 = ⎢ ⎥ A is called a involutory matrix if A = A −1 . The ⎣5 5 ⎦analysis presented here for generation of involutory keymatrix is valid for matrix of +ve integers that are the ⎡ 3 11 9 4 ⎤ ⎢10 9 6 10⎥residues of modulo arithmetic of a number. This So, A = ⎢ ⎥ will be the involutory matrix.algorithm can generate involutory matrices of order ⎢ 2 12 10 2 ⎥ n × n where n is even. ⎢ ⎥ ⎣5 5 3 4⎦ ⎡ a11 a12 ... ... a1n ⎤ V. IMAGE ENCRYPTION USING ADVHILL TECHNIQUE ⎢a 21 a22 ... ... a2 n ⎥ ⎥ Let A= ⎢ ... ... As we note that Hill cipher can be adopted to encrypt ⎢ ... ... ... ⎥ be an n × n involutory grayscale and color images, proposed AdvHill algorithm ⎢ ... ... ... ... ... ⎥ can also be used for grayscale and color images. For ⎢ ⎥ ⎣ an1 an 2 ... ... ann ⎦ grayscale images, the modulus will be 256 (the number ⎡A A12 ⎤ of levels is considered as the number of alphabets). In thematrix partitioned to A = ⎢ 11 A22 ⎥ , where n is even case of color images, first decompose the color image ⎣ A21 ⎦ into (R-G-B) components. Second, encrypt each n n component (R-G-B) separately by the algorithm. Finally,and A11 , A12, A21 & A22 are matrices of order × concatenate the encrypted components together to get the 2 2each. encrypted color image [10]. The algorithm is given below So, A12 A21 = I − A11 = (I − A11 )(I + A11 ) 2 and the block diagram for the encryption process is shown in Figure 1. If A12 is one of the factors of I − A11 then A21 is the 2 Algorithm AdvHill:other. Solving the 2nd matrix equation results A11 + A22 = 0 . Step1. A involutory key matrix of dimensions m × m Then form the matrix. is constructed. Step2. The plain image is divided into m × mAlgorithm: symmetric blocks. n n 1. Select any arbitrary × matrix A22 . Step3. The ith pixels of each block are brought 2 2 together to form a temporary block. 2. Obtain A11 = − A22 . a. Hill cipher technique is applied onto the 3. Take A12 = k (I − A11 ) or k (I + A11 ) where k is a temporary block. scalar constant. b. The resultant matrix is transposed and Hill cipher is again applied to the this matrix. 4. Then, A21 = 1 (I + A11 ) or 1 (I − A11 ) . Step4. The final matrix obtained is placed in the ith k k block of the encrypted image.5. Form the matrix completely.Example: (For Modulo 13) 39© 2010 ACEEEDOI: 01.ijsip.01.01.08
  • 4. ACEEE International Journal on Signal and Image Processing Vol 1, No. 1, Jan 2010 Figure. 1. The block diagram for proposed AdvHill algorithm. VI. EXPERIMENTAL RESULTS We have taken different images and encrypted themusing original Hill and our proposed AdvHill algorithmand the results are shown below in Figure 2 and 3. It isclearly noticeable from the Figure 2(e, g), that originalHill Cipher can’t encrypt the images properly if theimage consists of large area covered with same colour orgray level [8]. But our proposed algorithm works for anyimages with different gray scale as well as colour images.In Figure 3, it is found that our proposed AdvHillalgorithm can able to encrypt the image properly ascompared to original Hill Cipher algorithm. Figure. 2. Original images (a, c, e, g, i) and corresponding encrypted images (b, d, f, h, j) by original Hill Cipher Algorithm 40© 2010 ACEEEDOI: 01.ijsip.01.01.08
  • 5. ACEEE International Journal on Signal and Image Processing Vol 1, No. 1, Jan 2010 REFERENCES [1] Bibhudendra Acharya, Girija Sankar Rath, Sarat Kumar Patra, Saroj Kumar Panigrahy. 2007. Novel Methods of Generating Self-Invertible Matrix for Hill Cipher Algorithm, International Journal of Security, Vol 1, Issue 1, 2007, pp. 14-21. [2] Imai H., Hanaoka G., Shikata J., Otsuka A., Nascimento A.C. 2002. Cyptography with Information Theoretic Security. Information Theory Workshop, 2002, Proceedings of the IEEE, 20-25 Oct 2002. [3] Lerma, M.A., 2005. Modular Arithmetic. http://www.math.northwestern.edu/~mlerma/problem_solv ing/results/modular_arith.pdf. [4] Li, S., Zheng, X., 2002. On the Security of an Image Encryption Method. ICIP2002. http://www.hooklee.com/Papers/ICIP2002.pdf. [5] Menezes, A. J., P.C. Van Oorschot, S.A. Van Stone. 1996. Handbook of Applied Cryptography. CRC press. [6] Overbey, J., Traves, W., Wojdylo, J., 2005. On the keyspace of the Hill cipher. Cryptologia, 29(l):59-72. [7] Petersen, K., 2000. Notes on Number Theory and Cryptography. http://www.math.unc.edu/Faculty/petersen/Coding/cr2.pdf. [8] Saeednia, S., 2000. How to make the Hill cipher secure. Cryptologia, 24(4):353-360. [9] Stallings, W. Cryptography and Network Security.2005. 4th edition, Prentice Hall.Figure. 3. Original images (a,d) and corresponding encrypted images (b,e) by original Hill Cipher Algorithm and (c,f) by our proposed AdvHill [10] ISMAIL I.A., AMIN Mohammed, DIAB Hossam, How to algorithm repair the Hill cipher, Journal of J Zhejiang Univ SCIENCE A, vol. 7(12), pp. 2022-2030, 2006. VII. CONCLUSION [11] Y. Rangel-Romero, R. Vega-García, A. Menchaca- This paper suggests efficient method of encryption ofimage. Proposed AdvHill algorithm is more secure to Méndez, D. Acoltzi-Cervantes, L. Martínez-Ramos, M.brute force attacks as compared to original Hill cipher Mecate-Zambrano, F. Montalvo-Lezama, J. Barrón- Vidales, N. Cortez-Duarte, F. Rodríguez-Henríquez,algorithm. A Brute Force Attack requires 2 7 +8*(n / 2) 2 Comments on How to repair the Hill cipher, Journal of Jnumber of key generations; where n is the order of keymatrix. AdvHill is a fast encryption technique which can Zhejiang Univ SCIENCE A, pp. 1-4, 2007.provide satisfactory results against the normal hill ciphertechnique. The proposed scheme is resistant againstknown plaintext attacks. 41© 2010 ACEEEDOI: 01.ijsip.01.01.08