USEFUL CRYPTOGRAPHY LANGUAGE (MATRIX DEFINITIONS): MATRIX: is a collection of numbers arranged into a fixed number of rows and columns. Here is an example of a matrix with three rows and three columns: The top row is row 1. The leftmost column is column 1. This matrix is a 3x3 matrix because it has three rows and three columns. DIMENSIONS: In describing matrices, the format for the dimensions (THE ROWS ALWAYS COME FIRST!): Rows X Columns (e.g. 3X3) ELEMENTS: Each number that makes up a matrix is called an element of the matrix. The elements in a matrix have specific locations. LOCATION OF AN ELEMENT: For example, the upper left corner of the matrix is row 1 column 1. In the above matrix the element at row 1 col 1 (r1c1 is the value 1). The element at row 2 column 3 is the value 4.6. Sometimes you write A = [aij] to say that the elements of matrix A are named aij. ___ Matrix Operations 1 ____________________________________________________________________________ EASY MATRIX MATH: MATRIX ADDITION,SUBTRACTION If two matrices have the same number of rows and same number of columns, then the matrix sum can be computed: If A is an MxN matrix, and B is also an MxN matrix, then their sum or difference is an MxN matrix formed by adding or subtracting corresponding elements of A and B Here is an example of this: SCALAR MULTIPLICATION A matrix can be multiplied by a scalar (by a real number) as follows: To multiply a matrix by a scalar, multiply each element of the matrix by the scalar. Here is an example of this. (In this example, the variable a is a scalar.) Matrix Operations 2 TRIPLE BOLT LOCK (AES256 encryption) - HARDER MATRIX MATH How to Encrypt a Message Using Matrix Multiplication: 1) Start with your message: “hello” 2) Convert to a string of numbers: 8 5 12 12 15 3) Put into an array (3X3 works well) 8 12 27 [ 5 12 27] We will call the message: Matrix A -[A] 12 15 27 4) Create an encoding key 19 9 1 [ 2 1 0] The key: Matrix B - [B] 8 4 1 5) Create the Coded Message – Matrix C Matrix Multiplication [B][A] = [C] [B] * [A] = [C] 19 9 1 8 12 27 209 352 783 [ 2 1 0]* [ 5 12 27] = [ 21 36 81 ] 8 4 1 12 16 27 96 160 351 --------------------------------------------------------------------------How to decrypt a Message Using Matrix Multiplication and the power of Inverses: 1) Get the coded Message [C] 209 352 783 [ 21 36 81 ] 96 160 351 2) Multiply the coded message by the inverse of the key [B]-1 to get the original matrix [A]. a. Input on your calculator: i. [B]-1[C] and hit enter. ii. You should see the original matrix [A] 8 12 27 1. [ 5 12 27] 12 16 27 3) Convert the coded numbers back into letters Matrix Operations 3 Matrix Multiplication Another quick tip. This time how to multiply matrices. Begin with the matrix multiplication problem: Then move the first matrix down. [Note: Since matrix multiplication is not commutative, this is important. Although it should be noted that the same effect can be accomplished by moving the second matrix up. But under no circumstances should the reverse be tried.] The answer will go in the new space you have created in the bottom right corner. Immediately you can see (if the product is possible) the shape of the answer. In this example it is a 2x2 matrix. Pick a position in the answer matrix and follow across from the left and vertically from above to figure out which numbers you will use. Multiply pairs beginning with the outermost numbers (the blue 1 and 7 in the example) and sum with the product of the next pair in until you run out of pairs. The answer will go in the position where the arrows meet. Matrix Operations 4 Remember not to use numbers from your answer when computing other spaces. For example, the 58 was not used to find the 64 below. Continue with each position until the answer matrix is complete! But what if the matrices in question are not able to be multiplied? Consider the following case. Although it initially looks like our answer will be a 2x2 matrix, we see that the 3 does not have a pair, so these matrices cannot be multiplied in this order. Matrix Operations 5