(IJACSA) International Journal of Advanced Comuter Science and Alications, Vol. 4, No., 0 A Block Ciher Involving a Key and a Key Bunch Matrix, Sulemented with Key-Based Permutation and Substitution Dr. V.U.K.Sastry Professor (CSE Det), Dean (R&D) SreeNidhi Institute of Science & Technology, SNIST Hyderabad, India K. Shirisha Comuter Science & Engineering SreeNidhi Institute of Science & Technology, SNIST Hyderabad, India Abstract In this aer, we have develoed a block ciher involving a key and a key bunch matrix. In this ciher, we have made use of key-based ermutation and key-based substitution. The crytanalysis carried out in this investigation, shows very clearly, that this ciher is a very strong one. This is all on account of the confusion and the diffusion created by the ermutation, the substitution, in each round of the iteration rocess. Keywords-Key; key bunch matrix; encrytion; decrytion; ermutation; substitution; avalanche effect; crytanalysis I. INTRODUCTION The study of the block cihers [] is an interesting area of research in crytograhy. In the very recent ast, we have develoed a air of block cihers [-], which include a key matrix, as it is in the case of the Hill ciher, and a key bunch matrix. In these investigations, we have made use of the concets of the modular arithmetic inverse and the multilicative inverse. In [], we have made use of function Mix(), which mixes the binary bits in each round of the iteration rocess, and in [], we have introduced a function called Permute(), which carries out ermutation of binary bits of the laintext in each round of the iteration rocess. In these analyses, we have noticed that the key matrix and the key bunch matrix, and the additional function Mix()/ Permute() strengthen the ciher, in a consicuous manner. In the resent aer, our objective is to develo a block ciher, wherein we use a key matrix together with a key bunch matrix. Here, we have introduced a key-based ermutation and a substitution basing uon the key. In this, our interest is to see, how the ermutation and the substitution would influence the ciher and enhance the strength of the ciher, due to the confusion and the diffusion arising in this rocess. We now mention the lan of the aer. In section, we discuss the develoment of the ciher and introduce the flowcharts and the algorithms required in this analysis. We illustrate the ciher and discuss the avalanche effect in section. We study the crytanalysis in section 4. Finally in section, we deal with the comutation carried out in this investigation and draw conclusions. II. DEVELOPMENT OF THE CIPHER We consider a lain P having n() characters and reresent it in the form of a square matrix of size n by using EBCDIC code. Thus we have P = [ ], i= to n, j= to n. (.) Let the key matrix K be given by K=[ k ], i= to n, j= to n, (.) The encrytion key bunch matrix E is taken in the form E = [ e ], i= to n, j= to n, (.) wherein each e is an odd number lying in [-]. On using the concet of the multilicative inverse [4], the decrytion key bunch matrix D is obtained in the form D= [d], i= to n, j= to n, (.4) It is to be noted her that all the elements of D are also odd numbers which lie in [-]. The basic equations governing the encrytion can be written in the form P = (KP) mod, (.) P = [ e ] mod, i= to n, j = to n (.) P = Permute(P), (.7) P= Substitute(P), (.) and C = P. (.) The corresonding equations of the decrytion rocess are given by C = ISubstitute(C) (.0) C = IPermute(C), (.) C = [ d c ] mod, i= to n, j = to n, (.) C = (K(-) C) mod, and (.) P = C. (.4) The details of the function Permute() and the function Substitute() are exlained later. It is to be noted here, that the functions ISubstitute() and IPermute() denote the reverse rocess of the functions Substitute() and Permute(). www.acsa.thesai.org P a g e
(IJACSA) International Journal of Advanced Comuter Science and Alications, Vol. 4, No., 0 The flowcharts deicting the rocess of the encrytion and the decrytion are given in Figs. and. The algorithms, for the encrytion and the decrytion are as follows. Read P,E,K,n,r. P=Permute(P). P=Substitute(P). C=P. Write(C) Read C,E,K,n,r = ( For k= to r P = KP mod For i= to n For j= to n e ) mod P = [ ] P= Permute(P) P= Substitute(P) K - =Inv(K) D = Mult(E) For k = to r C = ISubstitute(C) C = IPermute(C) For i= to n For j= to n c = ( d c ) mod C = [ c ] C=P C = (K - C) mod Write (C) P =C Fig. Flowchart for Encrytion Write (P) Fig.. Flowchart for Decrytion Algorithm for Encrytion. Read P,E,K,n,r. For k = to r do. P=(KP) mod 4. For i= to n do. For j= to n do. = ( e ) mod 7. P=[ ] Algorithm for Decrytion. Read C,E,K,n,r. K - =Inv(K). D=Mult(E) 4. For k = to r do. C=ISubstitute(C). C=IPermute(C) 7. For i = to n do. For j= to n do. c = ( d c ) mod www.acsa.thesai.org P a g e
(IJACSA) International Journal of Advanced Comuter Science and Alications, Vol. 4, No., 0. P=C. Write (P) Let us now, exlain the basic ideas underlying in functions Permute() and Substitute(). Both are deendent on a key. Let us take the key K in the form 0 0 4 00 (.) K 40 0 The numbers in this key are listed in the nd row of the following table, Table-. 0. C=[ c ]. C = (K - C) mod 4 4................ 4 4 4 4............ 4 4 (.) TABLE-. RELATION BETWEEN SERIAL NUMBERS AND THE ASCENDING ORDER OF THE KEY NUMBERS. 4 7 0 4 0 0 4 00 40 0 0 4 4 7 The st row of this table contains the serial number, and the rd row of this table indicates the ascending order of the numbers in the key, given in the nd row. Consider the laintext P in any round of the iteration rocess. It is ossible to see this laintext as a set of square matrices of size whenever n is divisible by. As the Table- is suggesting, we interchange the rows (,0), (,4), (,), (,4), (,), (,7) and (,). (.) Similarly, it may be done in the case of the columns. It may be noted here, that once we have made an interchange involving a row or a column, we do not do anymore interchange involving that row or column subsequently so that laintext remains in a systematic manner. This is the basic idea underlying in the function Permute(), when n>=. On the other hand, when n takes n takes a value less than, for examle when n=4, then let us see how the rocess of the ermutation will be carried out. Consider an examle when n=4. In this case, the laintext is of the form 4 4 P (.) 4 4........ 4........ 4 4 On reresenting each element of this matrix in terms of binary bits, in a row-wise manner, we have This is a matrix having 4 rows and columns. This can be written, for convenience, in the form of another matrix, given by (.). This matrix has rows and columns. In order to carry out ermutation, we swa the rows (,4) as indicated by (.). The rest of the rows are untouched, as we do not have the ossibility of interchange. Then the columns are interchanged by following the content of (.). Let us now consider the rocess of substitution, which deends uon the ermutation. The EBCDIC code, which includes the number 0 to, can be written in the form of a matrix, given by EB( i, j) [( i ) j ], i to n, j to n, (.0) This has rows and columns. On interchanging the rows first and then the columns next, we get a new matrix, having the numbers 0 to, in some other order. This table can be written in the form, given in (.). On noting the corresondence between the matrices, given by (.0) and (.), we can erform the substitution rocess in any laintext. Thus we have the function Substitute(). The function Inv() is used to obtain the modular arithmetic inverse of the key matrix K. The function Mult() results in the decrytion key bunch matrix D for the given encrytion key bunch matrix E. For a thorough understanding of these 4........ 4 4 4.... 4 (.) www.acsa.thesai.org P a g e
functions, we may refer to []. In this ciher, r denotes the number of rounds carried out in the iteration rocess. Here, we have taken r=. III. 7 0 SB 7 0 4 0 7 00 40 4 0 4 ILLUSTRATION OF THE CIPHER AND THE AVALANCHE EFFECT Consider the laintext given below. 04 Dear Brother! With all the training that you had from NCC in your college, having a strong feel that India is our motherland, and it is our resonsibility to rotect this country from the invasion by other countries, you left us some years back. After that, there are several changes within the country. When you were leaving us, we had only few arties such as Congress, Communist and BJP. Today, arties have grown as mushrooms and the number of arties is that many. We do not know, in what way unity can be achieved in this country! Each arty wants to destroy the other arty, each arty want to come to ower, and each thinks that it must rule the whole country, crushing all the other arties. Ethical values have gone down! Each erson want to earn crores and crores, so that he would be able to build u his own arty, and to feed all the members entering into his arty in a grand manner with additional facilities, such as liquor and all the other attractions satisfying the assion. This is the fate of the country! You may rotect the country at the borders, but I do not know who can rotect this country within this country from the tyranny of all the olitical arties and the eole suorting them. (.) On focusing our attention on the first characters, we have Dear Brother! Wi (.) On using the EBCDIC code, we write the laintext (.) in the form 4 4 00 4 0 7 7 4 0 7 0 04 0 4 74 0 0 4 0 0 0 0 (IJACSA) International Journal of Advanced Comuter Science and Alications, Vol. 4, No., 0 4 0 4 4 4 0 4 4 4 0 0 4 4 0 4 4 0 4 0 40 0 4 4 0 4 0 4 7 4 4 4 0 P 7 4 Let us take the key matrix K, in the form (.) 0 0 4 00 K (.4) 40 0 Here, it may be noted that we have taken this K as the same as (.), as this is having modular arithmetic inverse. Let us take E in the form 7 7 E (.) 7 0 On using the laintext P, the key matrix K, the encrytion key bunch matrix E, given by (.) (.), and alying the encrytion algorithm, we get the cihertext C in the form 4 4 (.) C On using the concet of multilicative inverse, we get the decrytion key bunch matrix D in the form 0 D 0 7 7 7 7 7 7 07 7 7 (.) (.7) www.acsa.thesai.org P a g e
(IJACSA) International Journal of Advanced Comuter Science and Alications, Vol. 4, No., 0 On using the C, the D, and the K, given by (.), (.7) and (.4), and alying the decrytion algorithm, we get back the laintext P. Let us now examine the avalanche effect. On relacing the 4th row 4th column element, by, we have a change of one binary bit in the laintext P. On using this modified laintext, the K, and the E, and emloying the encrytion algorithm, we get the cihertext C in the form 04 7 4 7 (.) C 4 On comaring (.) and (.), after utting them in their binary form, we find that these two cihertexts differ by bits out of bits. Let us now consider a one binary bit change in the key K. On relacing the nd row rd column element, of the key K, given by (.4), by 4, we have a one bit change. On using this modified key, the laintext P, and the encrytion key bunch matrix E, and the encrytion algorithm, given in section, the cihertext corresonding to the modified key is obtained in the form (.) C 4 4 0 On comaring (.) and (.), after utting them in their binary form, we notice that these two cihertexts differ by bits out of bits. From the above discussion, we conclude that, this ciher exhibits a strong avalanche effect, which stands as a benchmark in resect of the strength of the ciher. IV. CRYPTANALYSIS This is the analysis which enables us to establish the strength of the ciher. The different tyes of attacks available in the literature of the crytograhy are. Cihertext only attack (Brute force attack),. Known laintext attack,. Chosen laintext attack, and 4. Chosen cihertext attack. Generally, an analytical roof is offered in the first two cases, and a checku is done with all ossible intuitive ideas in the latter two cases. A ciher is said to be accetable, if it withstands the first two attacks []. In this ciher, we are having a key matrix K and key bunch matrix E. Both are taken to be square matrices of size n. In view of this fact, the size of the key sace is n 7n.n.n n 0 4.n = 0 0. (4.) 0 4.n 4.n 7 0. 4 0 0 years. On assuming that the time required for the comutation with one value of the key and the one value of the E, in the key sace as 0-7, the time required for the execution of the ciher with all ossible keys (i.e., taking all ossible airs of K and E, into consideration) in the key sace is Secifically, in this analysis, as we have n=4, the time given by (4.), takes the form. x 0 7 years. As this time is very large, we conclude that, this ciher cannot be broken by the brute force attack. Let us examine the known laintext attack. Here, we have as many airs of laintexts and cihertexts that we like to have, can be had, at our disosal. Confining our attention to r=, that is to only one round of the iteration rocess, the system of equations governing the encrytion rocess, can be written in the form P = (KP) mod, (4.) P = [ e ] mod, i= to n, j = to n, (4.4) P = Permute(P), (4.) P = Substitute(P), (4.) and C = P. (4.7) From (4.7), we can readily have P, as we know C. on using this P, we cannot roceed further, from bottom, as the function Substitute() and ISubstitute() deend uon the key K. Though P on the right hand of (4.) is known to us, we cannot roceed further, as the P on the left hand side of (4.) is unknown. In view of the above facts, we cannot the break this ciher by the known laintext attack. As the equations, governing the encrytion rocess, are found to be very much involved, in view of the functions Permute() and Substitute(), which are based uon the key, and the modulo arithmetic oeration, we cannot imagine to choose, intuitively, any laintext or cihertext, for breaking the ciher. In the light of the above discussion, we conclude that this ciher cannot be broken by any attack, and it is a strong one by all means. V. COMPUTATIONS AND CONCLUSIONS In this investigation, we have develoed a block ciher which involves the basic ideas of the Hill ciher [] and the basic concets of the key bunch matrix. Here, we have made use of the functions Permute() and Substitute(), for ermuting the laintext and for modifying the laintext, by the substitution rocess. (4.) www.acsa.thesai.org P a g e
(IJACSA) International Journal of Advanced Comuter Science and Alications, Vol. 4, No., 0 On account of these functions and the iteration rocess, the laintext has undergone several modifications, in the rocess of encrytion. The rograms required for carrying out the encrytion and the decrytion are written in Java. The laintext, given by (.), is divided into blocks. As the last block is having only characters, we have added 4 zeroes as additional characters to make it a comlete block. On carrying out the encrytion of each block searately, by using the K and the E, we get the cihertext corresonding to the entire laintext (.), in the form (.). The crytanalysis carried out in this investigation, has clearly shown that this ciher is strong one and it cannot be broken by any attack. This investigation can be modified by including a large size key matrix and a corresonding encrytion key bunch matrix. Then this can be alied to the encrytion of images and security of images can be achieved very conveniently. REFERENCES [] William Stallings: Crytograhy and Network Security: Princile and Practices, Third Edition 00, Chater,.. [] Matrix and a Key bunch Matrix, Sulemented with Mix, in ress. [] Dr. V.U.K Matrix and a Key bunch Matrix, Sulemented with Permutation, in The International Journal of Engineering And Science (IJES), ISSN: ISBN:, Vol. No., Dec 0,. 40-. [4] Dr. V.U.K. Sastry, K.Shirisha, A Novel Block Ciher Involving a Key Bunch Matrix, in International Journal of Comuter Alications (IJCA) (0 7) Vol. No., Oct 0, Foundation of Comuter Science, NewYork,. -. [] Lester Hill, (), Crytograhy in an algebraic alhabet, V. (),. -., American Mathematical Monthly. AUTHORS PROFILE Dr. V. U. K. Sastry is resently working as Professor in the Det. of Comuter Science and Engineering (CSE), Director (SCSI), Dean (R & D), SreeNidhi Institute of Science and Technology (SNIST), Hyderabad, India. He was Formerly Professor in IIT, Kharagur, India and worked in IIT, Kharagur during. He guided 4 PhDs, and ublished more than research aers in various International Journals. He received the Best Engineering College Faculty Award in Comuter Science and Engineering for the year 00 from the Indian Society for Technical Education (AP Chater), Best Teacher Award by Lions Clubs International, Hyderabad Elite, in 0, and Cognizant- Sreenidhi Best faculty award for the year 0. His research interests are Network Security & Crytograhy, Image Processing, Data Mining and Genetic Algorithms. K. Shirisha is currently working as Associate Professor in the Deartment of Comuter Science and Engineering (CSE), SreeNidhi Institute of Science & Technology (SNIST), Hyderabad, India. She is ursuing her Ph.D. Her research interests are Information Security and Data Mining. She ublished research aers in International Journals. She stood University toer in the M.Tech.(CSE). www.acsa.thesai.org P a g e
(IJACSA) International Journal of Advanced Comuter Science and Alications, Vol. 4, No., 0 P a g e www.acsa.thesai.org 7 4 0 0 0 00 7 04 0 4 0 0 7 4 0 4 4 0 0 4 0 7 0 4 0 4 0 0 0 4 7 0 0 4 4 0 0 0 4 4 7 04 7 7 0 0 4 0 0 4 4 0 0 00 4 40 07 00 0 0 4 4 7 4 0 0 7 4 4 7 0 4 4 0 0 4 4 4 0 7 0 7 7 0 0 4 7 4 0 0 04 0 0 4 4 0 0 4 0 40 0 40 04 0 04 0 0 0 0 7 04 0 4 04 4 04 4 0 00 0 0 40 7 7 4 4 0 0 7 4 0 0 4 0 0 04 4 0 4 7 4 7 7 07 7 4 00 4 0 4 0 0 4 4 0 4 00 4 0 4 4 40 07 0 7 0 0 7 4 0 0 0 4 0 40 4 4 4 4 0 0 4 0 4 40 0 4 0 0 4 4 4 4 07 0 4 4 4 7 4 4
(IJACSA) International Journal of Advanced Comuter Science and Alications, Vol. 4, No., 0 P a g e www.acsa.thesai.org 4 4 7 4 7 4 0 0 0 0 04 0 4 0 4 4 4 00 4 0 0 00 40 4 0 0 4 4 4 0 7 0 7 7 0 0 (.) 00 0 0 0 0 4 0 4 4 0 4 0 0 7 7 4 0 0 4 7 4 0 40 0 0 0 4 4 7 7 4 0 7 4 4 4 4 4 0 7 0 4 4 7 4 4 4 07 0