The Security of Ciphertext Stealing Phillip Rogaway 1 Mark Wooding 2 - - PowerPoint PPT Presentation

the security of ciphertext stealing
SMART_READER_LITE
LIVE PREVIEW

The Security of Ciphertext Stealing Phillip Rogaway 1 Mark Wooding 2 - - PowerPoint PPT Presentation

The Security of Ciphertext Stealing Phillip Rogaway 1 Mark Wooding 2 Haibin Zhang 1 1 Department of Computer Science University of California at Davis 2 Thales e-Security Ltd March 20, 2012 Rogaway, Wooding, Zhang (UC Davis, Thales) The Security


slide-1
SLIDE 1

The Security of Ciphertext Stealing

Phillip Rogaway1 Mark Wooding2 Haibin Zhang1

1Department of Computer Science

University of California at Davis

2Thales e-Security Ltd

March 20, 2012

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 1 / 21

slide-2
SLIDE 2

Outline

1

Ciphertext stealing

Description Symmetric encryption schemes Security of ciphertext stealing Insecurity of the Meyer–Matyas scheme

2

Online encryption

Definitions Delayed CBC Ciphertext stealing redux

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 2 / 21

slide-3
SLIDE 3

Outline

1

Ciphertext stealing

Description Symmetric encryption schemes Security of ciphertext stealing Insecurity of the Meyer–Matyas scheme

2

Online encryption

Definitions Delayed CBC Ciphertext stealing redux

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 3 / 21

slide-4
SLIDE 4

Ciphertext stealing

P1 P2 P3 Suppose we have a message to encrypt. We might choose ciphertext block chaining.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-5
SLIDE 5

Ciphertext stealing

P1 IV P2 P3 We choose a random initialization vector.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-6
SLIDE 6

Ciphertext stealing

P1 ⊕ IV P2 P3 We whiten the first plaintext block by XORing with the IV.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-7
SLIDE 7

Ciphertext stealing

P1 ⊕ EK IV P2 P3 We feed the whitened plaintext through the blockcipher.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-8
SLIDE 8

Ciphertext stealing

P1 ⊕ EK C1 IV P2 P3 This gives us a ciphertext block.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-9
SLIDE 9

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 We whiten the next plaintext block using that ciphertext block, apply the blockcipher, and get a new ciphertext block.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-10
SLIDE 10

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C3 We repeat this for all of the plaintext blocks.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-11
SLIDE 11

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C3 P ∗

4

But wait: what if the plaintext isn’t a whole number of blocks? There’ll be an odd bit left over.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-12
SLIDE 12

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C3 P ∗

4

We pad the partial block with zero bits.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-13
SLIDE 13

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C3 P ∗

4

⊕ And then whiten using the previous ciphertext block, as usual.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-14
SLIDE 14

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C∗

3

C∗∗

3

P ∗

4

⊕ X∗

4

C∗∗

3

This leaves us with the whitened odd bit of plaintext, and a copy of the rest of the previous ciphertext block.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-15
SLIDE 15

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C∗

3

C∗∗

3

P ∗

4

⊕ X∗

4

C∗∗

3

EK C4 It’s the right width, so we can feed it through the blockcipher and get a ciphertext block.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-16
SLIDE 16

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C∗

3

C∗∗

3

P ∗

4

⊕ X∗

4

C∗∗

3

EK C4 If we decrypt that last ciphertext, we get the end of the penultimate ciphertext block back. So we don’t need to transmit that part!

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-17
SLIDE 17

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C∗

3

C∗∗

3

P ∗

4

⊕ X∗

4

C∗∗

3

EK C4 Addendum to NIST SP800–38A describes three variants differing in ci- phertext ordering.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-18
SLIDE 18

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C∗

3

C∗∗

3

P ∗

4

⊕ X∗

4

C∗∗

3

EK C4 C1 C2 C∗

3

C4 CBC-CS1 preserves ordering;

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-19
SLIDE 19

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C∗

3

C∗∗

3

P ∗

4

⊕ X∗

4

C∗∗

3

EK C4 C1 C2 C4 C∗

3

CBC-CS1 preserves ordering; CBC-CS3 preserves alignment by swap- ping;

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-20
SLIDE 20

Ciphertext stealing

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C∗

3

C∗∗

3

P ∗

4

⊕ X∗

4

C∗∗

3

EK C4 C1 C2 C4 C∗

3

CBC-CS1 preserves ordering; CBC-CS3 preserves alignment by swap- ping; CBC-CS2 swaps only when necessary, for compatibility.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 4 / 21

slide-21
SLIDE 21

Ciphertext stealing: history

Basic idea goes back at least to Meyer and Matyas (1982).

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 5 / 21

slide-22
SLIDE 22

Ciphertext stealing: history

Basic idea goes back at least to Meyer and Matyas (1982). (Unfortunately their version is broken.)

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 5 / 21

slide-23
SLIDE 23

Ciphertext stealing: history

Basic idea goes back at least to Meyer and Matyas (1982). (Unfortunately their version is broken.) CBC-CS3 described by Schneier (1996).

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 5 / 21

slide-24
SLIDE 24

Ciphertext stealing: history

Basic idea goes back at least to Meyer and Matyas (1982). (Unfortunately their version is broken.) CBC-CS3 described by Schneier (1996). CBC-CS3 specified in RFC2040 (1996, Baldwin and Rivest).

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 5 / 21

slide-25
SLIDE 25

Ciphertext stealing: history

Basic idea goes back at least to Meyer and Matyas (1982). (Unfortunately their version is broken.) CBC-CS3 described by Schneier (1996). CBC-CS3 specified in RFC2040 (1996, Baldwin and Rivest). All three standardized in addendum to NIST SP800–38A (2010).

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 5 / 21

slide-26
SLIDE 26

Definitions: symmetric encryption

Symmetric encryption syntax We take a functional view of symmetric encryption schemes. E : K × IV × P → P

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 6 / 21

slide-27
SLIDE 27

Definitions: symmetric encryption

Symmetric encryption syntax We take a functional view of symmetric encryption schemes. E : K × IV × P → P K ⊆ {0, 1}∗ is a finite key space; IV = {0, 1}v is an IV space; P ⊆ {0, 1}∗ is the message space. Require EIV

K (·) to be a length-preserving permutation on P.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 6 / 21

slide-28
SLIDE 28

Definitions: symmetric encryption

Symmetric encryption security: ind$ We capture an adversary and play one of two games.. .

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 6 / 21

slide-29
SLIDE 29

Definitions: symmetric encryption

Symmetric encryption security: ind$ IV

$

← IV c ← EIV

K (m)

m ∈ P IV c The real game: adversary chooses plaintexts m: we give back cipher- texts with fresh random IVs and a consistent random key.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 6 / 21

slide-30
SLIDE 30

Definitions: symmetric encryption

Symmetric encryption security: ind$ IV

$

← IV c

$

← {0, 1}|m| m ∈ P IV c The fake game: adversary chooses plaintexts m: we give back fresh random IVs and random fake ciphertexts.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 6 / 21

slide-31
SLIDE 31

Definitions: symmetric encryption

Symmetric encryption security: ind$ IV

$

← IV c ← EIV

K (m)

m ∈ P IV c IV

$

← IV c

$

← {0, 1}|m| m ∈ P IV c

?

Advind$

E

(A) = Pr[AReal(·) ⇒ 1] − Pr[AFake(·) ⇒ 1] The adversary’s advantage measures how well he can distinguish be- tween these games.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 6 / 21

slide-32
SLIDE 32

Security of ciphertext stealing

Theorem Let E be any of CBC-CS1[Perm(b)], CBC-CS2[Perm(b)], or

CBC-CS3[Perm(b)] and suppose adversary A asks queries totalling at most σ

  • blocks. Then

Advind$

E

(A) ≤ σ2/2b

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 7 / 21

slide-33
SLIDE 33

Security of ciphertext stealing

Theorem Let E be any of CBC-CS1[Perm(b)], CBC-CS2[Perm(b)], or

CBC-CS3[Perm(b)] and suppose adversary A asks queries totalling at most σ

  • blocks. Then

Advind$

E

(A) ≤ σ2/2b Proof idea Factor

CBC-CSnIV

K (m) = POSTn

  • |m|, CBCIV

K (PRE(m))

  • Rogaway, Wooding, Zhang (UC Davis, Thales)

The Security of Ciphertext Stealing March 20, 2012 7 / 21

slide-34
SLIDE 34

Security of ciphertext stealing

Theorem Let E be any of CBC-CS1[Perm(b)], CBC-CS2[Perm(b)], or

CBC-CS3[Perm(b)] and suppose adversary A asks queries totalling at most σ

  • blocks. Then

Advind$

E

(A) ≤ σ2/2b Proof idea Factor

CBC-CSnIV

K (m) = POSTn

  • |m|, CBCIV

K (PRE(m))

  • Observe that POSTn preserves uniform distribution.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 7 / 21

slide-35
SLIDE 35

Security of ciphertext stealing

Theorem Let E be any of CBC-CS1[Perm(b)], CBC-CS2[Perm(b)], or

CBC-CS3[Perm(b)] and suppose adversary A asks queries totalling at most σ

  • blocks. Then

Advind$

E

(A) ≤ σ2/2b Proof idea Factor

CBC-CSnIV

K (m) = POSTn

  • |m|, CBCIV

K (PRE(m))

  • Observe that POSTn preserves uniform distribution.

Show reduction from CBC security.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 7 / 21

slide-36
SLIDE 36

Insecurity of the Meyer–Matyas scheme

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C∗

3

C∗∗

3

P ∗

4

⊕ EK C4 The NIST CBC ciphertext stealing schemes, for comparison.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-37
SLIDE 37

Insecurity of the Meyer–Matyas scheme

P1 ⊕ EK C1 IV P2 ⊕ EK C2 P3 ⊕ EK C∗

3

C∗∗

3

C∗∗

3

P ∗

4

EK C4 The Meyer–Matyas ciphertext stealing scheme. There’s no chaining into the final partial block.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-38
SLIDE 38

Insecurity of the Meyer–Matyas scheme

P1 P ∗

2

b − 1

Start with a message m which is 1 bit short of two whole blocks.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-39
SLIDE 39

Insecurity of the Meyer–Matyas scheme

P1 P ∗

2

b − 1

⊕ EK IV C1 The first block is whitened with a fresh random IV and fed through the blockcipher.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-40
SLIDE 40

Insecurity of the Meyer–Matyas scheme

P1 r

1

P ∗

2

b − 1

⊕ EK IV r C∗

1

The second block is padded by prefixing with the final bit r of the pre- vious ciphertext.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-41
SLIDE 41

Insecurity of the Meyer–Matyas scheme

P1 r

1

P ∗

2

b − 1

⊕ EK IV EK C2 r C∗

1

And then fed through the blockcipher.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-42
SLIDE 42

Insecurity of the Meyer–Matyas scheme

P1 r

1

P ∗

2

b − 1

⊕ EK IV EK C2 r C∗

1

But there are only two possible values for r. If we do this twice, we expect the C2 values to be equal with probability at least 1

2.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-43
SLIDE 43

Insecurity of the Meyer–Matyas scheme

m = 1b 0b−1 Our adversary starts with such a message.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-44
SLIDE 44

Insecurity of the Meyer–Matyas scheme

m = 1b 0b−1 IV

$

← IV c ← EIV

K (m)

m IV c And asks its encryption oracle to encrypt it, getting a ciphertext c.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-45
SLIDE 45

Insecurity of the Meyer–Matyas scheme

m = 1b 0b−1 IV

$

← IV c ← EIV

K (m)

m IV c m IV ′ c′ Then it asks to encrypt the same message again, getting a new cipher- text c′.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-46
SLIDE 46

Insecurity of the Meyer–Matyas scheme

m = 1b 0b−1 LSBb(c) = LSBb(c′) ? IV

$

← IV c ← EIV

K (m)

m IV c m IV ′ c′ Advind$

CBC-CSX(A) = Pr[AReal(·) ⇒ 1] − Pr[AFake(·) ⇒ 1]

The adversary declares ‘real’ if the last b bits of c and c′ are equal.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-47
SLIDE 47

Insecurity of the Meyer–Matyas scheme

m = 1b 0b−1 LSBb(c) = LSBb(c′) ? IV

$

← IV c ← EIV

K (m)

m IV c m IV ′ c′ Advind$

CBC-CSX(A) ≥ 1

2 − Pr[AFake(·) ⇒ 1] If this is indeed the real game, we’ve just seen that they’re equal with probability at least 1

2.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-48
SLIDE 48

Insecurity of the Meyer–Matyas scheme

m = 1b 0b−1 LSBb(c) = LSBb(c′) ? IV

$

← IV c ← EIV

K (m)

m IV c m IV ′ c′ IV

$

← IV c

$

← {0, 1}|m| m IV c m IV ′ c′ Advind$

CBC-CSX(A) ≥ 1

2 − Pr[AFake(·) ⇒ 1] If this is the fake game, then the ciphertexts are simply random strings.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-49
SLIDE 49

Insecurity of the Meyer–Matyas scheme

m = 1b 0b−1 LSBb(c) = LSBb(c′) ? IV

$

← IV c ← EIV

K (m)

m IV c m IV ′ c′ IV

$

← IV c

$

← {0, 1}|m| m IV c m IV ′ c′ Advind$

CBC-CSX(A) ≥ 1

2 − 1 2b So they’re equal with probability exactly 1/2b.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 8 / 21

slide-50
SLIDE 50

Outline

1

Ciphertext stealing

Description Symmetric encryption schemes Security of ciphertext stealing Insecurity of the Meyer–Matyas scheme

2

Online encryption

Definitions Delayed CBC Ciphertext stealing redux

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 9 / 21

slide-51
SLIDE 51

Background

Idea Conventional definitions treat encryption as processing an entire message in one go.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 10 / 21

slide-52
SLIDE 52

Background

Idea Conventional definitions treat encryption as processing an entire message in one go. In real life, messages are often processed in chunks.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 10 / 21

slide-53
SLIDE 53

Background

Idea Conventional definitions treat encryption as processing an entire message in one go. In real life, messages are often processed in chunks.

Keys held by memory-constrained devices.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 10 / 21

slide-54
SLIDE 54

Background

Idea Conventional definitions treat encryption as processing an entire message in one go. In real life, messages are often processed in chunks.

Keys held by memory-constrained devices. Reducing end-to-end latency.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 10 / 21

slide-55
SLIDE 55

Background

Idea Conventional definitions treat encryption as processing an entire message in one go. In real life, messages are often processed in chunks.

Keys held by memory-constrained devices. Reducing end-to-end latency.

We should have definitions which capture this behaviour so that we can analyse the security of schemes.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 10 / 21

slide-56
SLIDE 56

Background

Idea Conventional definitions treat encryption as processing an entire message in one go. In real life, messages are often processed in chunks.

Keys held by memory-constrained devices. Reducing end-to-end latency.

We should have definitions which capture this behaviour so that we can analyse the security of schemes. History

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 10 / 21

slide-57
SLIDE 57

Background

Idea Conventional definitions treat encryption as processing an entire message in one go. In real life, messages are often processed in chunks.

Keys held by memory-constrained devices. Reducing end-to-end latency.

We should have definitions which capture this behaviour so that we can analyse the security of schemes. History Blockwise-adaptive attacks: [Bellare, Kohno, Namprempre 2002], [Joux, Martinet, Valette 2002], [Fouque, Martinet, Poupard 2003], [Fouque, Joux, Poupard 2004], [Bard 2007].

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 10 / 21

slide-58
SLIDE 58

Background

Idea Conventional definitions treat encryption as processing an entire message in one go. In real life, messages are often processed in chunks.

Keys held by memory-constrained devices. Reducing end-to-end latency.

We should have definitions which capture this behaviour so that we can analyse the security of schemes. History Blockwise-adaptive attacks: [Bellare, Kohno, Namprempre 2002], [Joux, Martinet, Valette 2002], [Fouque, Martinet, Poupard 2003], [Fouque, Joux, Poupard 2004], [Bard 2007]. Our stream-based approach from [Gennaro, Rohatgi 1997].

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 10 / 21

slide-59
SLIDE 59

How it looks

P Suppose we have a plaintext message P. Maybe we don’t even know all of it yet.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 11 / 21

slide-60
SLIDE 60

How it looks

P1 P2 P3 Split it into chunks P1, P2, . . . of arbitrary sizes.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 11 / 21

slide-61
SLIDE 61

How it looks

P1 P2 P3 V0 Sample an initial state (‘initialization vector’) V0 appropriate for the en- cryption scheme.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 11 / 21

slide-62
SLIDE 62

How it looks

P1 P2 P3 V0 E0

K

C1 Feed the first plaintext chunk to the encryption scheme. It gives us a ciphertext chunk C1. In general, C1 might not be the same length as P1.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 11 / 21

slide-63
SLIDE 63

How it looks

P1 P2 P3 V0 E0

K

C1 V1 It also gives us a state V1.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 11 / 21

slide-64
SLIDE 64

How it looks

P1 P2 P3 V0 E0

K

C1 V1 E0

K

C2 V2 We can feed the next plaintext P2 to the encryption scheme, along with the previous state V1. We get a ciphertext chunk C2 and a new state V2.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 11 / 21

slide-65
SLIDE 65

How it looks

P1 P2 P3 V0 E0

K

C1 V1 E0

K

C2 V2 E1

K

C3 And so on. . . Indicate to the encryption scheme when there are no more chunks to process.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 11 / 21

slide-66
SLIDE 66

What’s new about our definition

We don’t depend on chunks being single blocks, or aligned to block boundaries.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 12 / 21

slide-67
SLIDE 67

What’s new about our definition

We don’t depend on chunks being single blocks, or aligned to block boundaries. Indeed, we don’t assume there’s a blockcipher involved at all.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 12 / 21

slide-68
SLIDE 68

What’s new about our definition

We don’t depend on chunks being single blocks, or aligned to block boundaries. Indeed, we don’t assume there’s a blockcipher involved at all. Security is defined in terms of indistinguishability from random strings of appropriate lengths.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 12 / 21

slide-69
SLIDE 69

Definitions: online encryption

Online encryption syntax We define online encryption schemes as functions: E : K × V × {0, 1} × {0, 1}∗ → {0, 1}∗ × V (Ci, Vi) ← EVi−1,δ

K

(Pi)

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 13 / 21

slide-70
SLIDE 70

Definitions: online encryption

Online encryption syntax We define online encryption schemes as functions: E : K × V × {0, 1} × {0, 1}∗ → {0, 1}∗ × V (Ci, Vi) ← EVi−1,δ

K

(Pi) K is the key space. We require that it be finite.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 13 / 21

slide-71
SLIDE 71

Definitions: online encryption

Online encryption syntax We define online encryption schemes as functions: E : K × V × {0, 1} × {0, 1}∗ → {0, 1}∗ × V (Ci, Vi) ← EVi−1,δ

K

(Pi) K is the key space. We require that it be finite. V ⊆

0≤i<v{0, 1}i is the state space.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 13 / 21

slide-72
SLIDE 72

Definitions: online encryption

Online encryption syntax We define online encryption schemes as functions: E : K × V × {0, 1} × {0, 1}∗ → {0, 1}∗ × V (Ci, Vi) ← EVi−1,δ

K

(Pi) K is the key space. We require that it be finite. V ⊆

0≤i<v{0, 1}i is the state space.

δ ∈ {0, 1} is the end-of-message indicator: 0 means more chunks are coming; 1 means this is the last one.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 13 / 21

slide-73
SLIDE 73

Definitions: online encryption

Online encryption syntax We define online encryption schemes as functions: E : K × V × {0, 1} × {0, 1}∗ → {0, 1}∗ × V (Ci, Vi) ← EVi−1,δ

K

(Pi) K is the key space. We require that it be finite. V ⊆

0≤i<v{0, 1}i is the state space.

δ ∈ {0, 1} is the end-of-message indicator: 0 means more chunks are coming; 1 means this is the last one. Also a message space P ⊆ {0, 1}∗ and IV space IV ⊆ V.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 13 / 21

slide-74
SLIDE 74

Definitions: online encryption

Online encryption syntax We define online encryption schemes as functions: E : K × V × {0, 1} × {0, 1}∗ → {0, 1}∗ × V (Ci, Vi) ← EVi−1,δ

K

(Pi) Well-formedness requirements

Ciphertexts The ciphertext is always the same whichever way you

split up the plaintext.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 13 / 21

slide-75
SLIDE 75

Definitions: online encryption

Online encryption syntax We define online encryption schemes as functions: E : K × V × {0, 1} × {0, 1}∗ → {0, 1}∗ × V (Ci, Vi) ← EVi−1,δ

K

(Pi) Well-formedness requirements

Ciphertexts The ciphertext is always the same whichever way you

split up the plaintext.

Invertibility Ciphertexts can be decrypted uniquely.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 13 / 21

slide-76
SLIDE 76

Definitions: online encryption

Online encryption syntax We define online encryption schemes as functions: E : K × V × {0, 1} × {0, 1}∗ → {0, 1}∗ × V (Ci, Vi) ← EVi−1,δ

K

(Pi) Well-formedness requirements

Ciphertexts The ciphertext is always the same whichever way you

split up the plaintext.

Invertibility Ciphertexts can be decrypted uniquely. Lengths The lengths of ciphertext chunks depend only on the

history of plaintext lengths.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 13 / 21

slide-77
SLIDE 77

Online encryption security: IND$

Initialization: V

$

← IV (c, V) ← EV,δ

K (m)

m, δ c Adversary submits message chunks and a ‘done’ flag to an oracle, which returns ciphertext chunks.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 14 / 21

slide-78
SLIDE 78

Online encryption security: IND$

Initialization: V

$

← IV (c, V) ← EV,δ

K (m)

c′

$

← {0, 1}|c| m, δ c′ . . . or maybe it just returns random strings of the right length.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 14 / 21

slide-79
SLIDE 79

Online encryption security: IND$

Initialization: V

$

← IV (c, V) ← EV,δ

K (m)

m, δ c (c, V) ← EV,δ

K (m)

c′

$

← {0, 1}|c| m, δ c′ We’d like these to be hard to distinguish.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 14 / 21

slide-80
SLIDE 80

Online encryption security: IND$

Initialization: Vi

$

← IV for i ∈ N (c, Vi) ← EVi,δ

K

(m) i, m, δ c (c, Vi) ← EVi,δ

K

(m) c′

$

← {0, 1}|c| i, m, δ c′ . . . even when the adversary can contribute to multiple messages con- currently.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 14 / 21

slide-81
SLIDE 81

Online encryption security: IND$

Initialization: Vi

$

← IV for i ∈ N (c, Vi) ← EVi,δ

K

(m) m, δ c (c, Vi) ← EVi,δ

K

(m) c′

$

← {0, 1}|c| m, δ c′

?

AdvIND$

E

(A) = Pr[AReal(·) ⇒ 1] − Pr[AFake(·) ⇒ 1] The adversary’s advantage measures how well he can distinguish be- tween these two games.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 14 / 21

slide-82
SLIDE 82

CBC online – wrong version

P We’re given a plaintext chunk.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 15 / 21

slide-83
SLIDE 83

CBC online – wrong version

P0 P0 P In general, we have a partial plaintext left over from the previous call. Tack this on the front.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 15 / 21

slide-84
SLIDE 84

CBC online – wrong version

P0 P1 P2 P3 P ∗ And split the plaintext into blocks. There’ll be a bit left over.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 15 / 21

slide-85
SLIDE 85

CBC online – wrong version

C0 P0 P1 P2 P3 P ∗ ⊕ EK C1 ⊕ EK C2 ⊕ EK C3 Encrypt the whole blocks using CBC mode, using an IV maintained in the state.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 15 / 21

slide-86
SLIDE 86

CBC online – wrong version

C0 P0 P1 P2 P3 P ∗ ⊕ EK C1 ⊕ EK C2 ⊕ EK C3 C3 P ∗ The new state is the last ciphertext block, and the leftover bit of plain- text.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 15 / 21

slide-87
SLIDE 87

CBC online – insecurity of the wrong version

Of course, this is insecure. The adversary learns the IV to be used to encrypt the next plaintext chunk as part of this ciphertext.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 16 / 21

slide-88
SLIDE 88

CBC online – insecurity of the wrong version

Of course, this is insecure. The adversary learns the IV to be used to encrypt the next plaintext chunk as part of this ciphertext. Suppose this is V ; suppose also that the adversary guesses that the plaintext corresponding to some ciphertext Ci is P ∗, i.e., that Ci = EK(P ∗ ⊕ Ci−1).

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 16 / 21

slide-89
SLIDE 89

CBC online – insecurity of the wrong version

Of course, this is insecure. The adversary learns the IV to be used to encrypt the next plaintext chunk as part of this ciphertext. Suppose this is V ; suppose also that the adversary guesses that the plaintext corresponding to some ciphertext Ci is P ∗, i.e., that Ci = EK(P ∗ ⊕ Ci−1). So he arranges for the first block encrypted as part of the next plaintext chunk to be P ∗ ⊕ V ⊕ Ci−1. If the resulting ciphertext is Ci then his guess is confirmed.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 16 / 21

slide-90
SLIDE 90

CBC online – insecurity of the wrong version

Of course, this is insecure. The adversary learns the IV to be used to encrypt the next plaintext chunk as part of this ciphertext. Suppose this is V ; suppose also that the adversary guesses that the plaintext corresponding to some ciphertext Ci is P ∗, i.e., that Ci = EK(P ∗ ⊕ Ci−1). So he arranges for the first block encrypted as part of the next plaintext chunk to be P ∗ ⊕ V ⊕ Ci−1. If the resulting ciphertext is Ci then his guess is confirmed. It’s sufficient to hold one block back [FMP03].

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 16 / 21

slide-91
SLIDE 91

CBC online – insecurity of the wrong version

Of course, this is insecure. The adversary learns the IV to be used to encrypt the next plaintext chunk as part of this ciphertext. Suppose this is V ; suppose also that the adversary guesses that the plaintext corresponding to some ciphertext Ci is P ∗, i.e., that Ci = EK(P ∗ ⊕ Ci−1). So he arranges for the first block encrypted as part of the next plaintext chunk to be P ∗ ⊕ V ⊕ Ci−1. If the resulting ciphertext is Ci then his guess is confirmed. It’s sufficient to hold one block back [FMP03]. Intuition: CBC

  • utput is indistinguishable from random data, so the last block

should be unpredictable, which is sufficient for security.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 16 / 21

slide-92
SLIDE 92

Delayed CBC [FMP03]

C0 P0 P The state looks the same: previous ciphertext, and leftover plaintext.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 17 / 21

slide-93
SLIDE 93

Delayed CBC [FMP03]

C0 P0 P1 P2 P3 P ∗ ⊕ EK C1 ⊕ EK C2 ⊕ EK C3 Prefix the leftover plaintext to the new chunk, split into blocks, and encrypt.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 17 / 21

slide-94
SLIDE 94

Delayed CBC [FMP03]

C0 P0 P1 P2 P3 P ∗ ⊕ EK C1 ⊕ EK C2 ⊕ EK C0 C3 We must output the previous-ciphertext block. We shouldn’t output the last new ciphertext block, just store it for later.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 17 / 21

slide-95
SLIDE 95

Delayed CBC [FMP03]

C0 P0 P1 P2 P3 P ∗ ⊕ EK C1 ⊕ EK C2 ⊕ EK C0 C3 P ∗ And we keep the leftover piece of plaintext.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 17 / 21

slide-96
SLIDE 96

Delayed CBC with ciphertext stealing

C0 P0 P1 P2 P3 P ∗ ⊕ EK C1 C0 ⊕ EK C2 ⊕ EK C3 So, we’ve got to the end of a message, and we’ve not filled up the last block.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 18 / 21

slide-97
SLIDE 97

Delayed CBC with ciphertext stealing

C0 P0 P1 P2 P3 P ∗ ⊕ EK C1 C0 ⊕ EK C2 ⊕ EK C3 ⊕ EK C4 So we pad it with zero bits.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 18 / 21

slide-98
SLIDE 98

Delayed CBC with ciphertext stealing

C0 P0 P1 P2 P3 P ∗ ⊕ EK C1 C0 ⊕ EK C2 ⊕ EK C∗

3

C∗∗

3

⊕ EK C4 The recipient can recover the tail of the next-to-last ciphertext block by decrypting the final one.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 18 / 21

slide-99
SLIDE 99

Delayed CBC with ciphertext stealing

C0 P0 P1 P2 P3 P ∗ ⊕ EK C1 C0 ⊕ EK C2 ⊕ EK C∗

3

C∗∗

3

⊕ EK C4 Again, there are variants which differ in how they order the last two ciphertext blocks.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 18 / 21

slide-100
SLIDE 100

Delayed CBC with ciphertext stealing

Actually the natural implementation. You have to hold back the last ciphertext block anyway, because you might have to truncate

  • it. Indeed, for DCBC-CS3, you sometimes have to hold back two

ciphertexts blocks.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 19 / 21

slide-101
SLIDE 101

Security of delayed CBC with ciphertext stealing

Theorem Let E be any of DCBC-CS1[Perm(b)], DCBC-CS2[Perm(b)], or

DCBC-CS3[Perm(b)] and suppose adversary A asks queries totalling at most

σ blocks. Then AdvIND$

E

(A) ≤ σ2/2b

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 20 / 21

slide-102
SLIDE 102

Security of delayed CBC with ciphertext stealing

Theorem Let E be any of DCBC-CS1[Perm(b)], DCBC-CS2[Perm(b)], or

DCBC-CS3[Perm(b)] and suppose adversary A asks queries totalling at most

σ blocks. Then AdvIND$

E

(A) ≤ σ2/2b Proof idea Describe DCBC-CSn in terms of a DCBC oracle. (Not quite as simple as the offline case: the state needs to be structured differently, and parts of it duplicated.)

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 20 / 21

slide-103
SLIDE 103

Security of delayed CBC with ciphertext stealing

Theorem Let E be any of DCBC-CS1[Perm(b)], DCBC-CS2[Perm(b)], or

DCBC-CS3[Perm(b)] and suppose adversary A asks queries totalling at most

σ blocks. Then AdvIND$

E

(A) ≤ σ2/2b Proof idea Describe DCBC-CSn in terms of a DCBC oracle. (Not quite as simple as the offline case: the state needs to be structured differently, and parts of it duplicated.) Observe that the postprocessing applied to the ciphertext preserves uniform distribution.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 20 / 21

slide-104
SLIDE 104

Security of delayed CBC with ciphertext stealing

Theorem Let E be any of DCBC-CS1[Perm(b)], DCBC-CS2[Perm(b)], or

DCBC-CS3[Perm(b)] and suppose adversary A asks queries totalling at most

σ blocks. Then AdvIND$

E

(A) ≤ σ2/2b Proof idea Describe DCBC-CSn in terms of a DCBC oracle. (Not quite as simple as the offline case: the state needs to be structured differently, and parts of it duplicated.) Observe that the postprocessing applied to the ciphertext preserves uniform distribution. Show reduction from DCBC security.

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 20 / 21

slide-105
SLIDE 105

The end

Rogaway, Wooding, Zhang (UC Davis, Thales) The Security of Ciphertext Stealing March 20, 2012 21 / 21