Wednesday, May 4, 2011

Application of Matrices to Cryptography.

Today governments use sophisticated methods of coding and decoding messages. One type of code, which is extremely difficult to break, makes use of a large matrix to encode a message. The receiver of the message decodes it using the inverse of the matrix. This first matrix is called the encoding matrix and its inverse is called the decoding matrix.

Example Let the message be

PREPARE TO NEGOTIATE

and the encoding matrix be

We assign a number for each letter of the alphabet. For simplicity, let us associate each letter with its position in the alphabet: A is 1, B is 2, and so on. Also, we assign the number 27 (remember we have only 26 letters in the alphabet) to a space between two words. Thus the message becomes:

Since we are using a 3 by 3 matrix, we break the enumerated message above into a sequence of 3 by 1 vectors:

Note that it was necessary to add a space at the end of the message to complete the last vector. We now encode the message by multiplying each of the above vectors by the encoding matrix. This can be done by writing the above vectors as columns of a matrix and perform the matrix multiplication of that matrix with the encoding matrix as follows:

which gives the matrix

The columns of this matrix give the encoded message. The message is transmitted in the following linear form

To decode the message, the receiver writes this string as a sequence of 3 by 1 column matrices and repeats the technique using the inverse of the encoding matrix. The inverse of this encoding matrix, the decoding matrix, is:

(make sure that you compute it yourself). Thus, to decode the message, perform the matrix multiplication

and get the matrix

The columns of this matrix, written in linear form, give the original message:




http://aix1.uottawa.ca/~jkhoury/cryptography.htm

6 comments:

  1. Thanks for the post. i think it is fairly interesting to find out about such things. I think that this system of encryption is being used these days in video games and other entertainment related subjects. So, good work and thanks again.

    ReplyDelete
  2. I think it is not secure enough since the matrix is just 3x3 it is easily to be broken, so it is better to increase its size. And it is better by not using A=1,B=2 ... I don't know what other substitution they should use :P. All in all, matrices are very useful
    for encoding messages. Nice Post.

    ReplyDelete
  3. Great post. Should the first 3x3 matrix you started be invertible right ?! Anyway it is the most interesting application of matrices. Good Work.

    ReplyDelete
  4. Nice Comment Joe. I agree, very nice and interesting post! Thanks Johnny!

    ReplyDelete
  5. The encryption system grabbed my attention, for I didn't know before that it has to deal with this course...It is really interesting...

    Edward Faraj

    ReplyDelete
  6. This is a very interesting article nice work

    ReplyDelete