Modes of Operation Flashcards

1
Q

Why are block ciphers not secure witout modes of operation?

A

Because when you encrypt each block individually, structure of the plaintext will persist.
For instance, two blocks of all zeros will result in two blocks of the same cipher text. Hence the structure remains.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is one of the biggest risks in modes of operations?

A

When a single bit error occurs (f.i. in transmission) all following blocks will no longer be interpetable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is ECB?

A

Electronic Code Book Mode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain how ECB works.

A

Each block is encrypted/decrypted individually.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the effect of bit error in ECB?

A

A one bit error will only effect that specific block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the effect of block loss in ECB?

A

The loss of blocks cannot be detected, same goes for block insertion.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain how Adversary wins the OW CCA security game for any mode.

A

The cipher text is not allowed to be the same as the challengers.
So you append a block to the original cipher text containing the first block. This will allow you to succesfully decrypt the first block using the decryption oracle.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Argue the security level of ECB. (explain for each level how it is broken).

A

ECB is not IND-PASS: It can provide two messages to lr-oracle one being M1 and other M1||M1 and then it can easily determine if y was chosen randomly or using block cipher.

ECB is not OW CCA secure using the same logic: So you append a block to the original cipher text containing the first block. This will allow you to succesfully decrypt the first block using the decryption oracle.

ECB is OW CPA secure, because it is computationally inthesible to inverse operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

xplain

What is CBC?

A

Cipher Block Chaining

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How does CBC encryption work?

A

You XOR block 1 with IV and encrypt the result using your cipher method. Then the first cipher block is used to XOR the second plain text, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does CBC decryption work?

A

You decrypt cipher block 1 and then XOR the result with IV. Then the first cipher block is used to XOR the second plain text block (retrieved after deciphering second cipher block), continued…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What effect has bit error on CBC?

A

That block is not decrypted properly (whole block is lost) and it will cause a single bit error in the next plain text block.
m1 || r || bit error || m4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What effect has block loss on CBC?

A

It will cause one block to be decrypted incorrectly.
m1 || r || m4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain how adversary can win CBC mode for IND CPA.

A

For fixed, or nonce based IV it is possible to win:
CBC encrypts m1 XOR IV to get c1. Hence, if m1 and IV are the same, we essentially encrypt( 0 ) to get c1.
Nonce can only be provided once to the adversary, so if we get c’ for m1 = Iv = 0, then we can user LR-Oracle with m1 = 0, m2 = 1= IV. Then c* is able to be compared.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does OFB mode stand for?

A

Output Feeback Mode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How does OFB encryption work?

A

Lets say intermediate value Y is the result of encrypting the previous value of Y, with Y0= enc(IV). Then ci = Yi XOR mi, for i>0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How does OFB decryption work?

A

Lets say intermediate value Y is the result of encrypting the previous value of Y, with Y0= enc(IV). Then mi = Yi XOR ci, for i>0

No encrypting is not a mistake here…

18
Q

What effect does bit error have on OFB?

A

That bit error is reflected in the plain text, but no block loss.
m1 || bit error || m3

19
Q

What effect does block loss have on OFB?

A

When the reciever is aware that block is lost: it can iterate the ‘key’ value (Y), in this case only one block is lost.
m1 || x || m3

In case of the reciever is not aware, then **avalanche effect **takes place and all the following blocks cannot be decrypted.
m1 || r || r

20
Q

What effect does block insertion have on OFB?

A

An attacker can not insert/replay blocks in the ciphertext (see block loss), but it can append blocks.

21
Q

What is the security of OFB mode?

A
  • Fixed IV: not IND-CPA secure, also not OW-CPA secure
  • Nonce based IV: not OW-CPA secure
  • Random IV: IND-CPA secure
22
Q

What does CFB stand for?

A

Ciphertext Feedback Mode

23
Q

How does CFB encryption work?

A

You encrypt the previous cipher text block and XOR that with the plaintext block. Y0 = encr(IV)

24
Q

How does CFB decryption work?

A

You encrypt the previous cipher text block and XOR that with the ciphertext block. Y0 = encr(IV)

25
Q

What is the effect of bit error in CFB mode?

A

It will cause a bit error in that plain text block, and it won’t be able to correctly decrypt the next block.
m1 || bit error || r || m4

26
Q

What is the effect of block loss in CFB?

A

thenext cipher text block is not decrypted correctly:
m1 || r || m4

27
Q

What is the security of CFB?

A
  • Nonce based IV: not IND-CPA secure but OW-CPA secure
  • Random IV: IND CPA
28
Q

What is the big advantage of using CFB or OFB?

A

Speed: it is very fast to compute.

29
Q

What does CTR stand for?

A

Counter mode.

30
Q

How does CTR encryption work?

A

Each block encrypts value IV +i , and XORs it with mi. Where i is the block-id.
mi XOR e(IV+i) = ci

31
Q

How does CTR decryption work?

A

Each block encrypts value IV +i , and XORs it with c1. Where i is the block-id.
c1 XOR e(IV+i) = mi

32
Q

How is the IV managed in CTR? What is the advantage?

A

IV is publicly known, but incremented each time a block is encrpyted. This means that the same plain text results in different cipher texts.

33
Q

What is the effect of bit error in CTR?

A

Only that block is XORed with a bit error:
m1 || bit error || m3 ||

34
Q

What is the effect of block loss/insertion in CTR

A

It will be detected because the IV is no longer incremented correctly.

Block appending is possible, however.

35
Q

what is the security of CTR?

A

IND CPA, unless fixed IV is used, then IND PASS

36
Q

What is a big advantage of CTR?

A

Parallel computation is possible, due to lack of dependencies.

37
Q

How can we make any mode of operation IND CCA secure?

A

Encrypt-then-MAC

38
Q

Explain how Encrypt-then-Mac works and argue if it is secure.

A

Keygen: You use k1 for encryption and k2 for MAC. You compute the MAC of the ciphertext using k2.
During decryption you verify the MAC, based on k2, to verify if the ciphertext has been tempered.

It is IND CCA secure.

39
Q

Explain how Encrypt-and-Mac works and if it is secure.

A

Keygen: You use k1 for encryption and k2 for MAC. You compute the MAC of the plaintext using k2.
During decryption you first decrypt the cipher text, using k1, and then verify the MAC of the plain text.

It is not IND CPA secure.

40
Q

Explain how MAC then Encrypt works and argue if it is secure.

A

You first compute the MAC, then you compute the cipher text based on the plain text and the MAC. You verify it by decrpyting cipher text and verifiy MAC of plaintext.

It is not IND CPA secure. (for deterministic MAC)