

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


that is sent over the internet. The main idea in cryptography is to encode a message so that the only person who can decode it is someone with a deciphering key. One simple way of encoding messages is through the use of matrices to transform the message. A message, in the form of numbers, can be created, then encoded with a matrix operation acting on these numbers. A key would consist of a decoding matrix which one can use to reproduce the original message.
In its most basic form, one would take a message consisting of letters a through z and assign each a number 1 through 26 , encode the message, then send a user the key. Clearly, this can be easily broken in many dierent ways. One can simply guess entries for the key , decode the message, and attempt to see if the resulting message makes sense for dierent combinations of a through z. For small matrices, a computer can easily crack these codes. In the real world, one does not simply use numbers 1 through 26. One may use modular arithmetic, and perhaps assign a through z to be multiple values from the product of two large prime numbers, say 1 , 747 , 822 , 896 , 920 , 092 , 227 , 343 and 105 , 646 , 155 , 480 , 762 , 397. In order to decode, one would need to know both of these large primes. It is very dicult to nd large primes in general, and using the previous guess and check type method would not work for messages of this form. We will consider a case slightly more complex than assigning 1-26 to a-z.
In order to understand some crypotography, we must rst learn some basics of modular arithmetic.
Def: If m is a positive integer and a, b are any integers, then we say a is equal to (or congruent to) b modulo m, written a ≡ b (mod m)
if a − b is an integer multiple of m. In other words, b is the integer remainder of a/m.
Consider m = 7. Then 8 ≡ 1 mod 7 since 8 = 1 · 7 + 1 (or
, having 1 as a remainder). Similarly
1111 = 5 mod 7 since 1111 = 158 · 7 + 5 (or
). Modular arithmetic is generally applied AFTER
an operation, but all operations in standard integer arithmetic hold prior to modding. We compute +, −, ·, ÷ as usual:
character (letter and punctuation mark). For simplicity's sake, let's let A = 0, B = 1, ...Z = 25. We also need numbers for the space character and the period, so we can choose 27 for space, and 28 for period. Now we can convert each character to a number.
l i n e a r a l g e b r a i s f u n. 11 8 13 4 0 17 26 0 11 6 4 1 17 0 26 8 18 26 5 20 13 27
If we stopped here, the code could be very easily broken, so we need to scramble it. We can use a matrix to do so. Consider the following 3 × 3 encoding matrix:
In order to multiply our message by this matrix, we need to put our message into a matrix with 3 rows. More specically, we need to put our message into a 3 × N matrix, so that the multiplication is dened. We can do this putting the message into 3 × 1 column vectors:
Note that since the number of letters in the message is not divisible by 3 , we ll in the last column vector with space characters. These column vectors then become the columns of a 3 × 8 matrix:
Multiplying the encoding matrix by the message matrix gives:
The encoded message is the list of the numbers in order of the column vectors (ie − 109 , 21 , 120 , − 80 , 17 , 84 , − 122 ,... ). When converting this message to text, we use the modulous base 28 , so we compute:
BA mod 28 =
Turning this back into a vector, using the opposite methods as previously, we have
d v i e r a s l i w f m n e o q w n f u r y k 3 21 8 4 17 0 18 11 8 22 5 12 13 26 4 14 16 22 13 5 20 17 24 10
We would pass the message dvierasliwfmn eoqwnfuryk, the encoding matrix B , and the base of the modulous ( 28 ) to a user.
To decode this message, we multiply BA mod 28 by the decoding matrix (the inverse of the encoding matrix). We have a decoding matrix of
B−^1 =
and
Calculating the modulous of the resulting matrix,
(^) mod 28 =