International Journal of Network Security, Vol.11, No.1, PP.11{16, July 2010 11 A Modi¯ed Hill Cipher Involving Interweaving and Iteration V. Umakanta Sastry1, N. Ravi Shankar2, and S. Durga Bhavani3 (Corresponding author: V. Umakanta Sastry) Director, SCSI, Dean (R&D), Sreenidhi Institute of Science and Technology, Hyderabad, India1 CSE Department, SNIST, Hyderabad, India2 SIT, JNT University, Hyderabad, India3 (Email: vuksastry@redi®mail.com) (Received Nov. 24, 2008; revised and accepted May 4 & May 12, 2009) Abstract Encryption Standard (DES). In this, the length of the key is 56 bits, and the length of the plaintext block is 64 This paper deals with a modi¯cation of the Hill cipher. bits. In DES, as the length of the key is only 56 bits, it In this, we have introduced interweaving in each step of is found that this cipher is breakable with a good deal of the iteration. The interweaving of the resulting plaintext, e®ort by brute force attack. In view of this fact, several at each stage of the iteration, and the multiplication with variants, of DES, such as 2DES and 3DES came into exis- the key matrix leads to confusion and di®usion. From tence. However, these are found to be relatively sluggish the cryptanalysis performed in this investigation, we have in software. In the light of this, at the end of the last found that the cipher is a strong one. century, Joan Daeman and Vincent Rijman developed an Keywords: Interweaving, inverse interweaving, modular algorithm called Advanced Encryption Standard (AES). arithmetic inverse In this, the block length is 128-bit and the key length is 128, 192 or 256 bits. This cipher is found to be a strong one. 1 Introduction In the literature of cryptography, it is well known that, In a recent investigation [7, 10], we have used a new confusion and di®usion play a vital role in the develop- concept called interlacing, and modi¯ed the Hill cipher. ment of a cipher [3, 4, 5]. The transposition or permuta- In the process of interlacing, mixing of binary bits is car- tion of characters in the plaintext is responsible for con- ried out in a row wise manner, i.e., binary bits of the fusion, and the influence of each bit of the key on each elements of each row are separately mixed. This process, plaintext bit causes di®usion. included in each iteration, strengthens the cipher. The study of the classical Hill cipher [12], in which, a matrix containing numbers is used as a key in the encryp- In the present paper, we modify the Hill cipher by in- tion process, and the modular arithmetic inverse of the troducing interweaving (transposition of the binary bits key is employed in the decryption process, has attracted of the plaintext characters belonging to the neighboring the attention of several researchers [6, 7, 8, 9, 10, 11] in rows and columns) and iteration. In this, the multiplica- the recent years. In the Hill cipher, the basic steps of tion of the plaintext with the key matrix, the interweaving encryption and decryption are given by and the iteration cause a lot of di®usion and confusion. Here, our objective is to develop a strong block cipher, C = PK mod 26; whose key length is signi¯cantly large. and P = K¡1C mod 26; In Section 2, we present the development of the ci- pher. We design the algorithms for encryption, decryp- where P is the plaintext, K the key matrix, C the cipher- tion, modular arithmetic inverse, interweaving, and in- text and K¡1 is the modular arithmetic inverse of K. verse interweaving in Section 3. In Section 4, we illustrate Here, he has taken mod 26, as he focused his attention on the cipher with an example. We discuss the cryptanalysis the 26 characters of English alphabet. in Section 5, and mention the avalanche e®ect in Section Subsequently, Feistel [2] analyzed the general princi- 6. Finally, in Section 7, we draw conclusions from the ples of block ciphers and lead to the development of Data computations carried out in this analysis. International Journal of Network Security, Vol.11, No.1, PP.11{16, July 2010 12 2 Development of the Cipher Consider a plaintext P of 2n characters. By using the ASCII code, let us represent P in the form of a matrix, given by P = [Pij]; i = 1 to n, j = 1 to 2: Let K = [Kij ], i = 1 to n, j = 1 to n, be the key matrix, in which all the elements are less than 128. The process of encryption can be described by the following equations. P0 = P; P i = < KP i¡1 mod 128 >; i = 1 to N; C = KP N mod 128: Here, <> denote interweaving of the resulting matrix in a column wise and a row wise manner and C is the ciphertext. The process of decryption is governed by the relations ¡1 PN = K C mod 128; P i¡1 = > K¡1P i mod 128 <; i = N to 1; P = P 0: In this, >< denotes the reverse process of interweaving and K¡1 is the modular arithmetic inverse of K. The process of interweaving can be described as fol- lows. Let [Qij ], i = 1 to n, j = 1 to 2 be the transformed plaintext matrix obtained after performing the multipli- cation with the key matrix and taking mod 128. On con- verting each element of [Qij] into binary form, we get a new matrix [bil]; i = 1 to n, l = 1 to 14: 2 3 b11 b12 ¢ ¢ ¢ b114 6b b ¢ ¢ ¢ b 7 Figure 1: Schematic diagram of the cipher Thus we have [b ] = 6 11 11 214 7 il 4 ¢ ¢ ¢ ¢ 5 bn1 bn2 ¢ ¢ ¢ bn14 We rotate the ¯rst column and see that it assumes This completes the process of interweaving. We denote T the form [b21; b31; ¢ ¢ ¢ bn1; b11] , where T denotes the the reverse process of interweaving as inverse interweav- transpose of the vector. Here, each element has gone one ing. step up and the ¯rst element has come down to the last The schematic diagram of the cipher is given in Fig- position. This process is carried out for columns 1, 3, 5 ure 1. This shows the processes of the encryption and the and so on. Similarly, we carry out a circular left shift of decryption in detail. the rows numbered 2, 4, 6, ¢ ¢ ¢ etc. After carrying out the aforementioned steps, the matrix assumes the form 2 3 3 Algorithms b21 b12 b23 ¢ ¢ ¢ b213 b114 6 7 6b22 b33 b24 ¢ ¢ ¢ b214 b31 7 The algorithms describing encryption, decryption, modu- 6 7 6 ¢ ¢ ¢ ¢ ¢ ¢ 7 lar arithmetic inverse, permutation, interlace, inverse per- [bil] = 6 7 6 ¢ ¢ ¢ ¢ ¢ ¢ 7 mutation and decompose are given below. 4 ¢ ¢ ¢ ¢ ¢ ¢ 5 bn2 b11 bn4 ¢ ¢ ¢ bn14 b11 Then we construct the modi¯ed plaintext matrix P 3.1 Algorithm for Encryption wherein, the elements of the ¯rst column of P are ob- 1) read n, N, K, P ; tained from the ¯rst seven columns of [bil], and the second column of P from the subsequent seven columns of [bil]. 2) P0 = P ; International Journal of Network Security, Vol.11, No.1, PP.11{16, July 2010 13 3) for i = 1 to N f 4) for i = 2 to n in step 2 f i i¡1 P = KP mod 128; k = bi1; interweave(); for j = 1 to 13 f g bij = bi(j+1); g bi14 = k; g 4) C = KP N mod 128; 5) write C; 5) Construct Pi from bij ; 3.2 Algorithm for Decryption 1) read n, N, K, C; 4 Illustration of the Cipher 2) ¯nd modinverse(K); Consider a plaintext given below. 3) P N = K¡1C mod 128; The development of the nuclear technology of all the devel- oped countries must be watched carefully by a super com- 4) for i = N to 1 f mittee consisting of representatives of all the countries. invinterweave(); This ensures the safety of all the nations if and only if a i¡1 ¡1 P = K P i mod 128; resolution is taken in this direction. g Let us focus our attention on the ¯rst sixteen charac- 5) P = P0; ters given by \The development". On substituting ASCII codes for these characters, and 6) write P ; arranging them in the form of a matrix, we get 2 3 3.3 Algorithm for Modinverse 84 109 6 7 1) read n, K; 6104 1117 6 7 6101 1127 6 7 2) ¯nd Kij , ¢; /* Kij are cofactors of the elements of 6 32 1097 P = 6 7 (1) K, and 4 is the determinant of K */ 6100 1017 6 7 6101 1107 3) ¯nd d such that (d4) mod 128 = 1;/* d is the mul- 4118 1165 tiplicative inverse of 4 */ 101 32 ¡1 4) K = (Kjid) mod 128; Let us take the key matrix K as 3.4 Algorithm for Modinverse 2 3 1) read n, K; 53 62 124 33 49 118 107 43 6 7 645 112 63 29 60 35 58 11 7 6 7 2) ¯nd Kij , 4; /* Kij are the cofactors of the elements 688 41 46 30 48 32 105 51 7 6 7 of K, and 4 is the determinant of K */ 647 99 36 42 112 59 27 61 7 K = 6 7 657 20 6 31 106 126 22 1257 3) ¯nd d such that (d4) mod 128 = 1;/* d is the mul- 6 7 656 37 113 52 3 54 105 21 7 tiplicative inverse of 4 */ 436 40 43 100 119 39 55 94 5 ¡1 14 81 23 50 34 70 7 28 4) K =(Kjid) mod 128; On multiplying the plaintext matrix with the key ma- 3.5 Algorithm for Interweave trix, we get the modi¯ed P , denoted by P 1, as 1) convert P i into binary bits; 2 3 2) construct [b ], i = 1 to n, j = 1 to 14; 27 112 ij 6 7 6 17 83 7 6 7 3) for j = 1 to 14 in Step 2 f 6 83 1137 6 7 k = b1j; 1 6108 41 7 P = 6 7 for i = 1 to n ¡ 1 6 37 25 7 6 7 f 6 38 86 7 bij = b(i+1)j; 4 59 61 5 g 127 11 bnj = k; g On converting the numbers in these two columns into International Journal of Network Security, Vol.11, No.1, PP.11{16, July 2010 14 binary form and constructing the matrix b, we get readily veri¯ed that KK¡1 mod 128 = K¡1K mod 128 = 2 3 I.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-