Вы находитесь на странице: 1из 8

The International Journal of Engineering

And Science (IJES)


||Volume|| 1 ||Issue|| 2 ||Pages|| 40-47 ||2012||
ISSN: 2319 1813 ISBN: 2319 1805
www.theijes.com THE IJES Page 40
A Block Cipher Involving A Key Matrix
And A Key Bunch Matrix, Supplemented With Permutation
1,
Dr. V.U.K.Sastry,
2,
K. Shirisha
1,2,
Dept. of Computer Science & Engineering, SreeNidhi Institute of Science & Technology


--------------------------------------------------------------Abstract------------------------------------------------------------------------
In this paper, we have devoted our attention to the development of a block cipher, which involves a key matrix
and a key bunch matrix. Here, we have used a funct ion called Permute() for causing permutation of the binary
bits of the plaintext, in each round of the iteration process. Here, the diffusion arising on account of the keys
and the confusion caused by the permutation, both play a prominent role in strengthening the cipher. The
cryptanalysis carried out in this investigation strongly indicates the strength of the cipher.

Keywords - avalanche effect, cryptanalysis, decryption, encryption, key bunch matrix, key matrix, permutation


-----------------------------------------------------------------------------------------------------------------------------------------------------
Date of Submission:20, November, 2012 Date of Publication: 5,December 2012
-----------------------------------------------------------------------------------------------------------------------------------------------------

1. INTRODUCTION
In a recent investigation [1], we have developed a block cipher, which includes a key matrix and a key
bunch matrix. In this, the process of the encryption is supplemented with a function called Mix(), in which the
binary bits of the plaintext are thoroughly mixed in each round of the iteration process. In this, we have made use
of the modular arithmetic inverse of the key matrix, used in the Hill cipher [2], and the concept of the
multiplicative inverse, which yields the decryption key bunch matrix, that is required in the decryption process.
The strength of this cipher is found to be remarkable. The cryptanalysis shows very clearly, that this cipher
cannot be broken by any general cryptanalytic attack.In the present paper, our objective is to develop another
strong block cipher by using the basic ideas of the Hill cipher, and the basic ideas of the key bunch matrix [3-4].
Here we introduce a permutation process which shuffles the binary bits of a plaintext in each round of the
iteration process. The details of the function Permute(), which describes the permutation process, are given later
in section 2. Here, the strength of the cipher is expected to enhance, as the function Permute() is supporting the
cipher.In what follows, we present the plan of the paper. In this, section 2 deals with the development of the
cipher. Here, we have presented the flowcharts and the algorithms which indicate the development of the cipher.
In section 3, we have put forth an illustration of the cipher and examined the avalanche effect, which stands as
benchmark in respect of the strength of the cipher. Then we have discussed the cryptanalysis, in sect ion 4.
Finally, in section 5, we have considered the computations carried out in this investigation, and have drawn out
the conclusions from this analysis.

2. DEVELOPMENT OF THE CIPHER
Consider a plaintext. On using the EBCDIC code, we represent this in the form of a matrix, given by
P = [
ij
p ], I = 1 to n, j=1 to n. (2.1)
Let us choose a key matrix K and an encryption key bunch matrix E in the form
K = [
ij
k ], I = 1 to n, j=1 to n, (2.2)
and
E = [
ij
e ], i =1 to n, j=1 to n, (2.3)
Here, we assume that the determinant of K is not equal to zero and it is an odd number. In view of this fact the
modular arithmetic inverse of K can be obtained by using the relation


A Block Cipher Involving A Key Matrix
www.theijes.com THE IJES Page 41
I KK =

256 mod ) (
1
(2.4)

On assuming that
ij
e , the elements of the matrix E, are odd numbers lying in [1-255], we get the decryption key
bunch matrix D in the form
D = [
ij
d ], i=1 to n, j=1 to n, (2.5)
where
ij
e and
ij
d are governed by the relation
(
ij
e
ij
d ) mod 256 = 1 (2.6)
Here, it is to be noted that
ij
d also turn out to be odd numbers in [1-255].
The basic equations governing the encryption and the decryption are given by
P = (KP) mod 256, (2.7)
P = [
ij
e
ij
p ] mod 256, i=1 to n, j = 1 to n, (2.8)
P = Permute(P), (2.9)
C = P, (2.10)
and
C = IPermute(C), (2.11)
C=[
ij
c ]=[
ij
d
ij
c ] mod 256, i=1 to n, j=1 to n (2.12)
C = , 256 mod ) (
1
C K

(2.13)
P = C. (2.14)

The details of the function Permute() and the function IPermute(), the reverse process of the Permute(), are
given later. The flowcharts representing this process are given in Figs. 1 and 2.

The corresponding algorithms for the encryption and the decryption are as follows.

Algorithm for Encryption
1. Read P,E,K,n,r
2. For k = 1 to r do
{
3. P = KP mod 256
4. For i=1 to n do
{
5. For j=1 to n do
{
6.
ij
p = (
ij
e
ij
p )

mod 256
}
}
7. P = [
ij
p ]
8. P = Permute(P)
}
9. C=P
10. Write(C)

Algorithm for Decryption
1. Read C,E,K,n,r
2. D=Mult(E)
3. K
-1
= Inv(K)
4. For k = 1 to r do
{
5. C=IPermute(C)
6. For i =1 to n do

A Block Cipher Involving A Key Matrix
www.theijes.com THE IJES Page 42
{
7. For j=1 to n do
{
8.
ij
c = (
ij
d
ij
c ) mod 256
}
}
9. C = [
ij
c ]
10. C=(K
-1
C) mod 256
}
11. P=C
12. Write (P)


Read P,E,K,n,r
For k=1 to r
P = KP mod 256
For i=1 to n
For j=1 to n

ij
p = (
ij ij
p e

)

mod 256
P = [
ij
p ]
P= Permute(P)
C=P
Write (C)
Fig.1 Flowchart for Encryption
For k = 1 to r

Read C,E,K,n,r
D = Mult(E)
K
-1
=Inv(K)
C = IPermute(C)
For j=1 to n

For i=1 to n

ij
c = (
ij
d
ij
c ) mod 256
C = (K
-1
C) mod 256

C = [
ij
c ]

Write (P)
P =C

Fig.2. Flowchart for Decryption

A Block Cipher Involving A Key Matrix
www.theijes.com THE IJES Page 43
In this analysis, r denotes the number of rounds carried out in the iteration process. Here we take r=16.
The process of permutation, embedded in the function Permute(), is explained below. Let P=[
ij
p ], i=1 to n, j=1
to n, be the plaintext matrix in any round of the iteration process. On writing each element in terms of binary bits,
in a row-wise manner, we get a matrix of size n 8n. Then we offer a right circular rotation to the first row and a
downward circular rotation to the first column. On assuming that, n is divisible by 8, the afore-mentioned matrix
can be viewed as (n
2
/8) sub-matrices, where each sub-matrix is a square matrix of size 8. Now, we focus our
attention on each sub-matrix, and partition this into four sub-matrices, wherein each one is a square matrix of size
4, by dividing horizontally and vertically. Then, on permuting the 4x4 sub-matrices by swapping them along the
diagonals, they occupy new positions. Now, we convert the binary bits of the afore-mentioned matrix into
decimal numbers, by taking the binary bits in a column-wise manner, and writing the decimal numbers in a row-
wise manner. We get the ultimate permuted form. The function IPermute() is having the reverse process of the
function Permute(). The function Inv() yields the modular arithmetic inverse of the key matrix K. The function
Mult() is used to obtain the decryption key bunch matrix D for the given encryption key bunch matrix E. For a
detailed discussion of these function , we may refer to [1].
3. ILLUSTRATION OF THE CIPHER AND THE AVALANCHE EFFECT
Consider the plaintext given below.
Respected Madam! If we stop tobacco production immediately at one stroke, several lakhs of farmers and
coolies, who are dependant on this production, will loose their livelihood. This may even to lead their death.
Tobacco is not only used for cigarettes and gutka, but it is also utilized in pharmacy companies and research
centers for the production of medicines. The State Government is getting an amount of twenty thousand crores
profit (as tax) on the tobacco production. If prohibition of tobacco is implemented, there is a danger that many
farmers might fall on the road without any agricultural activity, which fetches money to them. Thus, reducing
tobacco production on a world-wide basis must be planned. The World Health Organization is contemplating
this issue in a serious manner. They want to conduct a conference. In this conference, the opinion of the
farmers, who are producing tobacco, must also be taken into account. In order to send some tobacco farmers
from the village level to this sort of conferences, we must get pressure on the administration. After having such
a sort of attempt, we will let you know what is to be done by the Centre, in what way we have to proceed in this
direction. Thanking You.
(3.1)
We focus our attention on the first 16 characters. Thus we have
Respected Madam! (3.2)
On using the EBCDIC code, the plaintext (3.2) can be written in the form
(
(
(
(

=
79 148 129 132
129 212 64 132
133 163 131 133
151 162 133 217
P
(3.3)
Let us take a key matrix K and the key bunch matrix E in the form
(
(
(
(

=
90 205 126 39
121 60 146 29
199 15 13 24
12 101 181 102
K
(3.4)
and
(
(
(
(

=
41 235 155 187
39 205 195 221
49 109 99 67
235 19 23 47
E
(3.5)
On using the concept of the multiplicative inverse, mentioned in section 2, we get
(
(
(
(

=
25 195 147 115
151 5 235 117
209 101 75 107
195 27 167 207
D
(3.6)

A Block Cipher Involving A Key Matrix
www.theijes.com THE IJES Page 44
Now, on using the P, the K, and the E, given by (3.3)-(3.5), and applying the encryption algorithm, we get the
ciphertext C in the form
(
(
(
(

=
56 160 16 94
138 216 152 143
150 22 83 214
147 80 23 89
C
(3.7)
On using the C, the D, and the K, given by (3.7), (3.6) and (3.4), and employing the decryption algorithm, we
get back the original plaintext P, given by (3.3).This shows that the algorithm is perfect.Let us now study the
avalanche effect. On replacing the 3rd row 1st column element 132 of the plaintext P, given by (3.3), by 164, we
get a one binary bit change in the plaintext. On using this modified plaintext, the K, the E, and the encryption
algorithm, we obtain the corresponding ciphertext C in the form
(
(
(
(

=
149 125 76 195
128 24 66 71
45 65 157 255
22 131 232 114
C
(3.8)
On comparing (3.7) and (3.8), after putting them in their binary form, we find that these two ciphertexts differ by
71 bits out of 128 bits.Let us now consider a one binary bit change in the key matrix K. To achieve this one, we
change the 4th row 3rd column element from 205 to 204. On using this modified K, the plaintext P, the encryption
key bunch matrix E, and the encryption algorithm, given in section 2, we get the corresponding ciphertext C in the
form
(
(
(
(

=
79 148 129 132
129 212 64 132
133 163 131 133
151 162 133 217
C
(3.9)
On converting (3.9) into its binary form, and comparing the resulting matrix with the ciphertext matrix C, given
in (3.7), after putting it in its binary form, we find that these two ciphertexts differ by 71 bits out of 128 bits.
From the above discussion, we conclude that the cipher is a potential one.

4. CRYPTANALYSIS
In information security, the study of cryptanalysis occupies a very important position. This ensures the
strength of a cipher. The different types of cryptanalysis 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.
The analytical study of the first two attacks, ascertains the strength of a cipher. A cipher is generally designed
[5] so that it sustains the first two attacks. However, one has to check the strength of the cipher in respect of the
latter two attacks also. However, these two attacks are studied on the basis of intuitive ideas.Let us analyze the
brute force attack. Here, we are having the key matrix K of size nxn and the encryption key bunch matrix E, which
is also of the same size and containing the odd numbers lying in [1-255]. Thus, the size of the key space is

2 2
7 8
2 2
n n
= ( ) ( )
2
2 2
2
5 . 4
5 . 1
3
5 . 1
10 15
10 10 2 2
n
n n
n
= ~ =
(4.1)
On assuming that, the time required for the computation of the cipher with one key matrix and one key bunch
matrix in the key space is
7
10

seconds, then the time needed for the execution of the cipher with all possible
keys in the key space is
. 10 12 . 3
60 60 24 365
10 10
15 5 . 4
7 5 . 4
2
2
years
n
n

=


(4.2)
As we have taken n=4, the above time assumes the form 3.12 x 10
57
years. As the time span required here is
typically large, it is simply impossible to break the cipher by the brute force attack.Let us now consider the
known plaintext attack. In this case, we know as many pairs of plaintext and ciphertext, as we require for carrying
out the analysis. If we confine our analysis only to one round of the iteration process (r=1), then the basic
equations governing the cipher are
P = (KP) mod 256, (4.3)

A Block Cipher Involving A Key Matrix
www.theijes.com THE IJES Page 45
P = [
ij
e
ij
p ] mod 256, i=1 to n, j = 1 to n, (4.4)
P= Permute(P), (4.5)
and
C = P. (4.6)
Here, the C on the left hand side of the equation (4.6) is known to us. Thus we can have the P occurring on the
left hand side of (4.5). On using this P and IPermute(), we can obtain the P on the right hand side of (4.5), which is
the same as the P on the left hand side of (4.4). Though P on the right hand side of (4.3) is known to us, we
cannot proceed further and hence this cipher cannot be broken by the known plaintext attack, even when r=1. In
this analysis, as we have taken r=16, we can emphatically say that we cannot break this cipher by the known
plaintext attack.In view of the complexity of the equations, governing the encryption process of this cipher, on
account of the presence of the mod operation and the permutation, it is not at all possible either to choose a
plaintext or to choose a ciphertext for breaking this cipher, even by adopting all intuitive ideas.
In the light of the above discussion, we conclude that this cipher is a strong one.

5. COMPUTATIONS AND CONCLUSIONS
In the present investigation, we have devoted our attention to the development of a block cipher, which
includes a key matrix and a key bunch matrix, in the process of the encryption. Correspondingly, we have made
use of the modular arithmetic inverse of the key matrix and the decryption key bunch matrix in the process of the
decryption. The cryptanalysis carried out in this investigation, clearly shows that this cipher is a strong one, and
it cannot be broken by any cryptanalytic attack.The programs required in this analysis are developed in Java.The
plaintext, given by (3.1), containing 1225 characters, is divided into 77 blocks, wherein each block is containing 16
characters. In the last block, we have added 7 zeroes as characters so that it becomes a complete block.On using
the entire plaintext (3.1), the key matrix K, the encryption key bunch matrix E, and the algorithm for the
encryption, given in section 2, we get the corresponding ciphertext. Thus we have the same in (5.1)
In this cipher, as the key matrix K and the encryption key bunch matrix E are used for multiplying the plaintext,
in each round of the iteration process, and permutation is used for shuffling the plaintext in a thorough manner,
we have created diffusion and confusion in a significant manner so that the cipher becomes exceedingly strong.
The cryptanalysis carried out in this investigation exhibits the strength of the cipher in a remarkable manner.
It may be noted here that his cipher can be extended for a key K and encryption key bunch matrix E of very
large size, say 16x16, and then this analysis can be applied very conveniently for encryption of images.

REFERENCES
Journal Papers:
[1] Dr. V.U.K. Sastry, K.Shirisha, A Block Cipher Involving a Key Matrix and a Key bunch Matrix,
Supplemented with Mix, sent for publication.
[2] Lester Hill, (1929), Cryptography in an algebraic alphabet, (V.36 (6), pp. 306-312.), American Mathematical
Monthly.
[3] Dr. V.U.K. Sastry, K.Shirisha, A Novel Block Cipher Involving a Key Bunch Matrix, in International
Journal of Computer Applications (0975 8887) Volume 55 No.16, Oct 2012, Foundation of Computer
Science, NewYork, pp. 1-6.
[4] Dr. V.U.K. Sastry, K.Shirisha, A Block Cipher Involving a Key Bunch Matrix and Including Another Key
Matrix Supplemented with Xor Operation, in International Journal of Computer Applications (0975 8887)
Volume 55 No.16, Oct 2012, Foundation of Computer Science, NewYork, pp.7-10.

Books:
[5] William Stallings: Cryptography and Network Security: Principle and Practices, Third Edition 2003, Chapter
2, pp. 29.









A Block Cipher Involving A Key Matrix
www.theijes.com THE IJES Page 46
251 208 229 171 232 216 25 101 155 34 131 104 22 0 164 29
247 93 193 156 70 32 161 160 38 47 160 121 191 151 134 130
31 74 213 27 97 172 9 231 5 83 110 200 189 225 88 32
67 246 86 247 119 162 220 84 198 41 199 187 39 21 82 16
29 158 54 30 43 219 22 31 24 239 191 150 201 131 220 189
120 218 88 157 165 109 92 236 108 78 153 42 177 240 218 247
29 178 33 103 67 115 172 54 167 60 118 180 63 108 127 118
210 54 46 137 247 176 79 248 15 17 175 176 212 159 62 90
213 255 201 138 57 12 139 130 249 116 221 75 53 68 55 6
23 187 124 52 109 110 233 241 1 107 176 57 6 102 24 46
159 137 201 221 185 20 19 159 44 55 11 251 133 167 234 128
44 189 38 82 149 213 224 130 171 24 119 168 133 163 116 58
10 243 58 92 61 235 116 47 242 192 51 147 253 40 174 46
94 156 222 80 191 156 166 131 62 102 175 244 198 77 34 11
104 90 244 125 102 174 229 65 84 197 153 89 59 126 90 60
232 1 15 253 15 183 77 237 32 190 120 113 235 150 123 118
232 157 232 160 102 115 51 128 202 163 31 147 119 40 185 186
250 17 211 94 61 186 55 229 232 233 236 69 248 114 56 163
99 249 37 225 212 7 120 77 101 102 162 114 194 109 7 206
242 246 98 223 103 152 149 169 57 27 234 183 140 206 255 84
100 223 107 200 241 36 215 247 159 54 139 29 73 192 38 193
19 129 144 130 138 133 7 129 16 133 201 96 243 232 121 118
124 86 118 197 231 252 212 86 233 122 68 75 170 105 191 250
22 78 248 255 44 190 132 185 73 131 71 12 114 178 168 252
69 201 100 209 17 92 22 193 144 113 68 213 2 64 190 139
101 3 238 49 180 154 61 78 171 74 101 83 12 183 157 1
19 236 193 144 239 86 62 19 83 186 211 209 144 54 49 101
146 13 94 88 16 30 99 225 170 123 158 185 131 231 145 240
162 188 119 112 45 163 136 74 20 2 71 195 37 45 190 213
18 253 249 183 179 147 160 236 233 57 38 252 157 105 18 151
20 151 170 232 76 165 218 64 86 178 105 12 28 238 2 115
112 130 66 55 41 3 171 195 231 179 135 150 235 26 107 32
150 210 62 107 24 222 25 170 168 142 112 93 85 82 217 17
142 6 80 162 247 13 165 197 2 246 229 231 240 35 5 155
238 107 87 142 224 163 146 193 9 214 250 26 133 169 243 198
79 73 201 128 53 8 64 254 229 86 234 111 79 42 80 195
63 7 0 103 221 74 39 99 127 213 192 225 2 223 30 146
96 28 213 76 162 58 116 195 51 25 147 114 120 96 38 244
31 126 120 220 178 83 115 171 48 36 30 43 142 192 19 0
242 142 216 245 0 118 6 49 54 189 7 92 225 197 119 4
178 175 120 88 153 224 40 68 38 202 82 94 226 142 243 132
13 9 247 167 163 172 205 147 121 75 134 253 190 188 255 134
36 108 15 158 54 174 218 88 56 213 166 87 194 52 219 26
79 118 23 187 89 122 47 132 153 126 229 63 31 192 83 103
202 238 40 198 64 198 164 150 103 67 91 0 225 49 73 247
127 166 126 29 80 69 125 160 94 130 93 240 33 229 110 96
142 37 216 104 150 217 161 141 136 112 101 142 120 218 49 50
56 160 16 94 138 216 152 143 150 22 83 214 147 80 23 89


(contd.)




A Block Cipher Involving A Key Matrix
www.theijes.com THE IJES Page 47
81 162 189 64 190 147 21 42 206 136 235 96 168 175 122 52
191 57 42 104 70 27 104 53 139 151 29 98 237 170 67 83
158 41 183 37 113 99 56 239 53 42 81 156 131 74 135 66
46 210 246 134 10 108 202 93 155 41 225 76 203 130 131 35
244 157 181 98 117 33 204 213 115 86 142 114 159 168 228 138
140 15 125 69 48 172 111 163 106 151 128 198 51 216 107 35
12 212 106 148 39 95 60 58 191 202 238 142 56 144 99 73
77 175 7 58 66 98 73 0 112 235 127 173 99 34 203 5
181 184 235 79 89 0 172 164 137 217 210 117 185 175 187 76
167 135 58 181 242 222 136 21 211 231 120 5 30 149 77 3
207 88 170 161 245 54 221 194 194 191 193 33 63 119 117 41
185 43 156 107 37 67 156 88 120 205 233 26 104 151 173 179
172 10 169 131 106 8 141 128 243 105 223 98 85 53 69 228
196 35 158 199 11 221 108 159 28 65 114 89 247 170 41 210
133 188 81 26 230 89 175 237 116 119 230 91 23 159 81 89
129 234 190 132 25 94 24 228 106 112 219 197 233 110 221 195
91 191 67 234 13 57 187 45 65 159 223 5 248 16 87 21
110 183 155 152 107 167 49 51 180 219 114 200 221 204 37 217
207 83 132 158 153 121 127 137 61 122 234 157 42 224 159 55
28 160 95 248 106 20 19 216 135 15 69 233 184 183 76 203
231 152 130 103 96 128 194 110 25 86 126 196 221 127 135 45
255 107 165 123 150 37 175 100 115 17 246 14 122 129 164 239
39 105 55 50 114 1 54 53 221 170 104 29 131 103 15 95
203 8 161 32 194 53 232 216 89 116 104 99 168 107 189 43
138 165 150 124 250 243 112 154 61 40 210 128 25 43 25 239
28 14 0 101 88 244 222 90 248 17 194 23 224 109 238 33
204 230 47 82 163 244 223 129 78 225 169 94 199 131 100 39
7 102 120 78 158 229 72 38 48 15 17 73 253 161 253 56
181 96 18 198 254 192 24 113 76 81 247 75 168 193 162 218
(5.1)



Biographies and Photographs
Dr. V. U. K. Sastry is presently working as Professor in the Dept. of Computer Science and Engineering
(CSE), Director (SCSI), Dean (R & D), SreeNidhi Institute of Science and Technology (SNIST), Hyderabad, India.
He was Formerly Professor in IIT, Kharagpur, India and worked in IIT, Kharagpur during 1963 1998. He guided
14 PhDs, and published more than 86 research papers in various international journals. He received the best
Engineering College Faculty Award in Computer Science and Engineering for the year 2008 from the Indian
Society for Technical Education (AP Chapter), Best Teacher Award by Lions Clubs International, Hyderabad
Elite, in 2012, and Cognizant- Sreenidhi Best faculty award for the year 2012. His research interests are Network
Security & Cryptography, Image Processing, Data Mining and Genetic Algorithms.

K. Shirisha is currently working as Associate Professor in the Department of Computer Science and
Engineering (CSE), SreeNidhi Institute of Science & Technology (SNIST), Hyderabad, India, since February 2007.
She is pursuing her Ph.D. Her research interests are Data Mining and Information Security.

Вам также может понравиться