0% found this document useful (0 votes)
35 views16 pages

Lecture 6

The document discusses the Hill Cipher Algorithm, a method of cryptography developed by Lester Hill in 1929 that uses matrix multiplication for encoding and decoding messages. It outlines the steps for encoding a message into numbers, applying an encoding matrix, and then decoding it using the matrix inverse. Although the Hill Cipher was once considered sophisticated, it is now regarded as insecure due to advancements in technology, prompting the use of more complex modern encryption methods.

Uploaded by

Abebayehu Endale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views16 pages

Lecture 6

The document discusses the Hill Cipher Algorithm, a method of cryptography developed by Lester Hill in 1929 that uses matrix multiplication for encoding and decoding messages. It outlines the steps for encoding a message into numbers, applying an encoding matrix, and then decoding it using the matrix inverse. Although the Hill Cipher was once considered sophisticated, it is now regarded as insecure due to advancements in technology, prompting the use of more complex modern encryption methods.

Uploaded by

Abebayehu Endale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Lecture 6.

Application: Cryptography1

Hill’s cipher machine (from Wikipedia)

1
Cryptography is the process of coding and decoding messages. The word comes from the Greek
‘kryptos’ meaning ‘hidden’.
• Encryption dates back approximately 4000 years. Historical accounts indicate that
the Chinese, Egyptians, Indian, and Greek encrypted messages in some way for
various purposes.
• In this note we will learn how to
1 encode a message using matrix multiplication and
2 decode a coded message using the matrix inverse and matrix multiplication.
• This method, known as the Hill Cipher Algorithm, was created by Lester Hill in
1929. These days, the Hill Algorithm is not considered a secure encryption method
because it is relatively easy to break with modern technology. However, in 1929
when it was developed, Hill’s method was considered sophisticated and powerful
in its time and is one of many methods influencing techniques in use today.
• Modern encryption methods are more complicated, often combining several steps
or methods to encrypt data to keep it more secure and harder to break. Some
modern methods make use of matrices as part of the encryption and decryption
process; other fields of mathematics such as number theory play a large role in
modern cryptography.
Hill Cipher Algorithm

To use matrices in encoding and decoding secret messages, our procedure is as follows.

1 We first convert the secret message into a string of numbers by arbitrarily


assigning a number to each letter of the message.
2 Next we convert this string of numbers into a new set of numbers by multiplying
the string by a square matrix of our choice (an encoding matrix) that has its
inverse. This new set of numbers represents the coded message.
3 To decode the message, we take the string of coded numbers and multiply it by
the inverse of the matrix (a decoding matrix) to get the original string of numbers.
4 Finally, by associating the numbers with their corresponding letters, we obtain the
original message.
As an example, we will use the correspondence shown below where letters A to Z
correspond to the numbers 1 to 26, a space is represented by the number 27, and
punctuation is ignored.

Example 6.1. Let the message be BUY IBM STOCK


• Then the digital form of the message is
B U Y - I B M - S T O C K
2 21 25 27 9 2 13 27 19 20 15 3 11
• Set the encoding matrix E by 2
   
−3 −3 −4 1 0 1
E = 0 1 1  with E −1 =  4 4 3 
4 3 4 −4 −3 −3

2
In general, E doesn’t have to be 3 × 3. It could be any dimensional matrix that has its inverse.
• Set the encoding matrix E by 2
   
−3 −3 −4 1 0 1
E = 0 1 1  with E −1 =  4 4 3 
4 3 4 −4 −3 −3

• Since we are going to use a 3 × 3 matrix to encode the message, we break the
digital message up into a sequence of 3 × 1 column matrices as follows.
B U Y - I B M - S T O C K
2 21 25 27 9 2 13 27 19 20 15 3 11
         
2 27 13 20 11
 21  ,  9  ,  27  ,  15  ,  27 
25 2 19 3 27
Observe that it was necessary to add two spaces at the end of the message in
order to complete the last matrix.

2
In general, E doesn’t have to be 3 × 3. It could be any dimensional matrix that has its inverse.
• We now convert the message into an enccrypted message by
• We now convert the message into an enccrypted message by
• writing the above column vectors as columns of a matrix (say M, 3 × 5 message
matrix), and
• We now convert the message into an enccrypted message by
• writing the above column vectors as columns of a matrix (say M, 3 × 5 message
matrix), and
• premultiplying that matrix by the encoding matrix.
  
−3 −3 −4 2 27 13 20 11
EM =  0 1 1   21 9 27 15 27 
4 3 4 25 2 19 3 27
 
−169 −116 −196 −117 −222
= 46 11 46 18 54  = M̃
171 143 209 137 233
• We now convert the message into an enccrypted message by
• writing the above column vectors as columns of a matrix (say M, 3 × 5 message
matrix), and
• premultiplying that matrix by the encoding matrix.
  
−3 −3 −4 2 27 13 20 11
EM =  0 1 1   21 9 27 15 27 
4 3 4 25 2 19 3 27
 
−169 −116 −196 −117 −222
= 46 11 46 18 54  = M̃
171 143 209 137 233

• The columns of this matrix M̃ give the encoded message. The message is
transmitted in the following linear form.

−169, 46, 171, −116, 11, 143, −196, 46, 209, −117, 18, 137, −222, 54, 233
• To decode the message, the receiver writes this string as a sequence of 3 × 1
column matrices and repeat the technique using the inverse of the encoding
matrix, the decoding matrix D = E −1
 
1 0 1
D= 4 4 3 
−4 −3 −3
That is,
  
1 0 1 −169 −116 −196 −117 −222
D M̃ =  4 4 3  46 11 46 18 54 
−4 −3 −3 171 143 209 137 233
 
2 27 13 20 11
=  21 9 27 15 27  = M
25 2 19 3 27
• To decode the message, the receiver writes this string as a sequence of 3 × 1
column matrices and repeat the technique using the inverse of the encoding
matrix, the decoding matrix D = E −1
 
1 0 1
D= 4 4 3 
−4 −3 −3
That is,
  
1 0 1 −169 −116 −196 −117 −222
D M̃ =  4 4 3  46 11 46 18 54 
−4 −3 −3 171 143 209 137 233
 
2 27 13 20 11
=  21 9 27 15 27  = M
25 2 19 3 27
• The columns of this matrix, written in linear form, give the original message
2 21 25 27 9 2 13 27 19 20 15 3 11
B U Y - I B M - S T O C K
Practice 6.2. Decode the message 71, 100, -1, 28, 43, -5, 84, 122, -11, 63, 98, -27,
69, 102, -12, 88, 126, -3, which was encoded using the matrix
 
1 2 1
 2 3 1 
−2 0 1
Example
 6.3. Base station sends messages to an agent using the encoding matrix
4 −3
A= . The agent sends messages to an informer using the encoding matrix
3 −2
 
3 8
B= . Find the encoding matrix that is consistent with this communication
4 11
circle, that enables base to send messages directly to the informer.
Practice 6.4. Intelligence sources give the information that the message BOSTON
CAFE AT TWO was sent as 32, 47, 59, 79, 43, 57, 33, 36, 13, 19, 59, 86, 41, 61, 67,
87, 53, 68.
(a) Find the encoding matrix.
(b) Decode the message 43, 64, 49, 70, 59, 79, 39, 45, 45, 63, 59, 79.
Summary

encoding decoding
Message = M −−−−−→ EM −−−−−→ E −1 (EM) = (E −1 E )M = In M = M

Similar application example: Error correction using Hamming’s code.

You might also like