Assignment 5

Due Tuesday, July 24, in class

Note: Problem 1 due Friday, July 27.

Recommended reading (from Stallings):

  1. (due Friday, 7/27) (20 points) Write a program that takes three integers a, b, and m, and outputs a^b mod m.

    Notes:

  2. (35 points) Write a program that takes a string as input, encrypts it with DES, and writes the key to a file and the ciphertext to a second file. Also write a program that reads the key and ciphertext from the files, decrypts the message, and outputs the correct version.

    Note:

    Problems 3-6 should be submitted in class, July 24, on paper.

  3. (5 points) Stallings, Problem 6.2c.
  4. (10 points) Problem 6.4.
  5. (5 points) Problem 6.6.
  6. (10 points) We said in class that repeated squaring is a polynomial time algorithm: given integers a, b, and m, we output a^b mod m in polynomial time.
    Consider repeated squaring without the mod: given integers a and b, we output a^b. Is this polynomial time? Justify your answer.

Course home page