A Modified Feistel Cipher Involving Substitution, shifting of rows, mixing of columns, XOR operation with a Key and Shuffling

In this paper, we have developed a modification to the Feistel cipher by taking the plaintext in the form of a pair of matrices and introducing a set of functions namely, substitute, shifting of rows, mixing of columns and XOR operation with a key. Further we have supplemented this process by using another function called shuffling at the end of each round of the iteration process. In this analysis, the cryptanalysis clearly indicates that the strength of the cipher is quite significant and this is achieved by the introduction of the aforementioned functions.


INTRODUCTION
The study of the Feistel cipher has been a fascinating fundamental area in the development of block ciphers in cryptography.In the recent years, we have offered several modifications [1][2][3][4] to the classical Feistel cipher by taking the plaintext in the form of a pair of matrices.In all these investigations, we have made use of the multiplication with a single key matrix or the multiplication with a pair of key matrices as a fundamental tool in the development of the cipher.This is associated with the mod operation.Further, we have introduced some operations such as mixing, permutation, blending or shuffling in order to achieve confusion and diffusion, so that, the strength of the cipher becomes significant.
In the present investigation, our objective is to study a modification of the Feistel cipher, wherein we use the fundamental operations such as substitution, shifting of rows, mixing of columns, XOR operation and Shuffling.It may be noted here that the operations, substitution, shifting of rows and mixing of columns are very well utilized in Advanced Encryption Standard (AES) [5].Our interest here is to develop a strong block cipher which exceeds, in strength, almost all the other ciphers available in the literature.
In what follows we present the plan of the paper.In section 2, we deal with the development of the cipher and present the flowcharts and algorithms required in this analysis.In section 3, we mention an illustration of the cipher and describe the avalanche effect.We study the cryptanalysis in section 4. Finally, in section 5, we discuss the computations and draw conclusions.

II. DEVELOPMENT OF THE CIPHER
Consider a plaintext P containing 2m 2 characters.On using the EBCIDIC code, the characters occurring in the plaintext can be represented in terms of decimal numbers wherein each number lies in [0 -255].Then, these numbers can be written in the form of a pair of square matrices P 0 and Q 0 , wherein each one is of size m.
Let us consider a key matrix K, where K is a square matrix whose size is m.
The flowcharts depicting the encryption and the decryption are given below.4. for i = r to 1 begin end 5. P = P 0 Q 0 /* represents concatenation */

Write (P)
Let us now explain the basic ideas underlying in the functions Sub ( ), Shift ( ), Mix ( ), used for substitution, shifting of rows, mixing of columns respectively.
Firstly, Let us focus our attention on the substitution process involved in the function Sub ( ).
Consider the EBCIDIC code which can be written in the form a matrix given by E (i, j) = 16*(i-1) + (j-1), i = 1 to 16 and j = 1 to 16 (2.1)All these numbers can be placed in the form of a table.
Let us arrange these numbers, which are lying in the interval [0-255], in a random manner.
We represent these numbers in the hexadecimal notation.All these numbers can be written in the form of a table given below (table 2).
In the encryption process, when we come across a number lying in [0-255], we will replace it by the corresponding number in the substitution table.For example, if we come across the number 70, in the process of encryption, this will be converted into hexadecimal number as 46.Then, 70 will be replaced by the number which is occurring in the 4 th row, 6 th column of the substitution table, i.e by 5A ( = 90 in decimal notation).This is the process of substitution.Keeping the EBCIDIC code matrix and the substitution table in view, we form the inverse substitution table which is given in Table 2.
The inverse substitution table will be utilized while carrying out the decryption process and it is denoted by function ISub ( ).
Read Pr, Qr, , K P i-1 = IMix ( P i-1 )  Here each row contains 8m binary bits.In the process of shifting, we offer a right shift of 4 bits in the first row, 12 bits in the second row, 20 bits in the third row and in general, 4 + 8 * (i-1) bits right shift in the i th row.This process is carried out till we exhaust all the rows.It may be noted here that IShift ( ) denotes the reverse process of Shift ( ).
In this, the binary bits are obviously given a left shift in an appropriate manner.
To have a clear insight into the mixing process denoted by the function Mix ( ), let us consider again the matrix P i-1 , which is represented in the form (2.5).
Let us restrict our attention only to a plaintext matrix, wherein, m=4.This can be written in the form given below This has 4 rows and 32 columns.On concatenating the binary bits of the 1 st column and the 17 th column we get a string of binary bits, which can be converted into a decimal number.This can be considered as new p 11 .
On considering the binary bits of the 2 nd column and the 18 th column and concatenating them, we get another decimal number which will be called as p 12 .
On adopting the same process till we exhaust all the columns taken in pairs, we get the decimal numbers which correspond to the other elements of the matrix written in the row wise order.Thus we have, the new plaintext matrix, which is obtained after the completion of mixing.Imix ( ) is the reverse process of Mix ( ).
For a detailed discussion of the function shuffle ( ), wherein we are shuffling the columns of two matrices, we refer to [4].

III. ILLUSTRATION OF THE CIPHER Consider the plaintext given below
My dear young lady!We both are well qualified.You have done your B.Tech and I have completed my M.S, where is the problem!We can fly anywhere.Why your father and mother are not accepting our marriage.We both belong to the same cast, we both are farmers.What is the objection of your father and your mother, are they having any thinking regarding my financial status?We are having as much landed property as your father is having.My father and your father both are well trained seasonal politicians.I wonder why your father is not accepting and why your mother is not accepting.Our marriage must happen soon.Yours loving Mr.X (3.1) Let us focus our attention on the first 32 characters of the plaintext.This is given by My dear young lady!We both are On using the decryption algorithm on (3.6), we get back the original plaintext P given by (3.2).
Let us now study the avalanche effect which throws some light on the strength of the cipher.
On changing the first row, first column element of P 0 , from 77 to 76, we get a 1 bit change in the plaintext.On applying the encryption algorithm on the modified plaintext, keeping up the key as it is, we get the ciphertext C in the form On comparing (3.6) and (3.7), after converting them into their binary form, we notice that they differ by 128 bits out of 256 bits.This indicates that the cipher is quite good from the view point of its strength.
Let us now consider a one bit change in the key.This is achieved by changing first row, first column element of the key K, given by (3.5), from 45 to 44.This also shows that, the strength of the cipher is expected to be significant.

IV. CRYPTANALYSIS
In cryptography, determination of the strength of the cipher is a very important aspect.In the literature of cryptography, it is well known that the cryptanalysis can be carried out by the following approaches.

Ciphertext only attack ( Brute force attack ) 2. Known plaintext attack 3. Chosen plaintext attack 4. Chosen ciphertext attack
As William Stallings [6] has pointed out that every cipher must be designed so that it withstands the first two attacks at least.

Let us now consider the brute force attack.
Here the key is containing m 2 decimal numbers.Thus the size of the key space 8m 2 = 2 .Let us suppose that, the time required for the computation of the cipher with one value of the key is 10 -7 seconds.Then the time required for processing the cipher with all the possible values of the key in the key space is 8m 2  (2.4) m 2 -7 (2.4)m 2 -15 (2) x 10 -7 = 10 = 3.12 x 10 years 365x24x60x60 365x24x60x60 This time is very large when m is greater than or equal to 3.
In our example as we have taken m=4, the attack on this cipher, by the brute force approach, is totally ruled out.
Let us now investigate the known plaintext attack.In this case, we know as many plaintext and ciphertext pairs as we require, making an attempt for breaking the cipher.In the light of the above information, we have as many pairs of P and C as we require.If we take r=1, that is, if we confine our attention to a single round of the iteration process, then we have the relations connecting C and P as follows: P 0 = Sub (P 0 ) (4.1) P 0 = Shift (P 0 ) (4.2) P 0 = Mix (P 0 ) (4.3) P 0 = P 0 K (4.4) In the known plaintext attack, we know P 0 and Q 0 corresponding to the initial stage.We also know the C obtained at the end.
As C is known to us, we can determine P 1 and Q 1 from (4.10) On using the IShuffle ( ), on (4.9), we get the current P 0 and Q 0 which are occurring on the left hand side of (4.4) and (4.8).On using initial the P 0 and the Sub ( ), we get P 0 on the left hand side of (4.1).After that, on using shift ( ) on the available P 0 , we get P 0 occurring on the Left hand side of (4.2).Then on using the function Mix( ) on the current P 0 , we have the P 0 occurring on the left side of (4.3).Thus, we can readily determine the key K from (4.4).Hence this cipher can be broken by the known plaintext attack if we confine only to one step in the iteration process.
Let us now study the cipher when r = 2. Then the equations governing the cipher are (4.1) to (4.10) and the following P 1 = Sub (P 1 ) (4.11) P 1 = Shift (P 1 ) (4.12) P 1 = Mix (P 1 ) (4.13) P 1 = P 1 K (4.14) In the known plaintext attack, we know C, obtained at the end of the iteration process, and the corresponding P 0 and Q 0 , which are available at the very beginning of the iteration process.
As we know C, we can determine P 2 and Q 2 from (4.20).On using IShuffle on (4.19), we get P 1 and Q 1 which are occurring on the left side of (4.14) and (4.18).We cannot determine K as we do not know the P 1 and Q 1 occurring in the right hand side of (4.14) and (4.18).Here, we notice that, though P 0 and Q 0 are known to us, we cannot determine the P 1 and Q 1 which are occurring on the right hand side of (4.14) and (4.18), by starting at the beginning as the key K is occurring in (4.4) and (4.8).In the light of these facts, this cipher cannot be broken by the known plaintext attack, when we have confined to r=2.This shows that it is impossible to break the cipher by the known plaintext attack when we carry out all the sixteen rounds in the iteration.
Intuitively choosing a plaintext or ciphertext and determining the key or a function of the key is a formidable task in the case of this cipher.
From the above discussion we conclude that this cipher is not breakable by all the possible attacks that are available in cryptography.

V. COMPUTATIONS AND CONCLUSIONS
In this investigation, we have offered a through modification in the Feistel cipher by taking the plaintext in the form of a pair of matrices, and by applying several procedures, namely, substitution, shifting, mixing, XORing with the key and shuffle operation.Each one of these procedures modifies the plaintext in a through manner and creates confusion and diffusion in the development of the cipher.The iteration process, which is the basic one in this cipher, supports all the above procedures in a strong way.
Here it may be noted that the substitution table generated in a random manner by using the numbers [0-255] is to be sent to the receiver by the sender.
The programs for encryption and decryption are written in C language.
The plaintext given in (3.1) is divided into 20 blocks, wherein each block is containing 32 characters.We have appended in the last block by adding 13 blank characters, so that it becomes a complete block.On applying the encryption algorithm given in section 2 we get the cipher text corresponding to the entire plaintext (excluding the first block for which the cipher text is already given in ( The cryptanalysis, carried out in this investigation, clearly shows that this cipher is a strong one.This has become a very good cipher as we have taken the length of the plaintext as large as possible (2048 bits), and supported the encryption process with a good number of functions so that the plaintext undergoes a through transformation ( in each round of the iteration process) before it becomes the ciphertext.In this analysis, the substitution table generated in the random manner plays a very important role.

Fig 1 .
Fig 1.The process of Encryption

Fig 2 .
Fig 2. The process of Decryption Now we write the algorithms for the processes encryption and decryption as given below.A. Algorithm for Encryption 1. Read P, K 2. P 0 = Left half of P. 3. Q 0 = Right half of P. 4. for i = 1 to r begin P i-1 = Sub (P i-1 )

end 5 .
C = P r Q r /* represents concatenation */ 6. Write(C) B. Algorithm for Decryption 1. Read C, K 2. P r = Left half of C. 3. Q r = Right half of C.
Now on using the modified key and applying the encryption algorithm, keeping the plaintext as it is, we get the cipher text C in the form 79 on comparing (3.6) and (3.8), after converting both into their binary form, we find that these two ciphertexts differ by 134 bits out of 256 bits. .ijacsa.thesai.org