30.12.2013 Views

Problems for week 5-6, Cryptography

Problems for week 5-6, Cryptography

Problems for week 5-6, Cryptography

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

9. We recall the CBC mode of encryption of a message M = M 1 M 2 M 3 . . . M n , where<br />

M i is block number i of M. Then the encrypted message is C 0 C 1 C 2 . . . C n , where<br />

C 0 = IV<br />

C i = E K (M i ⊕ C i−1 ), i = 1, 2, . . . n.<br />

Now we consider the following beginning of a protocol:<br />

1. A −→ B : N A<br />

2. B −→ A : {N A , K} KAB .<br />

We do not need to know more about the protocol (which may contain further messages)<br />

than the following:<br />

• A and B share a long-term AES key K AB ; the notation {. . .} KAB<br />

encryption of . . . using AES in CBC mode (block size 128 bits).<br />

denotes<br />

• N A is a 128 bit nonce chosen by A and K is a 128 bit session key chosen by B.<br />

In the second message, B includes N A to ensure freshness and K as a session key <strong>for</strong><br />

the session just started. When A receives the second message, she thus concludes<br />

that B is alive at the other end and has just chosen a fresh session key K.<br />

Now consider the following scenario: The adversary C eavesdrops on a run of this<br />

protocol between A and B and stores messages sent. Because of an unspecified<br />

mistake by A or B (outside the protocol), C gets hold of K and can of course read<br />

all subsequent messages in the session. But, the situation is worse than that, as we<br />

shall see.<br />

Let message 2 in the run described above be C 0 C 1 C 2 (three blocks; the IV and two<br />

encrypted blocks).<br />

The next day, A and B initiate a new session. C again eavesdrops and now intercepts<br />

the second message C ′ 0 C′ 1 C′ 2 , changes it to C′ 0 C′ 1 C 2 and sends the changed message<br />

to A, pretending to be B. Show that A will accept the message as the reply to her<br />

first message in the new run and that C will know the session key of the new run<br />

and thus can continue the session with A, pretending to be B.<br />

10. We consider the following protocol intended to allow Alice to authenticate herself<br />

to Bob with the help of a trusted third party T . Alice and Bob do not know each<br />

other, but each of them shares a symmetric key, K AT and K BT , respectively, with<br />

T .<br />

1. A −→ B : A.<br />

2. B −→ A : N B .<br />

3. A −→ B : {N B } KAT .<br />

4. B −→ T : {A, {N B } KAT } KBT .<br />

5. T −→ B : {A, N B } KBT .<br />

After receiving message 5, Bob decrypts it and checks that the encrypted message<br />

contains Alice’s name and the nonce he created and sent in message 2. If so, he<br />

accepts the run and Alice is authenticated.<br />

Now consider the following attack, where the adversary C will manage to get himself<br />

authenticated as Alice.<br />

1. C(A) −→ B : A.<br />

2. B −→ C(A) : N B .<br />

3. C(A) −→ B : N B .<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!