Number Theory Section Summary: 7.5

An application to Cryptography

  1. Summary

    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!

  2. Definitions

    Caesar Cypher (circa 50 B.C.) - Julius Caesar used this cipher to encode messages to Marcos Cicero: e.g.

    displaymath326

    (any shift - other than multiples of 26! - will do). It's easy to decode:

    displaymath327

    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,

    displaymath328

    with tex2html_wrap_inline346 .

    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.

    displaymath329

    It's easy to decode, in blocks of length n, where n is the length of the key:

    displaymath330

    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/ tex2html_wrap_inline356 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

    displaymath331

    has a unique solution whenever tex2html_wrap_inline358 . The quantity ad-bc is the determinant of the matrix. We can work with larger tex2html_wrap_inline362 systems, replacing the quantity ad-bc with the determinant of the tex2html_wrap_inline362 matrix.

    The code is deciphered by inverting the matrix (just as in linear algebra). In the case where ad-bc=1, we have

    displaymath332

    If ad-bc=-1, we simply change all the signs. More generally, if we have the original matrix

    displaymath333

    then the inverse tex2html_wrap_inline372 is obtained by solving the system

    displaymath334

    As in the case of RSA, you can use the result of exercise #8(a), p. 139: if tex2html_wrap_inline374 , then the linear congruence tex2html_wrap_inline376 has the solution tex2html_wrap_inline378 . In matrix terms, we've got

    displaymath335

    http://www.louisville.edu/ tex2html_wrap_inline356 ahdeso01/applets/Hill.html is a good website for trying it out.

    More to come....




Tue Apr 11 01:51:23 EDT 2006