### COMP 165 - Fall 2016 - Homework 5

Due Wednesday, 26 October, 2016 in class

Report problems to ablumer via email

1. (This is a version of Problem 8.6) Find an RC4 key that leaves the state array unchanged after initialization, so S[i] still equals i for i = 0 to 255. Do you think this is a problem? Calculate the first five k values produced for this key.
2. (This is a version of Problem 8.8) Alice and Bob agree privately on a 128-bit key k, to be used with RC4. They would prefer to reuse this key, so they adopt the following scheme to send each message:
1. Generate a new random 80-bit value, v.
2. Use this value concatenated with k as the RC4 key for this message.
3. Send v concatenated with the RC4-encrypted message.
Describe how the receiver (Alice or Bob) decrypts the message.
3. Alice and Bob occasionally change k, but perhaps not often enough. How can Eve determine whether the same k is still being used when Alice and Bob use the above scheme?
4. How many messages can be sent before the string (v, k) is expected to repeat?
5. (This is a version of Problem 11.5) A hash function can be based on a symmetric encryption algorithm as follows:

Encrypt the first block, then for each subsequent block XOR it with the previous encryption before encrypting it.

Thus H(B1, B2) = E( B2 XOR E(B1) ). The encryption key must be public so that anyone can verify the hash.
Show how to find a C2 for any given C1 so that (C1, C2) has the same hash value as (B1, B2). How much of a problem is this?