Professional Documents
Culture Documents
Mat263 Case Study
Mat263 Case Study
MAT263
LINEAR ALGEBRA I
CASE STUDY
CRYPTOGRAPHY
GROUP
D1CS1105C
LECTURER’S NAME
MADAM WAN FAIZAH BINTI WAN YAACOB
MEMBERS’ NAME
NAME MATRIC NO.
SITI NOR SYAMIMI BINTI AHMAD 2018411986
ZAHARI
NIK NUR AFIFAH BINTI SUHAIMI 2018473342
TUAN NURNAJIHAH BINTI TUAN MD 2018407206
ZAZAWI
SUBMISSION DATE
6TH February 2021
CONTENTS
Contents Page
1.0 INTRODUCTION……………………………………………………………….. 1
2.0 OBJECTIVE…………………………………………………………………….. 2
3.0 METHODOLOGY………………………………………………………………. 3
4.0 RESULT…………………………………………………………………………. 4
5.0 DISCUSSION…………………………………………………………………… 11
1.0 INTRODUCTION
1
2.0 OBJECTIVES
2
3.0 METHODOLOGY
3.1 Hill Cipher
The method that we use is Hill Cipher. Hill Cipher is a symmetrical block
cipher technique by a mathematician, Lester Hill; is a polygraphist cipher based on
linear transformation. Hill cipher is a block cipher algorithm where plain text is divided
into a block of the same size. Hill cipher also a polygraphed substitution cipher based
on linear algebra. Each letter is represented by a number modulo 26. Often the
simple scheme A = 1, B = 2… and so on until Z = 26 is used, but this is not an
essential feature of the cipher. To encrypt a message, each block of n letters
(considered as an n-component vector) is multiplied by an invertible n × n matrix,
against modulus 26. Each block of plain text letter is then converted into a vector of
number and is dotted with the matrix. The result is then converted back to letter and
the cipher text message is produced. To decrypt the message, each block is
multiplied by the inverse of the matrix used for encryption. The matrix used for
encryption is the cipher key, and it should be chosen randomly from the set of
invertible n × n matrices (modulo 26).
3
4.0 RESULT
A B C D E F G H I J
1 2 3 4 5 6 7 8 9 10
K L M N O P Q R S T
11 12 13 14 15 16 17 18 19 20
U V W X Y Z
21 22 23 24 25 26
C H A N G E
3 8 1 14 7 5
4
Step 2: Multiply the encrypted matrix with given matrix A.
( aan111 a 1n
ann ) ( ppn111 p 1n
pnn )
(mod N)
3 8 3+24 6+8
[ ][
1 14
7 5
1 2
3 1
= ] [ ]
1+42 2+14 (mod 26)
7+15 14+5
27 14
[ ]
= 43 16
22 19
(mod 26)
1 14
[ ]
= 17 16
22 19
A N Q P V S
1 14 17 16 22 19
5
4.1.2 Decryption Method: Hill Cipher
To decrypt the matrix back into plaintext, multiply it by the inverse of the cipher
matrix:
6
4.2 Encryption & Decryption using Caesar Cipher
Problem: Encode the message “CHANGE” by using Caesar cipher algorithm with
K L M N O P Q R S T
1 2 3 4 5 6 7 8 9 10
U V W X Y Z A B C D
11 12 13 14 15 16 17 18 19 20
E F G H I J
21 22 23 24 25 26
C H A N G E
19 24 17 4 23 21
7
Step 2: Multiply the encrypted matrix with given matrix A.
Encryption algorithm here is given as C= AP (mod N) , N = 26
19 24 19+72 38+ 24
[ ][
17 4
23 21
1 2
3 1
=] [ ]
17+12 34+ 4 (mod 26)
23+63 46+21
91 62
[ ]
= 3 12
8 15
8
4.2.2 Decryption Method: Caesar Cipher
To decrypt the matrix back into plaintext, multiply the encrypted matrix by the
inverse of the encoding matrix as the steps below:
Step 2 : Change the encrypted cipher text back to its numerical value.
W T M V R Y
13 10 3 12 8 15
9
Step 4: Change the value to plaintext do decrypt the message.
C H A N G E
19 24 17 4 23 21
10
5.0 DISCUSSION
Firstly, we need to identify how to translate the plain text to cypher text and vice
versa. After thorough research being done, we have identified two ways to convert plain text
into cypher text which is by using the Hill cypher algorithm and Caesar cypher algorithm.
Both algorithms use a formula to encrypt the plain text into cypher text and encrypt process
uses the inverse matrix of the formula to decrypt the cypher text into plain text. The cypher
text can only be decrypted with a key matrix. Moreover, for Caesar cypher, the number of
positions the alphabets shifted needs to be stated as by then, only it can be decrypted. With
the help of the Hill cypher and Caesar cypher algorithm, the process of cryptography is
successfully done and with this method, the received message can be encoded to make
sure that the message stays hidden if they don't have the key matrix and cannot be identified
by other people.
For example, if the military wants to relay the message to their squadron, the army’s
captain can use the Caesar cypher algorithm to encode the message. This can ensure that
the message cannot be read by the enemy even if they intercepted it and they need to
decrypt the message if they want to read it. Although cypher algorithm has a drawback,
which is, it encrypts identical plain text blocks to identical cypher text blocks that reveal
patterns in the plain text, there is other research paper out there that have found the solution
to these disadvantages such as by adjusting the encryption key from one block to another.
11