0% found this document useful (0 votes)
214 views

Cryptography Final Project

This document discusses encrypting and decrypting a message using matrix cryptography. It provides the encoded message, finds the inverse of the encryption key matrix, and decodes the encoded message back to the original using the inverse key. The encoding involves converting the message to numbers, multiplying the numeric message by the key matrix. Decoding uses the inverse key matrix multiplied with the encoded message numbers. The key is proven to be the inverse by multiplying the key with its inverse resulting in the identity matrix.

Uploaded by

api-514261788
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)
214 views

Cryptography Final Project

This document discusses encrypting and decrypting a message using matrix cryptography. It provides the encoded message, finds the inverse of the encryption key matrix, and decodes the encoded message back to the original using the inverse key. The encoding involves converting the message to numbers, multiplying the numeric message by the key matrix. Decoding uses the inverse key matrix multiplied with the encoded message numbers. The key is proven to be the inverse by multiplying the key with its inverse resulting in the identity matrix.

Uploaded by

api-514261788
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/ 10

Cryptography Final Project

by Pim Somchue 1106

MESSAGE: R_JOKES._OUR_CRAZY_FIGHTS._ALL_OF_THESE_

_=0 F=6 L = 12 R = 18 X = 24 = 30

A=1 G=7 M = 13 S = 19 Y = 25 ) = 31

B=2 H=8 N = 14 T = 20 Z = 26 1 = 32

C=3 I=9 O = 15 U = 21 . = 27 9 = 33

D=4 J = 10 P = 16 V = 22 ; = 28 2 = 34

E=5 K = 11 Q = 17 W = 23 : = 29 , = 35

‘ = 36

Convert letters to number :


R _ J O K E S . _ O U R _ C R

18 0 10 15 11 5 19 27 0 15 21 18 0 3 18

A Z Y _ F I G H T S . _ A L L

0 26 25 0 6 9 7 8 20 19 27 0 1 12 12

_ O F _ T H E S E _

0 15 6 0 20 8 5 19 5 0

Key Determinant of the key

Det =1

5×5

Solve for the determinant of the key


1. reduce the matrix to row-echelon form
R₁ − R₃

R₂ − R₄

R₄

R₂

R₅ − 2R₁

2. the product of the diagonal of the matrix is the determinant.


Therefore, multiplying the diagonal of the matrix to get the determinant

∴​ Determinant = 1×1×1×1×1 = 1
Convert message to numeric
Code part 1

Code part 2

Code part 3

Encoding the message

Using: Numeric Message × Key

Encoding part 1

​× =

​2×5 ​ ​5×5 2×5

C₁₁ = (18)(1) + (0)(0) + (10)(1) + (15)(0) + (11)(2) = 50


C₁₂ = (18)(5) + (0)(1) + (10)(5) + (15)(1) + (11)(10) = 265
C₁₃ = (18)(8) + (0)(2) + (10)(7) + (15)(2) + (11)(16) = 420
C₁₄ = (18)(3) + (0)(3) + (10)(-1) + (15)(2) + (11)(6) = 140
C₁₅ = (18)(2) + (0)(10) + (10)(-1) + (15)(4) + (11)(5) = 141
C₂₁ = (5)(1) + (19)(0) + (27)(1) + (0)(0) + (15)(2) = 62
C₂₂ = (5)(5) + (19)(1) + (27)(5) + (0)(1) + (15)(10) = 329
C₂₃ = (5)(8) + (19)(2) + (27)(7) + (0)(2) + (15)(6) = 507
C₂₄ = (5)(3) + (19)(3) + (27)(-1) + (0)(2) + (15)(6) = 135
C₂₅ = (5)(2) + (19)(10) + (27)(-1) + (0)(4) + (15)(5) = 248
Encoding part 2

​ × =

2×5 5×5​ ​ ​ 2×5

C₁₁ = (21)(1) + (18)(0) + (0)(1) + (3)(0) + (18)(2) = 57


C₁₂ = (21)(5) + (18)(1) + (0)(5) + (3)(1) + (18)(10) = 306
C₁₃ = (21)(8) + (18)(2) + (0)(7) + (3)(2) + (18)(16) = 498
C₁₄ = (21)(3) + (18)(3) + (0)(-1) + (3)(2) + (18)(6) = 231
C₁₅ = (21)(2) + (18)(10) + (0)(-1) + (3)(4) + (18)(5) = 324
C₂₁ = (1)(1) + (26)(0) + (25)(1) + (0)(0) + (6)(2) = 38
C₂₂ = (1)(5) + (26)(1) + (25)(5) + (0)(1) + (6)(10) = 216
C₂₃ = (1)(8) + (26)(2) + (25)(7) + (0)(2) + (6)(16) = 331
C₂₄ = (1)(3) + (26)(3) + (25)(-1) + (0)(2) + (6)(6) = 92
C₂₅ = (1)(2) + (26)(10) + (25)(-1) + (0)(4) + (6)(5) = 267

Encoding part 3

× =

4×5 ​5×5​ ​4×5


C₁₁ = (9)(1) + (7)(0) + (8)(1) + (20)(0) + (19)(2) = 55
C₁₂ = (9)(5) + (7)(1) + (8)(5) + (20)(1) + (19)(10) = 302
C₁₃ = (9)(8) + (7)(2) + (8)(7) + (20)(2) + (19)(16) = 486
C₁₄ = (9)(3) + (7)(3) + (8)(-1) + (20)(2) + (19)(6) = 194
C₁₅ = (9)(2) + (7)(10) + (8)(-1) + (20)(4) + (19)(5) = 255
C₂₁ = (27)(1) + (0)(0) + (1)(1) + (12)(0) + (12)(2) = 52
C₂₂ = (27)(5) + (0)(1) + (1)(5) + (12)(1) + (12)(10) = 272
C₂₃ = (27)(8) + (0)(2) + (1)(7) + (12)(2) + (12)(16) = 439
C₂₄ = (27)(3) + (0)(3) + (1)(-1) + (12)(2) + (12)(6) = 176
C₂₅ = (27)(2) + (0)(10) + (1)(-1) + (12)(4) + (12)(5) = 161
C₃₁ = (0)(1) + (15)(0) + (6)(1) + (0)(0) + (20)(2) = 46
C₃₂ = (0)(5) + (15)(1) + (6)(5) + (0)(1) + (20)(10) = 245
C₃₃ = (0)(8) + (15)(2) + (6)(7) + (0)(2) + (20)(16) = 392
C₃₄ = (0)(3) + (15)(3) + (6)(-1) + (0)(2) + (20)(6) = 159
C₃₅ = (0)(2) + (15)(10) + (6)(-1) + (0)(4) + (20)(5) = 244
C₄₁ = (8)(1) + (5)(0) + (19)(1) + (5)(0) + (0)(2) = 27
C₄₂ = (8)(5) + (5)(1) + (19)(5) + (5)(1) + (0)(10) = 145
C₄₃ = (8)(8) + (5)(2) + (19)(7) + (5)(2) + (0)(16) = 217
C₄₄ = (8)(3) + (5)(3) + (19)(-1) + (5)(2) + (0)(6) = 30
C₄₅ = (8)(2) + (5)(10) + (19)(-1) + (5)(4) + (0)(5) = 67

Encoded Message

The encoded message give us the following :


50, 165, 420, 140, 141, 62, 329, 357, 135, 248, 57, 306, 498, 231, 324, 38, 216, 331, 92, 267,
55, 302, 486, 194, 255, 52, 272, 439, 176, 161, 46, 245, 392, 159, 244, 27, 145, 217, 30, 67

Find the inverse of the key


To find the inverse matrix we will use the identity matrix by putting the identity matrix to the
right and put the key matrix on the left. Then, try to change the matrix on the lftside to
identity matrix. After that, the inverse matrix will be the matrix on the right side.

1. Put in the identity matrix to create an augmented matrix.

2. Use Gauss-Jordan elimination to solve the system.

​ R₅ - 2R₁
​ R₁ - R₃

​R₂ - R₄

​ R₁-5R₂

​R₁+2R₃

​R₁+4R₄

​R₁+18R₅

​R₂-2R₃
​R₂+5R₄

​R₂-34R₅

​R₃-4R₄

​R₃+21R₅

​R₄-6R₅

∴ ​The inverse of the key is


=
Prove that the inverse is correct by multiply with key matrix from the identity AA⁻¹ = I

5×5 5×5

× = = ​I

5×5 5×5 5×5


C₁₁ = (1)(-33) + (5)(66) + (8)(-41) + (3)(12) + (2)(-2) = 1
C₁₂ = (1)(-1) + (5)(6) + (8)(-4) + (3)(1) + (2)(0) = 0
C₁₃ = (1)(-2) + (5)(2) + (8)(-1) + (3)(0) + (2)(0) = 0
C₁₄ = (1)(-4) + (5)(-5) + (8)(4) + (3)(-1) + (2)(0) = 0
C₁₅ = (1)(18) + (5)(-34) + (8)(21) + (3)(6) + (2)(1) = 0
C₂₁ = (0)(-33) + (1)(66) + (2)(-41) + (3)(12) + (10)(-2) = 0
C₂₂ = (0)(-1) + (1)(6) + (2)(-4) + (3)(1) + (10)(0) = 1
C₂₃ = (0)(-2) + (1)(2) + (2)(-1) + (3)(0) + (10)(0) = 0
C₂₄ = (0)(-4) + (1)(-5) + (2)(-4) + (3)(-1) + (10)(0) = 0
C₂₅ = (0)(-18) + (1)(-34) + (2)(21) + (3)(6) + (10)(1) = 0
C₃₁ = (1)(-33) + (5)(66) + (7)(-41) + (-1)(12) + (-1)(-2) = 0
C₃₂ = (1)(-1) + (5)(6) + (7)(-4) + (-1)(1) + (-1)(0) = 0
C₃₃ = (1)(-2) + (5)(2) + (7)(-1) + (-1)(0) + (-1)(0) = 1
C₃₄ = (1)(-4) + (5)(5) + (7)(4) + (-1)(-1) + (-1)(0) = 0
C₃₅ = (1)(18) + (5)(-34) + (7)(21) + (-1)(6) + (-1)(1) = 0
C₄₁ = (0)(-33) + (1)(66) + (2)(-41) + (2)(12) + (4)(-2) = 0
C₄₂ = (0)(-1) + (1)(6) + (2)(-4) + (2)(1) + (4)(0) = 0
C₄₃ = (0)(-2) + (1)(2) + (2)(-1) + (2)(0) + (4)(0) = 0
C₄₄ = (0)(-4) + (1)(-5) + (2)(4) + (2)(-1) + (4)(0) = 1
C₄₅ = (0)(18) + (1)(-34) + (2)(21) + (2)(6) + (4)(1) = 0
C₅₁ = (2)(-33) + (10)(66) + (16)(-41) + (6)(12) + (5)(-2) = 0
C₅₂ = (2)(-1) + (10)(6) + (16)(-4) + (6)(1) + (5)(0) = 0
C₅₃ = (2)(-2) + (10)(2) + (16)(-1) + (6)(0) + (5)(0) = 0
C₅₄ = (2)(-4) + (10)(-5) + (16)(4) + (6)(-1) + (5)(0) = 0
C₅₅ = (2)(18) + (10)(-34) + (16)(21) + (6)(6) + (5)(1) = 1

∴ ​The original matrix key multiply by the inverse matrix of itself gives us the identity matrix,
so they are invisible to each others.
Decoding the encoded message

Using: encoded message × key⁻¹

Decoding part 1

× =

2×5 5×5 2×5


Answer code part 1:
Answer number: 18 0 10 15 11 5 19 27 0 15
Answer letters: R _ J O K E S . _ O

Decoding part 2

× =

2×5 5×5 2×5


Answer code part 2:
Answer number: 21 18 0 3 18 1 26 25 0 6
Answer letters: U R _ C R A Z Y _ F

Decoding part 3

× =

​ 4×5 ​ ​ 5×5 4×5


Answer code part 3:
Answer number: 9 7 8 20 19 27 0 1 12 12 0 15 6 0 20 8 5 19 5 0
Answer letters: I G H T S . _ A L L _ O F _ T H E S E _

The final answer in the letters gives us the following:

Final Numbers : 18, 0, 10, 15, 11, 5, 19, 27, 0, 15, 21, 18, 0, 3, 18, 1, 26, 25, 0, 6, 9, 7, 8,
20, 19, 27, 0, 1, 12, 12, 0, 15, 6, 0, 20, 8, 5, 19, 5, 0

Final Message​ : R JOKES. OUR CRAZY FIGHTS. ALL OF THESE


Reflection

In this​ ​cryptogram project, we are writing a piece of letter as a whole class, and the
message in our letter is to be delivered to our homeroom teacher. The letter is not a normal
letter as we had learned about matrix and cryptography, so we converted our letter into coded
number and use a matrix knowledge to solve for the message in the letter.
At the beginning, we do the work as a class work to write a letter. After we finished
the letter, we divided the message equally and appoint each sentences to the classmates. We
also set a number to represent our letter and symbol. For my part, the message is 40 letters
long. I started my work by creating a key matrix with determinant of one. Then I convert my
letter to numeric from and arrange them in to my matrix with 2x5 dimension and 4x5
dimension. Next, I started to encode my message by multiplying the matrix with the key that
I created before. After that I will get the encoded secret message. Furthermore, if we want to
decode that message we need to multiply it with the inverse of the key. Finding the key is the
one of the difficult because I used a Gauss-Jordan elimination to find the inverse, during this
calculation I had to go through many steps before I could get the inverse, and I need to be
patient and careful with the number and row. When I got the inverse I can multiply my
encoded message with the inverse and then I will got the final message in a numeric form.
The numeric message can be easily change into the original letters message by looking at the
converting table that our class made.
There were some difficulties during the work. One is that that making a matrix with a
determinant of 1. I did went through it by making a matrix in row-echelon form first and then
I adjusted the row back and forth until I got the row with the determinant of 1. Another
hardship is to find the inverse of the key. On a first tried, my inverse matrix won’t suit the
identity that AA⁻¹ = I so I have to calculate it again, but the Gauss-Jordan elimination takes
time to solve. I spent a lot of time go through it carefully until I can prove that it is right
according to the identity.

ESLO : ​Strategic Learner, Innovative Thinker

You might also like