A Modified Hill Cipher Involving Permutation, Iteration and The Key in A Specified Position
A Modified Hill Cipher Involving Permutation, Iteration and The Key in A Specified Position
p121 O p128
0 1 1 0 1 0 1 1
M 0
1 1 1 1 0 0 1
O M (6) .
1
0
0 0 1 1 0 1 0
0 0 0 1 1 0 0
M O M
0 0 1 1 0 0 0 0
pnn1 K pnn8 1
1 0 0 0 0 1 0
0 0 1 1 1 0 0 0
0 0 0 0 0 0 1 1
This is obtained by converting each element of the P into
In order to have clear insight into the process of
its binary form. On assuming that the n is an even number,
permutation let us explain what we have done. Here we
the above matrix can be divided into two equal halves,
have started with the last element of the last row of the
where in each half contains m/2 rows. Then the upper half
upper half in (8), and have gone in the backward direction (
is mapped into a matrix containing m rows and four
placing the elements one after another in a column wise
columns. In the process of mapping we start with the last
manner in the first column, second column, etc., ) till we
element of the upper half and place it as the first row, first
have reached the first element of the matrix. This results in
column element of a new matrix. Then we place the last but
the first four columns of (9). Then we have commenced
one element of the upper half as the element in the second
with the first element of the lower half and filled up,
row and first column. We continue this process of placing
element after element, in the remaining four columns of (9)
the remaining elements of the upper half, one after another,
till we have reached the last element of (8). This has
till we get m rows and four columns of the new matrix.
enabled us to obtain (9). This process of permutation is
Then we place the elements of the lower half from the
expected to thoroughly permute the binary bits which are
beginning to the end in their order , such that they occupy
obtained as a consequence of the product of the plaintext
four more columns and m rows. Thus we again get a matrix
matrix and the key matrix.
of size mx8.
The matrix (9) can be brought into its corresponding
For example when n=4 (i.e., m=16), let us suppose
decimal form as shown below.
that the plaintext matrix, P is given by
216 218 18 234
86 103 83 56
35 43 36 219 165 116 155 128
P= (7) 107 121 154 12 (10)
210 242 12 16
48 194 56
3
114 165 10 193
Obviously as it is expected the elements of original
matrix, P (7) and the elements of the matrix (10) obtained
on permutation are totally different.
This can be brought to the binary form given by
It may be noted here that the IPermute() in the
0 1 0 1 0 1 1 0 decryption is a reverse process of the Permute() used in the
0 1 1 0 0 1 1 1 encryption.
0 1 0 1 0 0 1 1 The algorithms for encryption and decryption are
0 0 1 1 1 0 0 0
(8) written below.
0 0 1 0 0 0 1 1
0 0 1 0 1 0 1 1
0 0 1 0 0 1 0 0 Algorithm for Encryption
1 1 0 1 1 0 1 1
1 1 0 1 0 0 1 0 1. Read n,P,K,r
1 1 1 1 0 0 1 0
2. for i = 1 to r
0 0 0 0 1 1 0 0
0 0 0 1 0 0 0 0
{
0 1 1 1 0 0 1 0 if ( (i mod 2)=1)
1 0 1 0 0 1 0 1
P=(KP) mod 256
0 0 0 0 1 0 1 0
else
1 1 0 0 0 0 0 1
P =( PK) mod 256
On permuting the above matrix in accordance with P= Permute(P)
the process explained earlier, we get }
C=P
3. Write( C )
160 (IJCNS) International Journal of Computer and Network Security,
Vol. 2, No. 10, 2010
(10 )
specified position. In the first round the key is on the left
x10 −7
( )
38.4 side of the plaintext and it is on the right side in the second
= 3.17 x 10 38.4 x10 −15 round. The same pattern is continued in the subsequent
365 x 24 x 60 x 60
rounds.
( )
The algorithms for encryption and decryption, mentioned
= 3.17 x 10 23.4 years. in section 2, are implemented in java.
Thus the cipher cannot be broken by the Ciphertext only On using the program for encryption the Ciphertext
attack. corresponding to the entire plaintext given in 3.2 is
In the case of the known plaintext attack, we know as obtained as
many pairs of plaintext and ciphertext as we require. For
example, we confine our attention only to two rounds of the
iteration process in the encryption. For the sake of
convenience in presentation, let us denote the function
Permute() as F(). Then we have