Sie sind auf Seite 1von 7

# Assignment 3: Cryptography with Linear Algebra

Math 2200

## Due by the beginning of class Wednesday, November 1, 2017

Do all the exercises below using the methods in the tutorial.

## Name _____Carter Brownfield____________________________________________ Section

___01_______

Submission Guidelines:
2) Do NOT delete Maple commands that were needed to generate the required output since your
instructor must see these commands to be sure that you followed the directions in the project.
3) Do NOT leave the output only in a form the reader has to interpret.
4) Do NOT reuse a variable or a function name for different things in different problems; note that
Maple uses what was executed last with respect to time, not what appears on the page last.

## is not the same as X.

6) Complete all work in Maple and submit only a printed Maple worksheet with all the answers.
7) Don't write anything by hand.
8) Answer each question in this worksheet directly under the question so that your instructor can find
9) Check the printed page numbers to be sure that every page is present and in order.
10) Staple all pages together.
11) Consult the Beginning Maple Tutorial as often as necessary for help!

Before you execute any Maple commands below, execute the following command. You need to do this
every time you open up this worksheet.

>
>

## Exercise 1. Refer to section 2 of the Tutorial. [25 points]

First, we set up a substitution cipher between the English alphabet and positive integers, say
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26.
We also associate 27 with "." (period) ; 28 with "," (comma) ; and 29 with " " (blank) .

## Consider the encoding matrix E =

(1.1)
(1.1)

a) [5 points] Define the matrix E in Maple. Note: if you do this incorrectly the rest of your answers
to this problem will be wrong. Verify and explain why E is a legitimate encoding matrix.

>

(1.2)

>
Because the determinant is not zero, E is a valid encoding matrix.
(1.3)
>

(1.4)

## b) [4 pts] The plaintext to be encoded is: LINEAR ALGEBRA ROCKS.yourlastname

Use your own name (last name only) after the period. Pad the end of the message with blanks if you
need to in order to use E as the encoding matrix.

Define the matrix M associated with the given original message (plaintext), as described in the
Tutorial; give it the name M.

>
25 (1.5)
>

>

(1.6)
(1.6)

c) [3 pts] Compute the matrix S = EM (calculated in Maple) associated with the given encoded
message (ciphertext).

>

(1.7)

d) [2 pts] Give the numeric string, in the appropriate order, of the encoded message, separated by
commas:

>

(1.8)

>

(1.9)

## g) [6 pts] This part of the problem uses the same E as above.

Decode the following ciphertext created by using the same encoding matrix E as above:
126,55,89,280,124,285,238,127,363,123,108,165,212,97,254

>

(1.10)
(1.10)

>

(1.11)

## Exercise 2. Refer to section 3 of the Tutorial. [25 points]

For this problem you will be using a modular Hill 3-cipher as defined in section 3 of the
tutorial, NOT the cipher used in Exercise 1 above. Note: here the arithmetic will all be mod 29.
Remember that the numerical values run from 0 to 28, not 1 to 29!

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26.
We also associate 27 with "." (period) ; 28 with "," (comma) ; and 0 with " " (blank) .

A clever cryptanalyst has determined that the four most common blocks of length four in a particular
encoded message using a particular modular Hill 4-cipher are OXSX, LUYK, WECI , and ETXB and
she guesses that these ciphertext combinations correspond to the most common groups of four letters
in English text, TION, ATIO, THAT, and THER. Using that information she concludes that the
plaintext N was enciphered to the ciphertext T using a Hill 4-cipher described by T = FN (mod 29)

F=

## a) [2 pts] Define the matrix F in Maple.

>

(2.1)
>
b) [4 pts] Demonstrate that F is a legitimate encoding matrix mod 29. Explain why your answer
indicates that F is a legitimate encoding matrix.

>
Because the determinant is not zero, F is invertible. Therefore F is a valid encoding matrix.

27 (2.2)
c) [5 pts] Show that, in fact, F encodes TION, ATIO, THAT, and THER as OXSX, LUYK, WECI ,
and ETXB, respectively.

>

(2.3)

>

(2.4)

The decoded message is: OXSXLUYKWECIETXB = OXSX, LUYK, WECI, ETXB. Thus, F does
encode TION, ATIO, THAT, and THER properly.

d) [7 pts] Using F as your encoding matrix, encode the message THE ECLIPSE WAS TRULY
AMAZING (padding as necessary at the end with blanks) and then write it as a series of
letters/punctuation marks/blanks, using underscure swhere blanks occur.
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26.
We also associate 27 with "." (period) ; 28 with "," (comma) ; and 0 with " " (blank) .

>

(2.5)
(2.5)

>

(2.6)

>

## e) [7 pts] Using as your decoding matrix, decode the ciphertext

IIWPJDZKEK.BHGSLQLORMTGUN,ZMB,QC (notice the period and the two commas)
and then write it as a series of English words/punctuation marks/blanks (it should make good
sense in English!).

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26.
We also associate 27 with "." (period) ; 28 with "," (comma) ; and 0 with " " (blank) .

>

(2.7)

>

(2.8)

>
>
>