Professional Documents
Culture Documents
……………………………. …………………………………..
Signature of Co-ordinator (PG) Signature of Project Supervisor
(Dr. Himadri Shekhar Mandal) (Dr. Manimohan Mandal)
(Assistant Professor) (Associate Professor)
Page 1
I take this opportunity to express my deep sense of gratitude to all
those who helped me to complete this project. Although it is not easy to
express gratitude in this small paper but I try my best.
With immense pleasure, I would like to present this work as a
project assignment report on “Hill Cipher; Some Approaches To Make It
More Secure” under the guidance of Dr. Manimohan Mandal, I
express my heartfelt gratitude to my guide. He helped me a lot in my
project works, also encouraged and supported to make the work proceed
successfully on a forward case.
I am deeming gratified to express my gratitude to Dr. Himadri
Shekhar Mandal, Dr. Sujit Kumar De, Dr. Prasun Kumar Nayak,
Dr. Sankar Prasad Mandal, Sri Bijan Kumar Das for their consistent
and valuable support.
I also offer my thanks to all my batch mates for their unconditional
help and inspiration.
Page 2
1. Abstract
2. Introduction
3. Polyalphabetic Substitution Cipher
3.1. Hill Cipher
3.2. Modular Arithmetic
3.3. Key Space of Hill Cipher
4. Some Secured Modification of Hill Cipher
4.1 Key Space Extension
4.2. Generation of Involutary Key Matrix
4.3. Introduce a secure Variant, V
5. Still It Is Vulnerable
5.1. Known-Plaintext Attack
6. Conclusion
References
Page 3
Cryptography is the art of writing or solving codes, that is,
the practice and study for secure communication in the presence
of the third parties called adversaries. The Hill Cipher algorithm
is one of the polyalphabetic symmetric key algorithm that has
several advantages in data encryption algorithm. The Hill cipher
is a block cipher that distinguishes the letter frequencies of the
plaintext. Its simplicity because of using matrix multiplication
and inversion for encryption and decryption, and its high speed.
Several researcher tried to improve the security of Hill cipher. In
this work, some secure cryptosystem is introduced that
overcome most of security drawbacks of the Hill cipher.
Page 4
The Hill cipher was invented by Lester. S. Hill in 1929. It is a
famous polyalphabetic classical symmetric cipher based on matrix
transformation.
In the advance age of network technology, information security is
an increasingly important problem. All the operating systems like
Windows, Android, iOS, Blackberry are continuously working to
make there system more secure. Security of ATM card, computer
passwords, sending private Emails, everywhere Cryptography plays a
central role.
In modern times, cryptography is considered to be a branch of both
mathematics and computer science, and is affiliated with information
theory, computer security, and engineering.
Substitution cipher is one of the basic components of classical
ciphers. A substitution is a method of encryption by which units of
plaintext are substituted with ciphertext according to a regular system.
In this work we first discussed the original Hill cipher and its key
space; then proposed some advance modifications. Next we presented
the way of Image Encryption by Hill cipher; next vulnerability is
discussed. Finally, we described the concluding remarks.
Page 5
Some Basic Terminology:
i. Plaintext – original message
ii. Ciphertext – coded message
iii. Cipher – algorithm for transforming plaintext to ciphertext
iv. Key – info used in cipher known only to sender & receiver
v. Encryption – converting plaintext to ciphertext
vi. Decryption – recovering plaintext from ciphertext
vii. Cryptography – study of encryption & decryption method
viii. Cryptanalysis – deciphering ciphertext without knowing key
ix. Cryptology – both cryptography & cryptanalysis
Page 6
In Polyalphabetic Substitution, each occurrence of a character may have
a different substitute. The relationship between a character in the
plaintext to a character in ciphertext is one-to-many. It has the advantage
of hiding the letter frequency of the underlying language. Hacker cannot
use single-letter frequency statistic to break the ciphertext.
Example: assume that Alice and Bob decide privately their key,
K=(1,3,2,0) then Alice send Bob a message through public channel as
“attack is today”
a b c d e f g h i j
00 01 02 03 04 05 06 07 08 09
k l m n o p q r s t
10 11 12 13 14 15 16 17 18 19
u v w x y Z
20 21 22 23 24 25
Table:1
Then by encryption,
Plaintext A T T A C K I S T O D A Y
P’s 00 19 19 00 02 10 08 18 19 14 03 00 24
Values
Key 1 3 2 0 1 3 2 0 1 3 2 0 1
stream
C’s 01 22 21 00 03 13 10 18 20 17 5 0 25
Values
Ciphertext B W V A D N K S U R F A z
Table:2
Page 7
(all operations done in mod 26)
Here, Plaintext : attackistoday;
Ciphertext: BWVADNKSURFAZ
=( ) mod 26
Page 8
mod 26
mod 26 …………(1)
( ) ( )( ) ..……….(2)
get ( ) ( ) ( ) ( ) ( ) ( ); ( ) ( );
Note that, we filled out the last matrix with uncommonly used letters. One can fill
it by repeating the last letter.
Now, ( )( ) ( ) ( )
Page 9
( )( ) ( ) ( )
( )( ) ( ) ( )
( )( ) ( ) ( )
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )
Ciphertext: TJNVQLAIVDIG;
Decryption:
( )( ) ( ) ( )
Where ( ) ( )
Page
10
To create matrices for Hill ciphers, we need to know which numbers have
invers in mod 26.
1 3 5 7 9 11 15 17 19 21 23 25
1 9 21 15 3 19 7 23 11 5 17 25
Table:3
Since, [ ]
That is, a matrix is invertible modulo 26 if and only if it is invertible in both mod 2
and mod 13.
The number of invertible n×n matrices modulo 2 is equal to the order of the
General Linear Group It is ( )( ) .
( )( ) ( )( ) .
Page
11
Being a symmetric key cipher, Hill cipher is used mainly as private key at
internetwork security. But it is still a weak algorithm for its small key space.
Also, finding invertible matrix is time-consuming. Besides, we can break its
security by solving some linear equations.
So, here we are going to modify these draw backs.
So,
If is one the factors of then is the other.
Solving the 2nd matrix equation results .
Then form the matrix.
Page
12
Algorithm:
Let ( ) then ( ).
If
then, ( ), and
( ).
So, ( )
Thus we can reduce the difficulty of calculating the inverse of the key matrix.
Page
13
To make the transformation nonlinear we introduce a column vector V with
the following form : , where the variant is of the form
. This variant will be privately discussed.
For the time of decryption we use the formula .
After so many development and work Hill Cipher till has a flaw, well known
as ‘Known-Plaintext Attack’ which sometimes break the security of Hill cipher,
although this attack is laborious.
The plaintext/ ciphertext pairs have been collected earlier. For example,
Alice has sent a secret message to Bob, but she has later made the contents of the
message public. Then Eve compare this plaintext/ ciphertext pair with the
previously collected pairs. He applies ‘ Brute-Force Attack’ and compares the
Page
14
letter frequencies successively and keeps going until he gets any meaningful
sentence. For example, if ciphertext is ‘THHMTH’, then by frequency count he
considers ‘e’ in place ‘H’.
Page
15
technique. Here, symmetric key cryptosystem is actually secure variant. Each
block of data is encrypted using different random number. Since the modulus
becomes a prime number, the key space greatly increased.
Page
16