A Block Cipher Involving a Key and a Key Bunch Matrix, Supplemented with Key-Based Permutation and Substitution Dr. V.U.K.Sastry

In this paper, we have developed a block cipher involving a key and a key bunch matrix. In this cipher, we have made use of key-based permutation and key-based substitution. The cryptanalysis carried out in this investigation, shows very clearly, that this cipher is a very strong one. This is all on account of the confusion and the diffusion created by the permutation, the substitution, in each round of the iteration process.


INTRODUCTION
The study of the block ciphers [1] is an interesting area of research in cryptography. In the very recent past, we have developed a pair of block ciphers [2][3], which include a key matrix, as it is in the case of the Hill cipher, and a key bunch matrix. In these investigations, we have made use of the concepts of the modular arithmetic inverse and the multiplicative inverse.
In [2], we have made use of function Mix(), which mixes the binary bits in each round of the iteration process, and in [3], we have introduced a function called Permute(), which carries out permutation of binary bits of the plaintext in each round of the iteration process. In these analyses, we have noticed that the key matrix and the key bunch matrix, and the additional function Mix()/ Permute() strengthen the cipher, in a conspicuous manner.
In the present paper, our objective is to develop a block cipher, wherein we use a key matrix together with a key bunch matrix. Here, we have introduced a key-based permutation and a substitution basing upon the key. In this, our interest is to see, how the permutation and the substitution would influence the cipher and enhance the strength of the cipher, due to the confusion and the diffusion arising in this process.
We now mention the plan of the paper. In section 2, we discuss the development of the cipher and introduce the flowcharts and the algorithms required in this analysis. We illustrate the cipher and discuss the avalanche effect in section 3. We study the cryptanalysis in section 4. Finally in section 5, we deal with the computation carried out in this investigation and draw conclusions.

II. DEVELOPMENT OF THE CIPHER
We consider a plain P having n(2) characters and represent it in the form of a square matrix of size n by using EBCDIC code. Thus we have On using the concept of the multiplicative inverse [4], the decryption key bunch matrix D is obtained in the form D= [dij], i=1 to n, j=1 to n, (2.4) It is to be noted her that all the elements of D are also odd numbers which lie in .
(2.14) The details of the function Permute() and the function Substitute() are explained later. It is to be noted here, that the functions ISubstitute() and IPermute() denote the reverse process of the functions Substitute() and Permute().  The 1 st row of this table contains the serial number, and the 3 rd row of this table indicates the ascending order of the numbers in the key, given in the 2 nd row.
Consider the plaintext P in any round of the iteration process. It is possible to see this plaintext as a set of square matrices of size 16 whenever n is divisible by 16. As the Table-1 is suggesting, we interchange the rows (1,10), (2,14), (3,9), (5,4), (8,15), (11,7) and (13,6). (2.16) 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 plaintext remains in a systematic manner. This is the basic idea underlying in the function Permute(), when n>=16. On the other hand, when n takes n takes a value less than 16, for example when n=4, then let us see how the process of the permutation will be carried out.
Consider an example when n=4. In this case, the plaintext is of the form On representing 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 32 columns. This can be written, for convenience, in the form of another matrix, given by (2.19).
This matrix has 8 rows and 16 columns. In order to carry out permutation, we swap the rows (5,4) as indicated by (2.16). The rest of the rows are untouched, as we do not have the possibility of interchange. Then the columns are interchanged by following the content of (2.16).
Let us now consider the process of substitution, which depends upon the permutation. The EBCDIC code, which includes the number 0 to 255, can be written in the form of a matrix, given by This has 16 rows and 16 columns. On interchanging the rows first and then the columns next, we get a new matrix, having the numbers 0 to 255, in some other order. This table can be written in the form, given in (2.21).
On noting the correspondence between the matrices, given by (2.20) and (2.21), we can perform the substitution process in any plaintext. Thus we have the function Substitute().
In this cipher, r denotes the number of rounds carried out in the iteration process. Here, we have taken r=16.

III. ILLUSTRATION OF THE CIPHER AND THE AVALANCHE EFFECT
Consider the plaintext given below.
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 responsibility to protect 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 parties such as Congress, Communist and BJP. Today, parties have grown as mushrooms and the number of parties is that many. We do not know, in what way unity can be achieved in this country! Each party wants to destroy the other party, each party want to come to power, and each thinks that it must rule the whole country, crushing all the other parties. Ethical values have gone down! Each person want to earn crores and crores, so that he would be able to build up his own party, and to feed all the members entering into his party in a grand manner with additional facilities, such as liquor and all the other attractions satisfying the passion. This is the fate of the country! You may protect6 the country at the borders, but I do not know who can protect this country within this country from the tyranny of all the political parties and the people supporting them. Here, it may be noted that we have taken this K as the same as (2.15), as this is having modular arithmetic inverse.    111  103  97  101  107  102  96  98  110  106  108  99  100  104  109  105   15  7  1  5  11  6  0  2  14  10  12  3  4  8  13  9   47  39  33  37  43  38  32  34  46  42  44  35  36  40  45  41   239  231  225  229  235  230  224  226  238  234  236  227  228  232  237  233   175  167  161  165  171  166  160  162  174  170  172  163  164  168  173  169   207  199  193  197  203  198  192  194  206  202  204  195  196  200  205  201   63  55  49  53  59  54  48  50  62  58  60  51  52  56  61  57   79  71  65  69  75  70  64  66  78  74  76  67  68  72  77  73   143  135  129  133  139  134  128  130  142  138  140  131  132  136  141  137   223  215  209  213  219  214  208  210  222  218  220  211  212  216  221  217   159  151  145  149  155  150  144  146  158  154  156  147  148  152  157  On using the C, the D, and the K, given by (3.6), (3.7) and (3.4), and applying the decryption algorithm, we get back the plaintext P.
Let us now examine the avalanche effect. On replacing the 4th row 4th column element, 137 by 153, we have a change of one binary bit in the plaintext P. On using this modified plaintext, the K, and the E, and employing the encryption algorithm, we get the ciphertext C in the form On comparing (3.6) and (3.8), after putting them in their binary form, we find that these two ciphertexts differ by 70 bits out of 128 bits.
Let us now consider a one binary bit change in the key K. On replacing the 2nd row 3rd column element, 16 of the key K, given by (3.4), by 48, we have a one bit change. On using this modified key, the plaintext P, and the encryption key bunch matrix E, and the encryption algorithm, given in section 2, the ciphertext corresponding to the modified key is obtained in the form On comparing (3.6) and (3.9), after putting them in their binary form, we notice that these two ciphertexts differ by 81 bits out of 128 bits.
From the above discussion, we conclude that, this cipher exhibits a strong avalanche effect, which stands as a benchmark in respect of the strength of the cipher.

IV. CRYPTANALYSIS
This is the analysis which enables us to establish the strength of the cipher. The different types of attacks available in the literature of the cryptography are 1. Ciphertext only attack (Brute force attack), 2. Known plaintext attack, 3. Chosen plaintext attack, and 4. Chosen ciphertext attack.
Generally, an analytical proof is offered in the first two cases, and a checkup is done with all possible intuitive ideas in the latter two cases. A cipher is said to be acceptable, if it withstands the first two attacks [1].
In this cipher, 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 space is On assuming that the time required for the computation with one value of the key and the one value of the E, in the key space as 10 -7 , the time required for the execution of the cipher with all possible keys (i.e., taking all possible pairs of K and E, into consideration) in the key space is Specifically, in this analysis, as we have n=4, the time given by (4.2), takes the form 3.12 x 10 57 years. As this time is very large, we conclude that, this cipher cannot be broken by the brute force attack.
Let us examine the known plaintext attack. Here, we have as many pairs of plaintexts and ciphertexts that we like to have, can be had, at our disposal. Confining our attention to r=1, that is to only one round of the iteration process, the system of equations governing the encryption process, can be written in the form P = (KP) mod 256, (4.3) P = [ ij e × ij p ] mod 256, i=1 to n, j = 1 to n, (4.4) P = Permute(P), (4.5) P = Substitute(P), (4.6) and C = P. (4.7) From (4.7), we can readily have P, as we know C. on using this P, we cannot proceed further, from bottom, as the function Substitute() and ISubstitute() depend upon the key K. Though P on the right hand of (4.3) is known to us, we cannot proceed further, as the P on the left hand side of (4.3) is unknown. In view of the above facts, we cannot the break this cipher by the known plaintext attack.
As the equations, governing the encryption process, are found to be very much involved, in view of the functions Permute() and Substitute(), which are based upon the key, and the modulo arithmetic operation, we cannot imagine to choose, intuitively, any plaintext or ciphertext, for breaking the cipher.
In the light of the above discussion, we conclude that this cipher cannot be broken by any attack, and it is a strong one by all means.

V. COMPUTATIONS AND CONCLUSIONS
In this investigation, we have developed a block cipher which involves the basic ideas of the Hill cipher [5] and the basic concepts of the key bunch matrix. Here, we have made use of the functions Permute() and Substitute(), for permuting the plaintext and for modifying the plaintext, by the substitution process. On account of these functions and the iteration process, the plaintext has undergone several modifications, in the process of encryption.
The programs required for carrying out the encryption and the decryption are written in Java.
The plaintext, given by (3.1), is divided into 77 blocks. As the last block is having only 2 characters, we have added 14 zeroes as additional characters to make it a complete block. On carrying out the encryption of each block separately, by using the K and the E, we get the ciphertext corresponding to the entire plaintext (3.1), in the form (5.1). The cryptanalysis carried out in this investigation, has clearly shown that this cipher 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 corresponding encryption key bunch matrix. Then this can be applied to the encryption of images and security of images can be achieved very conveniently.