Comp 3704
Introduction to Cryptography
Homework 2
Due Tuesday, January 21, 2003
  1. Find 17-1 mod 449, if it exists. What about 1457-1mod 4559? Show your work using the extended Euclidean algorithm.
  2. How many elements are there in Z*23? How about in Z*123? What about in Z*1123?
  3. Cryptanalyze the affine cipher encoded by one of your classmates. Hand in the original encrypted message, the decrypted message, and the original key used for the encryption.
    1. What if you are cryptanalyzing an affine cipher and you decide that the plaintext character 'g' maps to the ciphertext letter 'T' and that the plaintext character 'm' maps to the ciphertext character 'J'. What can you say about the encryption keys?
    2. What about if you change your mind and decide instead that 'g' maps to 'T', and 'h' maps to 'I'. Now what can you say?
    3. Now you decide that to try 'a' maps to 'C' and 'c' maps to 'E'. Is that a possibility?
  4. Write a program to calculate the gcd of two numbers, and to calculate the inverse of a number mod m, provided it exists. E-mail the source code to ftl@cs.du.edu
  5. Choose a passage of text, and encrypt it with a (nontrivial) Vigenere cipher. Give me the plaintext, the value of the key, and the ciphertext. Also, send me email with the ciphertext. These will become next week's assignment - someone else will do a cryptanalysis of your ciphertext. Please make the text sufficiently long so that the frequency analyses we learn will be effective for decryption. That is, give us 300 characters or so.
  6. Extra credit: Prove that an element a in Zn has an inverse if and only if gcd(a, n) = 1.