# Matrices In Encryption And Decryption Of Codes

Carol West (cwwest@dimacs.rutgers.edu)
Nancy Fedor (nfedor@dimacs.rutgers.edu)
Chuck Tiberio (tiberio@dimacs.rutgers.edu)

Category
Cryptography, Matrices, Simultaneous Linear Equations

The Problem
The objective of the lesson is to relate Cryptography (Encryption And Decryption of Codes) to the solving of simultaneous linear equations in matrix notation. Students will study methods of encryption and decryption, such as Substitution, Caesar Cipher and Shift Cipher. Classroom techniques, such as cooperative learning, class discussions and journal entries should be pursued during the lesson. The lesson may encourage students to seek more knowledge about cryptography.

Courses
Algebra II, Discrete Math

Suggested Materials
Graphing Calculator

Prerequisites
Students need to have mastered the techniques of solving simultaneous linear equations and matrix operations, such as multiplication and finding the inverse of a 2x2 matrix. Students should also be able to write the coefficient matrix of a system and find determinants of a 2x2 matrix. These activities can be achieved with or without the graphing calculator.

Activity Description
Students will learn the techniques of Encrypting and Decrypting codes by various methods, such as Substitution, Caesar Cipher and Shift Cipher. Students will learn how to relate matrices, determinants and simultaneous linear equations to cryptography.

Guided Exploration
Lesson 1 (Day 1)
Introducing students to cryptography by explaining the procedures of encrypting and decrypting codes. The methods used will be: Substitution, Caesar Cipher and Shift Cipher.
The following is a description of each method and an example:

1. SUBSTITUTION: Each letter of the alphabet is matched with any other letter exactly once.
A B C - - - - - - - -
Random Matching
C P N - - - - - - - -
Example: Message - GO HOME
Encryption: BX LXVA

2. CAESAR CIPHER: Each letter of the alphabet is matched with a letter 3 places from the original letter.
X=A B C D E - - - - -
X+3=D E F G H - - - - -
Example:Message - GO HOME
Encryption: JR K R P H

3. SHIFT CIPHER: Each letter of the alphabet is matched with a letter "x" amount of places forward or backward from the original letter.
X=A B C D E - - - - -
X+7= H I J K L - - - - -
Example: Message - GO HOME
Encryption: NV OVTL

Have students practice several of each type in class with an emphasis on shift cipher.

Assignment: On a piece of paper folded in half; write a short message on top in plaintext. Encrypt the message using a shift cipher and place this on the bottom half of the paper. Remind students NOT to share their message with each other.

Lesson 2 (Day 2)
Begin with the previous night's assignment. Have students exchange encrypted message with each other and have them decrypt it. Explain at this time that simultaneous linear equations, matrices and determinants can be related to cryptograhpy.

Place on the board a pair of simultaneous linear equations.
Example: 4x + 5y = 155
7x + 9y = 275

Engage students in a discussion of how this can now be related to cryptography.

Questions
1. How would finding the numerical value of the variables x and y help in the encryption or decryption of a message?

2. What method would you use to solve these equations?

3. Should we use the graphing calculator? Under what format should we enter this into the calculator?