You are on page 1of 9

Hill Cipher

Encryption of 2 x 2 matrix

Let us discuss in this section HILL cipher


  encryption technique. The formula
to solve the problem of Hill cipher is: given a plaintext, P=HELP; a key,
Now, we are already given k in Matrix form. We need to find P in Matrix
form, using the 26 letters alphabet to letter conversion. So for the conversion
of HELP to letter, we have:
H=7, E=4, L=11, P=15
Hence, HELP in matrix form will be using only HE of the word HELP since it is
a 2 x 2 matrices
Thus, we have P=HE=
Hill Cipher cont’d
• 

  1   1
Hill Cipher cont’d

•Note
 
If three matrices are given, then take three characters at a time i.e.
where P=HELP then

P=HEL =
Hill Cipher cont’d

•Assignment
 
Encrypt and decrypt the following with the key using the same
method above
1. P = LPO
2. P = NYSC
3. P = INEC
4. P = FRSC
5. P= DATA
Hill Cipher cont’d

•Assignment
 
Encrypt and decrypt the following with the key using the same
method above
1. P = LPO
2. P = CPN
3. P = MBU
4. P= GLO
5. P = GOOD
Decryption of 2 x 2 matrix
•P=HELP,
  , C= HI
Remember that the formula for encryption is
C= K.P mod 26
The formula for decryption is P=K-1C mod 26
The formula to find inverse of a matrix is

To find the adjoint of a matrix, for instance,


we have which this is gotten by changing the position of a and d (i.e.
interchanging a and d) and adding – to each of c and d
Decryption of 2 x 2 matrix

• 
Hence,
Now substitute them into

We have:

Find the inverse of 9 in mod 26?


The inverse of 9 in mod 26 is 3

Note that in mod 26 operation, we cannot have a negative operation,


hence, we add 26 to the negative number.
Decryption of 2 x 2 matrix
• 
4 2
   
69 72


26
2 6


52 52
17
20

Now we have
Decryption of 2 x 2 matrix
•Hence
 

Find mod quickly using calculator

d 26
mo

Which is the plaintext

You might also like