AES (Advanced Encryption Standard) is quite a bit more powerful than the methods described in my previous blog post. It is widely used among private companies and governments to encrypt text, passwords, and file contents. There are several other encryption standards, which I won't delve into. This website provides a free tool to code and decode messages using AES, and so do many others.
On a personal note, those close to me will know that the past two years have brought some of the biggest challenges in my life (don't mean to be dramatic, I swear!), and also some fun memorable moments To all who have been there in some way or another - I would like to thank you in the form of an encrypted message. All you have to do is use the links with your initials to find my individualized salute to you. Oh, and you all have to ask for your individualized link & passwords
JH
FP
PN
TS
JV
LH
NT
JG
ISO
VT
Sunday, August 10, 2014
Cryptography, part one
In an alternate universe, after the British used careful analysis of social networks (great short article, do read) to narrow in on Paul Revere, the colonial hero did not have much time to deliver his famous message. Knowing he may be caught at any moment, he decided to encrypt his message. That is, to turn words into code
His first attempt was rather weak - turning all letters to corresponding numbers.
Figure 1
His message now looked like this
Figure 2
Figure 3
The following matrix results:
Paul Revere can now write these numbers down on paper, and the code won't be as obvious. For one thing, we are not using 1-27 anymore, and there is no one-to-one correspondence for letters. However, to solve the code, Revere's compatriots will have the key, or the original 3x3 encoding matrix, and multiply its inverse by Revere's transformed new matrix. I won't bother showing these steps - the result, as we've said before, will alert them just in time:
Paul Revere - silversmith, patriot, and amateur code boy |
His first attempt was rather weak - turning all letters to corresponding numbers.
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 | 27 |
T | H | E | * | B | R | I | T | I | S | H | * | A | R | E | * | C | O | M | I | N | G |
20 | 8 | 5 | 27 | 2 | 18 | 9 | 20 | 9 | 19 | 8 | 27 | 1 | 18 | 5 | 27 | 3 | 15 | 13 | 9 | 14 | 7 |
This "code" could easily be intercepted by anyone who read the numbers. So he tried again, with a slightly more complex replacement - he split the alphabet into 3, and gave each letter a number and a symbol, going backwards:
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 | * |
9* | 8* | 7* | 6* | 5* | 4* | 3* | 2* | 1* | 9^ | 8^ | 7^ | 6^ | 5^ | 4^ | 3^ | 2^ | 1^ | 9$ | 8$ | 7$ | 6$ | 5$ | 4$ | 3$ | 2$ | 1$ |
The message could now be written and passed on more discreetly, but it was still not secure. If the police caught Revere and intercepted his letter, it would be only a short matter of time until they figure out the one-to-one correspondence between letter and code. How could Revere ensure a more random coding and translation? Since he did not have access to modern computing, the answer was matrices.
Matrices can be used as a mathematical basis for cryptology. Using a numerical message, such as in Figure 2, we can use matrix multiplication to "jumble up" numbers to a substantial degree of randomness, making coded messages more difficult to decipher. Besides the message itself, the process requires an encoding matrix, which must be square in shape and invertible (if you are rusty on matrix algebra, don't worry about this part). The larger the square encoding matrix, the more secure the encryption. We will use the following 3x3 matrix below, with message matrix split into columns of 3 for multiplication purposes.
7 2 1 |
0 3 -1 |
-3 4 -2 |
With encoding matrix above, multiply by message matrix below. The message matrix is the original numerical message, [20,8,5,27,2,18...] transposed into columns of 3
20 27 9 19 1 27 13 7 |
8 2 20 8 18 3 19 27 |
5 18 9 27 5 15 14 27 |
The following matrix results:
161 211 112 176 48 210 143 130
|
19 -12 51 -3 49 -6 43 54
|
-38 -109 35 -79 59 -99 9 33
|
Paul Revere can now write these numbers down on paper, and the code won't be as obvious. For one thing, we are not using 1-27 anymore, and there is no one-to-one correspondence for letters. However, to solve the code, Revere's compatriots will have the key, or the original 3x3 encoding matrix, and multiply its inverse by Revere's transformed new matrix. I won't bother showing these steps - the result, as we've said before, will alert them just in time:
T | H | E | * | B | R | I | T | I | S | H | * | A | R | E | * | C | O | M | I | N | G |
20 | 8 | 5 | 27 | 2 | 18 | 9 | 20 | 9 | 19 | 8 | 27 | 1 | 18 | 5 | 27 | 3 | 15 | 13 | 9 | 14 | 7 |
Subscribe to:
Posts (Atom)
Happy New Year and Don't Blow Yourself Up: Exploring National Injury Data with Python
Every year, hundreds of thousands of Americans go to the Emergency Room for various injuries resulting from common consumer products. Do you...
-
In late August of 2014, a large set of celebrity information was hacked, with the most "newsworthy" material being nude or explici...
-
Jeopardy! is an American trivia game show that has been running for over 30 seasons now. When it comes to game shows, it is a true battle o...
-
Ho ho ho there! The holidays are upon us, and with vacation and family time comes the inevitable re-watching of Christmas favorites from our...