Computer-aided cryptographic proofs Gilles Barthe & Yassine - - PowerPoint PPT Presentation

computer aided cryptographic proofs
SMART_READER_LITE
LIVE PREVIEW

Computer-aided cryptographic proofs Gilles Barthe & Yassine - - PowerPoint PPT Presentation

Computer-aided cryptographic proofs Gilles Barthe & Yassine Lakhnech IMDEA Software Institute, Madrid, Spain Universit Joseph Fourier & CNRS, Grenoble, France Based on joint work with J.M. Crespo, F. Dupressoir, B. Grgoire, C. Kunz,


slide-1
SLIDE 1

Computer-aided cryptographic proofs

Gilles Barthe & Yassine Lakhnech

IMDEA Software Institute, Madrid, Spain Université Joseph Fourier & CNRS, Grenoble, France

Based on joint work with J.M. Crespo, F. Dupressoir, B. Grégoire,

  • C. Kunz, B. Schmidt, P

.-Y. Strub, S. Zanella, J.C.B. Almeida,

  • M. Barbosa
slide-2
SLIDE 2

Modern cryptography

1949 1984 1994

  • C. Shannon. Communication theory of secrecy systems.

◮ No practical encryption system is perfectly secure ◮ Scheme −

→ Attack − → Scheme − → Attack − → . . .

◮ Scheme deemed secure if no attack found for long time

  • S. Goldwasser and S. Micali. Probabilistic encryption.

◮ Complexity-theoretical approach ◮ Negligible probability to break a scheme in polynomial-time

  • M. Bellare and P

. Rogaway. Optimal Asymmetric Encryption.

◮ Upper bound the probability to break a scheme in time t

slide-3
SLIDE 3

Reductionist proof

Scheme

slide-4
SLIDE 4

Reductionist proof

Scheme Primitive

slide-5
SLIDE 5

Reductionist proof

Scheme Primitive

Generic construction

slide-6
SLIDE 6

Reductionist proof

Scheme Primitive

Generic construction

Attack

slide-7
SLIDE 7

Reductionist proof

Scheme Primitive

Generic construction

Attack Attack

slide-8
SLIDE 8

Reductionist proof

Scheme Primitive

Generic construction

Attack Attack

Black-box reduction

slide-9
SLIDE 9

Reductionist proof

Scheme Primitive

Generic construction

Attack Attack

Black-box reduction

Ideally attacks have similar execution times

slide-10
SLIDE 10

Public-key encryption

Algorithms (K, Epk, Dsk)

◮ E probabilistic ◮ D deterministic and partial

If (sk, pk) is a valid key pair, Dsk(Epk(m)) = m

Encryption Decryption Key generation

hello Public key rwxtf Secret key hello

slide-11
SLIDE 11

Public-key encryption

Indistinguishability against chosen-ciphertext attacks

Game IND-CCA(A) (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b)

slide-12
SLIDE 12

Public-key encryption

Indistinguishability against chosen-ciphertext attacks

Game IND-CCA(A) (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b)

m0 m1

slide-13
SLIDE 13

Public-key encryption

Indistinguishability against chosen-ciphertext attacks

Game IND-CCA(A) (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b)

m0 m1 $ b

slide-14
SLIDE 14

Public-key encryption

Indistinguishability against chosen-ciphertext attacks

Game IND-CCA(A) (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b)

m0 m1 $ b mb

slide-15
SLIDE 15

Public-key encryption

Indistinguishability against chosen-ciphertext attacks

Game IND-CCA(A) (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b)

m0 m1 $ b mb Epk c⋆

slide-16
SLIDE 16

Public-key encryption

Indistinguishability against chosen-ciphertext attacks

Game IND-CCA(A) (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b)

m0 m1 $ b mb Epk c⋆ c⋆

slide-17
SLIDE 17

Public-key encryption

Indistinguishability against chosen-ciphertext attacks

Game IND-CCA(A) (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b)

m0 m1 $ b mb Epk c⋆ c⋆ b′

slide-18
SLIDE 18

Public-key encryption

Indistinguishability against chosen-ciphertext attacks

Game IND-CCA(A) (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b)

m0 m1 $ b mb Epk c⋆ c⋆ b′

?

=

slide-19
SLIDE 19

Public-key encryption

Indistinguishability against chosen-ciphertext attacks

Game IND-CCA(A) (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b)

m0 m1 $ b mb Epk c⋆ c⋆ b′

?

=

  • PrIND-CCA(A)
  • b′ = b
  • − 1

2

  • small
slide-20
SLIDE 20

One-way trapdoor permutations

Algorithms (K, fpk, f−1

sk ) ◮ fpk and f−1 sk deterministic

If (sk, pk) is a valid key pair, f−1

sk (fpk(m)) = m

Encryption Decryption Key generation

hello Public key rwxtf Secret key hello

slide-21
SLIDE 21

One-way trapdoor permutations

(sk, pk) ← K(); y

$

← {0, 1}n; x⋆ ← fpk(y); y′ ← I(x⋆); return (y′ = y)

slide-22
SLIDE 22

One-way trapdoor permutations

(sk, pk) ← K(); y

$

← {0, 1}n; x⋆ ← fpk(y); y′ ← I(x⋆); return (y′ = y)

$

y

slide-23
SLIDE 23

One-way trapdoor permutations

(sk, pk) ← K(); y

$

← {0, 1}n; x⋆ ← fpk(y); y′ ← I(x⋆); return (y′ = y)

$

y fpk x⋆

slide-24
SLIDE 24

One-way trapdoor permutations

(sk, pk) ← K(); y

$

← {0, 1}n; x⋆ ← fpk(y); y′ ← I(x⋆); return (y′ = y)

$

y fpk x⋆ x⋆

slide-25
SLIDE 25

One-way trapdoor permutations

(sk, pk) ← K(); y

$

← {0, 1}n; x⋆ ← fpk(y); y′ ← I(x⋆); return (y′ = y)

$

y fpk x⋆ x⋆ y ′

slide-26
SLIDE 26

One-way trapdoor permutations

(sk, pk) ← K(); y

$

← {0, 1}n; x⋆ ← fpk(y); y′ ← I(x⋆); return (y′ = y)

$

y fpk x⋆ x⋆ y ′

?

=

slide-27
SLIDE 27

One-way trapdoor permutations

(sk, pk) ← K(); y

$

← {0, 1}n; x⋆ ← fpk(y); y′ ← I(x⋆); return (y′ = y)

$

y fpk x⋆ x⋆ y ′

?

=

PrOW(I)

  • y′ = y
  • small
slide-28
SLIDE 28

Optimal Asymmetric Encryption Padding

Encryption EOAEP(pk)(m) : r

$

← {0, 1}k0; s ← G(r) ⊕ (m0k1); t ← H(s) ⊕ r; return fpk(st) Decryption DOAEP(sk)(c) : (s, t) ← f−1

sk (c);

r ← t ⊕ H(s); if ([s ⊕ G(r)]k1=0k1) then {m ← [s ⊕ G(r)]k; } else {m ← ⊥; } return m ⊕ exclusive or concatenation [·] projection 0 zero bitstring

slide-29
SLIDE 29

Optimal Asymmetric Encryption Padding

Encryption EOAEP(pk)(m) : r

$

← {0, 1}k0; s ← G(r) ⊕ (m0k1); t ← H(s) ⊕ r; return fpk(st) Decryption DOAEP(sk)(c) : (s, t) ← f−1

sk (c);

r ← t ⊕ H(s); if ([s ⊕ G(r)]k1=0k1) then {m ← [s ⊕ G(r)]k; } else {m ← ⊥; } return m For every IND-CCA adversary A against (K, EOAEP, DOAEP), there exists a PDOW adversary I against (K, f, f−1) st

  • PrIND-CCA(A)[b′ = b] − 1

2

PrPDOW(I)[y′ = y] + 3qDqG+q2

D+4qD+qG

2k0

+ 2qD

2k1

slide-30
SLIDE 30

OAEP: Optimal Asymmetric Encryption Padding

1994 Bellare and Rogaway 2001 Shoup Fujisaki, Okamoto, Pointcheval, Stern 2004 Pointcheval 2009 Bellare, Hofheinz, Kiltz 2011 BGLZ

1994 Purported proof of chosen-ciphertext security 2001 1994 proof gives weaker security; desired security holds

◮ for a modified scheme ◮ under stronger assumptions

2004 Filled gaps in 2001 proof 2009 Security definition needs to be clarified 2011 Fills gaps in 2004 proof

slide-31
SLIDE 31

What’s wrong with provable security?

◮ In our opinion, many proofs in cryptography have become

essentially unverifiable. Our field may be approaching a crisis of rigor. Bellare and Rogaway, 2004-2006

◮ Do we have a problem with cryptographic proofs? Yes, we

do [...] We generate more proofs than we carefully verify (and as a consequence some of our published proofs are incorrect). Halevi, 2005

slide-32
SLIDE 32

Computer-aided cryptographic proofs

Provable security as deductive relational verification

  • f open probabilistic parametrized programs

CertiCrypt (2006-2011): adhere to cryptographic methods

◮ same level of abstraction ◮ same guarantees ◮ same proof techniques

EasyCrypt (2009-): adhere to cryptographic practice

◮ automation and scalability ◮ support for high level steps ◮ accessible to cryptographers

slide-33
SLIDE 33

A language for cryptographic games

C ::= skip skip | V ← E assignment | V

$

← D random sampling | C; C sequence | if E then C else C conditional | while E do C while loop | V ← P(E, . . . , E) procedure call

◮ E: (higher-order) expressions ◮ D: discrete sub-distributions ◮ P: procedures

  • user extensible

. oracles: concrete procedures . adversaries: constrained abstract procedures

slide-34
SLIDE 34

pRHL: a relational Hoare logic for games

◮ Judgment

{P} c1 ∼ c2 {Q}

◮ Validity

∀m1, m2. (m1, m2) P = ⇒ (c1 m1, c2 m2) Q♯

◮ Proof rules

{P ∧ e1} c1 ∼ c {Q} {P ∧ ¬e1} c2 ∼ c {Q} {P} if e then c1 else c2 ∼ c {Q} P → e1=e′2 {P ∧ e1} c1 ∼ c′

1 {Q}

{P ∧ ¬e1} c2 ∼ c′

2 {Q}

{P} if e then c1 else c2 ∼ if e′ then c′

1 else c′ 2 {Q}

+ random samplings, procedures, adversaries. . .

◮ Verification condition generator

slide-35
SLIDE 35

Example: Bellare and Rogaway 1993 encryption

Game IND-CPA(A) : (sk, pk) ← K( ); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b) Encryption Epk(m) : r

$

← {0, 1}ℓ; s ← H(r) ⊕ m; y ← fpk(r)s; return y For every IND-CPA adversary A, there exists an inverter I st

  • PrIND-CPA(A)
  • b′ = b
  • − 1

2

  • ≤ PrOW(I)
  • y′ = y
slide-36
SLIDE 36

Proof

Game hopping technique

Game INDCPA : (sk, pk) ← K(); (m0, m1) ← A1(pk); b $ ← {0, 1}; c⋆ ← Epk (mb); b′ ← A2(c⋆); return (b′ = b) Encryption Epk (m) : r $ ← {0, 1}ℓ; h ← H(r); s ← h ⊕ m; c ← fpk (r)s; return c Game G : (sk, pk) ← K(); (m0, m1) ← A1(pk); b $ ← {0, 1}; c⋆ ← Epk (mb); b′ ← A2(c⋆); return (b′ = b) Encryption Epk (m) : r $ ← {0, 1}ℓ; h $ ← {0, 1}k ; s ← h ⊕ m; c ← fpk (r)s; return c Game G′ : (sk, pk) ← K(); (m0, m1) ← A1(pk); b $ ← {0, 1}; c⋆ ← Epk (mb); b′ ← A2(c⋆); return (b′ = b) Encryption Epk (m) : r $ ← {0, 1}ℓ; s $ ← {0, 1}k ; h ← s ⊕ m; c ← fpk (r)s; return c Game OW : (sk, pk) ← K(); y $ ← {0, 1}ℓ; y′ ← I(fpk (y)); return y = y′ Adversary I(x) : (m0, m1) ← A1(pk); s $ ← {0, 1}k ; c⋆ ← x s; b′ ← A2(c⋆); y′ ← [z∈LA

H |fpk (z)=x];

return y′

  • 1. For each hop

◮ prove validity of pRHL judgment ◮ derive probability claim(s)

  • 2. Obtain security bound by combining claims
  • 3. Check execution time of constructed adversary
slide-37
SLIDE 37

Conditional equivalence

Epk(m) : r

$

← {0, 1}ℓ; h ← H(r); s ← h ⊕ m; c ← fpk(r)s; return c Epk(m) : r

$

← {0, 1}ℓ; h

$

← {0, 1}k; s ← h ⊕ m; c ← fpk(r)s; return c

  • true
  • IND-CPA ∼ G
  • (¬r ∈ LA

H)2 → ≡

  • PrIND-CPA
  • b′ = b
  • − PrG
  • b′ = b
  • ≤ PrG
  • r ∈ LA

H

slide-38
SLIDE 38

Equivalence

Epk(m) : r

$

← {0, 1}ℓ; h

$

← {0, 1}k; s ← h ⊕ m; c ← fpk(r)s; return c Epk(m) : r

$

← {0, 1}ℓ; s

$

← {0, 1}k; h ← s ⊕ m; c ← fpk(r)s; return c

  • true
  • G ∼ G′

  • PrG
  • r ∈ LA

H

  • = PrG′
  • r ∈ LA

H

  • PrG[b′ = b] = PrG′[b′ = b] = 1

2

slide-39
SLIDE 39

Equivalence

Epk(m) : r

$

← {0, 1}ℓ; h

$

← {0, 1}k; s ← h ⊕ m; c ← fpk(r)s; return c Epk(m) : r

$

← {0, 1}ℓ; s

$

← {0, 1}k; h ← s ⊕ m; c ← fpk(r)s; return c

  • true
  • G ∼ G′

  • PrIND-CPA[b′ = b] − 1

2

  • ≤ PrG′
  • r ∈ LA

H

slide-40
SLIDE 40

Reduction

Game INDCPA : (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b) Encryption Epk(m) : r

$

← {0, 1}ℓ; s

$

← {0, 1}k; c ← fpk(r)s; return c Game OW : (sk, pk) ← K(); y

$

← {0, 1}ℓ; y ′ ← I(fpk(y)); return y = y ′ Adversary I(x) : (m0, m1) ← A1(pk); b

$

← {0, 1}; s

$

← {0, 1}k; c⋆ ← x s; b′ ← A2(c⋆); y ′ ← [z ∈ LA

H | fpk(z) = x];

return y ′

  • true
  • G′ ∼ OW
  • (r ∈ LA

H)1 → (y′ = y)2

  • PrG′
  • r ∈ LA

H

  • ≤ PrOW(I)[y′ = y]
slide-41
SLIDE 41

Reduction

Game INDCPA : (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b) Encryption Epk(m) : r

$

← {0, 1}ℓ; s

$

← {0, 1}k; c ← fpk(r)s; return c Game OW : (sk, pk) ← K(); y

$

← {0, 1}ℓ; y ′ ← I(fpk(y)); return y = y ′ Adversary I(x) : (m0, m1) ← A1(pk); b

$

← {0, 1}; s

$

← {0, 1}k; c⋆ ← x s; b′ ← A2(c⋆); y ′ ← [z ∈ LA

H | fpk(z) = x];

return y ′

  • true
  • G′ ∼ OW
  • (r ∈ LA

H)1 → (y′ = y)2

  • PrIND-CPA(A)[b′ = b] − 1

2

  • ≤ PrOW(I)[y′ = y]
slide-42
SLIDE 42

Case studies

◮ Public-key encryption ◮ Signatures ◮ Hash function designs ◮ Block ciphers ◮ Zero-knowledge protocols ◮ Differential privacy ◮ (Computational) differential privacy ◮ Authenticated key exchange protocols

Compiler Approximate pRHL Compositionality

slide-43
SLIDE 43

Current directions

◮ Compositional proofs

One of the most vexing basic problems in computer security is the problem of secure composition. [...] We predict that secure composition will receive the increasing attention that it deserves. Boneh and Mitchell, 2012

◮ Real-world cryptography

Real-world crypto is breakable; is in fact being broken; is

  • ne of many ongoing disaster areas in security. Bernstein,

2013

◮ Synthesis of secure cryptographic schemes

Do cryptosystems reflect [...] the situations that are being catered for? Or are they accidents of history and personal background that may be obscuring fruitful developments? After Landin, 1966

slide-44
SLIDE 44

Real-world security of RSA-OAEP

1994 1996 Kocher 2001 Manger 2010 Strenzke ◮ plaintext is variable-sized: careless parsing leads to

padding oracle (Manger);

◮ RSA is permutation only on strict subset of the domain

considered (

  • 0..2k

): careless error handling leads to timing attacks;

◮ PKCS#1 prescribes some error messaging, rarely

considered in existing proofs.

slide-45
SLIDE 45

Proving “real-world” security of RSA-OAEP:

  • utline

◮ Adapt the OAEP security proof to a low-level model of the

RSA PKCS#1 v2.1 standard

◮ Consider an extended adversary model:

Control and access to low-level encodings of inputs and

  • utputs,

Oracles also return a leakage trace meant to model side-channels

◮ Extend and leverage CompCert’s semantic preservation

results to obtain a low-level, leakage-aware security result

  • n the compiled ASM code
slide-46
SLIDE 46

A Low-Level Model...

Decryption DOAEP(sk)(c) : (s, t) ← f−1

sk (c);

r ← t ⊕ H(s); if ([s ⊕ G(r)]k1=0k1) then {m ← [s ⊕ G(r)]k; } else {m ← ⊥; } return m Decryption DOAEP(sk)(res, c) : if (c ∈ MsgSpace(sk)) { (b0, s, t) ← f−1

sk (c);

h ← H(s); i ← 0; while (i < hLen + 1) { s[i] ← t[i] ⊕ h[i]; i ← i + 1; } g ← G(r); i ← 0; while (i < dbLen) { p[i] ← s[i] ⊕ g[i]; i ← i + 1; } l ← payload_length(p); if (b0 = 08 ∧ [p]hLen

l

= 0..01∧ [p]hLen = LHash) then {rc ← Success; memcpy(res, 0, p, dbLen − l, l); } else {rc ← DecryptionError; } } else {rc ← CiphertextTooLong; } return rc;

slide-47
SLIDE 47

...with Leakage

◮ Focus on Program Counter Security: adversary is given

the list of program points traversed while executing the

  • racle

◮ Leakage due to the computation of the permutation is kept

abstract

◮ Axioms formalize our leakage assumptions on their

implementation

◮ Security assumption (PDOW) is slightly adapted to deal

with abstract leakage

slide-48
SLIDE 48

CompCert and PC Security

◮ CompCert guarantees that traces of events are preserved

by compilation;

◮ Events are calls to the environment (system calls, random

sampling, hashing, key generation), and branching decisions (each basic block starts with an event)

◮ Extend the CompCert run-time with a formally specified,

trusted Multi-Precision Integer Arithmetic library, assumed to satisfy “good enough” leakage resistance

◮ Syntactic check on final ASM code guarantees that the

final annotations are sufficient.

slide-49
SLIDE 49

Perspectives on real-world security

Still a model.

◮ Adversary and execution models are still somewhat

idealized

◮ Not clear how to prove memory obliviousness ◮ Consider more active side-channels (fault injection ...) ◮ Prove security in a virtualized environment

slide-50
SLIDE 50

The next 700 cryptosystems: ZooCrypt

◮ generate all schemes up to user-defined constraints ◮ automatically prove security, or existence of an attack, by

combining the two views of cryptography Using symbolic methods for

◮ Finding attacks ◮ Synthesis of decryption algorithm ◮ In proof system for

Computing symbolic entropy Finding symbolic reduction

slide-51
SLIDE 51

Minimality in cryptography

◮ OAEP (1994):

f((m0) ⊕ G(r) r ⊕ H((m0) ⊕ G(r))) not that Optimal; needs redundancy

◮ SAEP (2001):

f(r (m0) ⊕ G(r)) tighter reduction; needs redundancy

◮ ZAEP:

f(r | | m ⊕ G(r)) tighter reduction, bit-optimal, redundancy-free

slide-52
SLIDE 52

Conclusion

Cryptography is

◮ a thriving research area at the crossroads of many fields ◮ a great source of challenging problems ◮ an exciting opportunity to apply PL and PV techniques ◮ Visit http://www.easycrypt.info ◮ Download EasyCrypt ◮ Attend first School and Workshop, July 16-19, 2013