MA 479 / CSSE 479: Cryptography
Homework 2 problems inspired by Computer Science

Rose-Hulman Institute of Technology
A joint effort of the
Department of Mathematics
and the Department of Computer Science & Software Engineering
Spring term, 2003-2004

For the programming problems: I am always open to other suggestions for programming projects. Come talk to me if you have one in mind that you don't see here.

The non-programming problems you may turn in to the drop boxes or on paper.

Drop box submissions are due at midnight on the due date. Paper submissions are due in class or in the box outside my office by 5:00 p.m.

  1. [2 points.] Create software that can encrypt and decrypt using a one-time pad.

  2. [2 points.] Create software that can perform a known-plaintext attack on a one-time pad.

  3. [12 points.] (You may need to do some research for this problem.) Create software that can perform an attack on a one-time pad using two ciphertexts encoded with the same key sequence, without human intervention. (Somebody re-used the one-time pad!) You will need to calculate the frequencies of the differences between each possible pair of letters. Your software should produce possible plaintexts in rough order of likelihood. It would be good if your user interface allowed the user to specify "give me the top 10 possible plaintexts".

  4. [2 points.] Read pages 40 and 41 in your textbook. Create software that can encrypt and decrypt using a "Vigenère" cipher. (This is essentially the same as a one-time pad except that the key sequence is repeated at regular intervals.)

  5. [6 points.] Read pages 40 and 41 in your textbook. Write a program that can perform a letter frequency attack on a "Vigenère" cipher without human intervention, given the length m of the keyword. Your software should produce possible plaintexts in rough order of likelihood. It would be good if your user interface allowed the user to specify "give me the top 10 possible plaintexts".

  6. [6 points, after doing the previous problem.] Same as previous, but without knowing m. (You may need to do some research for this problem. The terms "Kasiski test" and/or "index of coincidence" may help.)

  7. [6 points.] Create software that can encrypt and decrypt using a general substitution block cipher.

  8. [16 points.] Create software that can encrypt and decrypt using S-DES. (I will give partial credit for software that correctly calculates and displays the results of various portions of the algorithm if the whole algorithm does not work.)

    Test data: as per the assignment in class, a binary plaintext of 1110 1010 encrypted with a binary key of 01111 11101 should give a binary ciphertext of 1010 0010. Decryption should work correspondingly.

  9. [20 points.] Create software that can encrypt and decrypt using DES. (I will try to give partial credit if the whole algorithm does not work, but I can't promise it — the algorithm may be too complicated!)

    Test data: a hex plaintext of 0123456789ABCDEF with a 64-bit hex key of 133457799BBCDFF1 should give a hex ciphertext of 85E813540F0AB405. Decryption should work correspondingly.