hw3

advertisement
HW3
(due Nov. 4)
1. Suppose that h is a secure hash that generates an n-bit hash value.
a. What is the expected number of hashes that must be computed to find one collision?
b. What is the expected number of hashes that must be computed in order to find pairs (xi,zi) such that h(xi)=h(zi)
for i=0,1,2,…,9?
2. Recall the online bid method discussed in the class.
a. What properties of the secure hash function h does this scheme rely on to prevent cheating?
b. Suppose that Charlie is certain that Alice and Bob will both submit bids between $10.000 and $20,000.
Describe an attack that Charlie can use to determine Alice’s bid and Bob’s bid from their respective hash values.
How can the bidding procedure be modified to prevent this attack?
3. Suppose BoB and Alice want to flip a coin over a network. Alice proposes the following procedure:
(i) Alice selects a value X ∈ {0,1}.
(ii) Alice generates a 256-bit random symmetric key K.
(iii) Using AES, Alice computes Y = E(X, R, K), where R consists of 255 random bits.
(iV) Alice sends Y to Bob.
(V) Bob guesses a value Z ∈ {0,1} and tells Alice.
(Vi) Alice gives the key K to Bob who computes (X,R) = D(Y,K)
(Vii) If X=Z then Bob wins; otherwise Alice wins.
Explain how Alice can cheat. Using a hash function, modify this protocol so that Alice can cheat.
4. The program “bobcat.c” which is included in the HW problem implements the “Bobcat” hash algorithm. This
hash is essentially a scaled down version of Tigher; however whereas Tiger produces a 192-bit hash (three 64-bit
words), Bobcat produces a 48-bit hash (three 16-bit words). With any hash function, a smaller hash value can be
obtained by simply truncating the output.
a. Find a collision for the 12-bit version of Bobcat. How many hashes did you compute before you found your
first 12-bit collision?
b. Find a collision for the full 48-bit Bobcat hash.
5. Obtain the image file alice.bmp and aliceStego.bmp and the programs stego.c and stegoRead.c from the
compressed file ‘stego.” Use stegoRead to extract the hidden PDF file contained in aliceStego.bmp. Use the
program to insert another file into a different (uncompressed) image file and extract the information. Provide
screen snapshots of the image with and without the hidden information.
Download