Description
Problem 1
An affine cipher is a type of simple substitution where each letter is encrypted according to the following rule c = (a p + b) mod
26. Here, p, c, a, and b are each numbers in the range of 0 to 25, where p represents the plaintext letter, c the ciphertext letter, and a and b are constants. For the plaintext and ciphertext, 0 corresponds to “a,” 1 corresponds to “b,” and so on. Consider the ciphertext QJKES REOGH GXXRE OXEO, which was generated using an affine cipher. Determine the constants a and b and decipher the message. Hint: Plaintext “t” encrypts to ciphertext “H” and plaintext “o” encrypts to ciphertext “E.”
Consider a Feistel cipher with four rounds. Then the plaintext is denoted as P = (L_{0} , R_{0}) and the corresponding ciphertext is C = (L_{4}, R_{4}) . What is the ciphertext C, in terms of L_{0}, R_{0}, and the subkey, for each of the following round functions? (You should get the most concise solution.)

A. F(R_{i1}, K_{i}) = 0

B. F(R_{i1}, K_{i}) = R_{i1}

C. F(R_{i1}, K_{i}) = K_{i}

D. F(R_{i1}, K_{i}) = R_{i1} Å K_{i}
(Note that for each of cases A – D, the cipher uses four rounds.)
Suppose that we use a block cipher to encrypt according to the rule :
C_{0}=IVÅE(P_{0}, K),
C_{1}=C_{0}ÅE(P_{1}, K),
C_{2}=C_{1}ÅE(P_{2}, K),
…

a. What is the corresponding decryption rule?

b. Give two security disadvantages of this mode as compared to CBC mode.
Read the paper (particularly Section 1, 2 and Appendix)
about Ron Rivest’s RC6 (version 1.1), which can be
downloaded from:
http://people.csail.mit.edu/rivest/pubs/RRSY98.pdf.
Implement the RC6w/r/b, where w = 32, and r = 20. So you
can use the test vectors on page 20 to debug your program.
The input of your program should be the user key and either
plaintext (for encryption) or ciphertext (for decryption). The
output of your program should be the ciphertext (for
decryption) or plaintext (for encryption). Use a README
file to explain how the program should be executed. It’s OK
to discuss with your classmates about the details of the
paper, but you should finish programming by yourself.
Please hand in your source code and a Makefile electronically (please do not submit .o or executable code). You must make sure that your code compiles and runs correctly on a Linux machine.
Write a README file (text file, do not submit a .doc file) which contains

Your name and email address

Whether your code was tested on bingsuns.

Your program runs as follows: “./run ./input.txt ./output.txt”, where input.txt is the input file, and output.txt is the output file. The format of input.txt and output.txt is shown on the next slides.

Briefly describe your algorithm or anything special about your submission that the TA should take note of.
Place all your files under one directory with a unique name (such as p1[userid] for assignment 1, e.g., p1ghyan).
Tar the contents of this directory using the following command: tar –cvf [directory_name].tar [directory_name] E.g., tar cvf p1ghyan.tar p1ghyan/ Use the Blackboard to upload the tared file you created above.