Docsity

Stream Cipher for Wireless Security - Assignment 2 | 22C 169, Assignments of Computer Science

Toggle sidebar
bg1
Spring 2008 – 22c:169 Computer Security
Assignment 2 - due by Thursday, March 13.
1. Stream cipher for Wireless Security Alice took the WEP class, and learned her lesson. She decided
that the problem is that the keystream is not truly random, so she designed the following protocol. The base
station and her laptop agree on a pseudo-random number generator function PRNG, and run NTP (Network
Time Protocol) to synchronize the time in the base station (wireless router) and her laptop. (Assume that
NTP works perfectly well and there is no clock skew.) The base station and the laptop also agree on a secure
hash function H. Assume that an attacker knows the pseudo-random number generator function PRNG and
the hash function H, and which NTP version is in use. However, the attacker cannot participate in NTP
and synchronize the clock with the base station or the laptop. Assume that this attacker is not capable of a
brute-force attack, and we are not concerned with integrity.
i. Imagine that the base station and the laptop use H(current time |MAC address of the base station
|MAC address of the laptop) as a seed for PRNG, and use the sequence of random numbers from
PRNG as keystream for XOR. (|means concatenation.) Can an attacker decrypt a ciphertext without
participating in NTP? Explain your answer.
ii. Imagine that the base station and the laptop have a shared key K. If they use H( K |current time)
as a seed for PRNG, and use the sequence of random numbers from PRNG as keystream. (|means
concatenation.) Can an attacker decrypt a ciphertext without participating in NTP? Explain your
answer.
iii. Design a function that the base station and the laptop can use to compute a seed, using only the shared
key K, the secure hash function H, the pseudo-random number generator PRNG, and a complete clock
synchronization from NTP. Explain why your function computes a seed only known to the base station
and the Alice’s laptop, and the keystream generated from PRNG using this seed is secure. In other
words, explain why an attacker cannot decrypt a ciphertext computed with this keystream.
2. PGP PGP makes use of the cipher feedback (CFB) mode of CAST-128, whereas most symmetric
encryption applications (other than key encryption) use the cipher block chaining (CBC) mode. We have
CB C :Ci=E(K, [Ci−1⊕Pi]); Pi=Ci−1⊕D(K, Ci)
CF B :Ci=Pi⊕E(K,Ci−1); Pi=Ci⊕E(K , Ci−1)
These two appear to provide equal security. Suggest a reason why PGP uses the CFB mode.
3. Message Digestion SHA-1 looks way too complicated. Here is a much simpler message digest function.
Split the message into 160-bit blocks. Leave the first block unchanged, shift the 2nd block 1 bit right, shift
the 3rd block 2 bits right, and so on. The shift wraps bits around, i.e., 1011...0000 shifted 2 bits right is
001011...00. Then xor the resulting blocks together to obtain a 160-bit digest. Is this a goo d cryptographic
hash function? Explain your answer.

Partial preview of the text

Download Stream Cipher for Wireless Security - Assignment 2 | 22C 169 and more Assignments Computer Science in PDF only on Docsity!

Spring 2008 – 22c:169 Computer Security Assignment 2 - due by Thursday, March 13.

  1. Stream cipher for Wireless Security Alice took the WEP class, and learned her lesson. She decided that the problem is that the keystream is not truly random, so she designed the following protocol. The base station and her laptop agree on a pseudo-random number generator function PRNG, and run NTP (Network Time Protocol) to synchronize the time in the base station (wireless router) and her laptop. (Assume that NTP works perfectly well and there is no clock skew.) The base station and the laptop also agree on a secure hash function H. Assume that an attacker knows the pseudo-random number generator function PRNG and the hash function H, and which NTP version is in use. However, the attacker cannot participate in NTP and synchronize the clock with the base station or the laptop. Assume that this attacker is not capable of a brute-force attack, and we are not concerned with integrity.

i. Imagine that the base station and the laptop use H(current time |MAC address of the base station | MAC address of the laptop) as a seed for PRNG, and use the sequence of random numbers from PRNG as keystream for XOR. (| means concatenation.) Can an attacker decrypt a ciphertext without participating in NTP? Explain your answer.

ii. Imagine that the base station and the laptop have a shared key K. If they use H( K | current time) as a seed for PRNG, and use the sequence of random numbers from PRNG as keystream. (| means concatenation.) Can an attacker decrypt a ciphertext without participating in NTP? Explain your answer.

iii. Design a function that the base station and the laptop can use to compute a seed, using only the shared key K, the secure hash function H, the pseudo-random number generator PRNG, and a complete clock synchronization from NTP. Explain why your function computes a seed only known to the base station and the Alice’s laptop, and the keystream generated from PRNG using this seed is secure. In other words, explain why an attacker cannot decrypt a ciphertext computed with this keystream.

  1. PGP PGP makes use of the cipher feedback (CFB) mode of CAST-128, whereas most symmetric encryption applications (other than key encryption) use the cipher block chaining (CBC) mode. We have

CBC :Ci = E(K, [Ci− 1 ⊕ Pi]); Pi = Ci− 1 ⊕ D(K, Ci) CF B :Ci = Pi ⊕ E(K, Ci− 1 ); Pi = Ci ⊕ E(K, Ci− 1 )

These two appear to provide equal security. Suggest a reason why PGP uses the CFB mode.

  1. Message Digestion SHA-1 looks way too complicated. Here is a much simpler message digest function. Split the message into 160-bit blocks. Leave the first block unchanged, shift the 2nd block 1 bit right, shift the 3rd block 2 bits right, and so on. The shift wraps bits around, i.e., 1011...0000 shifted 2 bits right is 001011...00. Then xor the resulting blocks together to obtain a 160-bit digest. Is this a good cryptographic hash function? Explain your answer.