Sunteți pe pagina 1din 7

Written

Assignment 1 &
Project Assignment 1
CS 458/558: Introduction to Computer Security

Instructor:
Guanhua Yan
Assignments
• Written assignment
– Three problems
– Due on September 19 (next lecture time)
• Programming assignment
– Implement a stream cipher
– Please don’t copy code from Internet or any other
student
– Due on September 26
– With a daily 10% penalty
– Grace period: two days (i.e., latest by Sept. 28)
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.”
Problem 2
Consider a Feistel cipher with four rounds. Then the
plaintext is denoted as P = (L0, R0) and the
corresponding ciphertext is C = (L4, R4). What is the
ciphertext C, in terms of L0, R0, and the subkey, for each
of the following round functions? (You should get the
most concise solution.)
• A. F(Ri-1, Ki) = 0
• B. F(Ri-1, Ki) = Ri-1
• C. F(Ri-1, Ki) = Ki
• D. F(Ri-1, Ki) = Ri-1 Å Ki

(Note that for each of cases A – D, the cipher uses four rounds.)
Problem 3
Suppose that we use a block cipher to encrypt according to the
rule :
C0=IVÅE(P0, K),
C1=C0ÅE(P1, K),
C2=C1ÅE(P2, K),
...

• a. What is the corresponding decryption rule?


• b. Give two security disadvantages of this mode as
compared to CBC mode.
Programming Assignment
The assignment has been posted on myCourses. Since
this is a new project, some instructions may be changed
later based on the feedback of the students. So please
stay tuned!
Submission guidelines

Please hand in your source code and a Makefile electronically. You must make
sure that your code compiles and runs correctly.
Write a README file (text file, do not submit a .doc file) which contains
§ Your name and email address
§ Your program runs as follows: “./run ./key.txt ./iv.txt n ./keystream.txt”, where
key.txt is the key file, iv.txt is the initialization vector file, n is the number of 32-
bit words produced in the keystream, and keystream.txt is the output
keystream. Each file includes words separated by a single space character. For
example, ”01234567 89ABCDEF” has two 32-bit words separated by space.
§ 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., p1-ghyan).
Tar the contents of this directory using the following command: 
tar –cvf
[directory_name].tar [directory_name] 
E.g., tar -cvf p1-ghyan.tar p1-ghyan/
Use myCourses to upload the tared file you created above.

S-ar putea să vă placă și