An application to Cryptography
Cryptography is that application which would have driven G. H. Hardy crazy: he was in love with Number Theory because of its purity, because it didn't have application. Well, roll over in your grave Godfrey Hardy!
Caesar Cypher (circa 50 B.C.) - Julius Caesar used this cipher to encode messages to Marcos Cicero: e.g.
(any shift - other than multiples of 26! - will do). It's easy to decode:
This system is monoalphabetic: each letter is always represented using the cipher letter, so it's vulnerable to frequency analysis attacks.
http://www.shodor.org/interactivate/activities/caesar/ provides a good Caesar Cipher applet for you to try....
Example: #1, 2, p. 155 A generalization of the Caesar cipher would be to choose a linear transformation with a slope other than one: in other words,
with .
Example: #3, p. 155, shows how to decode one. It's part of your homework!
Example: #4, p. 155
Vigenère Cypher (1586): a one-time key sequence is used, repeated below the message, and the addition is performed character by character on the two strings.
It's easy to decode, in blocks of length n, where n is the length of the key:
This system is polyalphabetic: a letter is generally represented by multiple ciphertext letters, so it's less vulnerable to frequency analysis attacks. However, once the length n of the key is discovered, it becomes n copies of a monoalphabetic cipher, and is vulnerable again.
http://math.ucsd.edu/ crypto/java/EARLYCIPHERS/Vigenere.html is a good website for trying it out.
Of course, the choice of 26 is simply a convenience since we're dealing with the English language. There's nothing particularly special about 26.
Hill's cipher (1929): encrypts blocks of letters, rather than letter by letter. Basically, a block is transformed using linear algebra and linear congruences. Recall from section 4.4:
Theorem 4.9: The system of linear congruences
has a unique solution whenever . The quantity ad-bc is the determinant of the matrix. We can work with larger systems, replacing the quantity ad-bc with the determinant of the matrix.
The code is deciphered by inverting the matrix (just as in linear algebra). In the case where ad-bc=1, we have
If ad-bc=-1, we simply change all the signs. More generally, if we have the original matrix
then the inverse is obtained by solving the system
As in the case of RSA, you can use the result of exercise #8(a), p. 139: if , then the linear congruence has the solution . In matrix terms, we've got
http://www.louisville.edu/ ahdeso01/applets/Hill.html is a good website for trying it out.
More to come....