Computer-aided cryptographic proofs Gilles Barthe MPI-SP , Germany - - PowerPoint PPT Presentation

computer aided cryptographic proofs
SMART_READER_LITE
LIVE PREVIEW

Computer-aided cryptographic proofs Gilles Barthe MPI-SP , Germany - - PowerPoint PPT Presentation

Computer-aided cryptographic proofs Gilles Barthe MPI-SP , Germany IMDEA Software Institute, Spain Computer-aided cryptography Develop tool-assisted methodologies for helping the design, analysis, and implementation of cryptographic


slide-1
SLIDE 1

Computer-aided cryptographic proofs

Gilles Barthe MPI-SP , Germany IMDEA Software Institute, Spain

slide-2
SLIDE 2

Computer-aided cryptography

Develop tool-assisted methodologies for helping the design, analysis, and implementation of cryptographic constructions (primitives and protocols) Goals: ◮ Automated analysis of (symbolic or computational) security ◮ Independently verifiable proofs of (computational) security ◮ Verified implementations ◮ New designs and better implementations ◮ etc Building on formal methods ◮ program analysis and verification/program synthesis ◮ compilation (certifying compilation/verified compilation) ◮ logic ◮ etc

slide-3
SLIDE 3

Potential benefits

Formal methods for cryptography ◮ higher assurance ◮ smaller gap between provable security and crypto engineering ◮ new proof techniques Cryptography for formal methods ◮ Challenging and non-standard examples ◮ New theories and applications

slide-4
SLIDE 4

Challenges

◮ requirements: probabilistic guarantees, adversaries ◮ analysis: composition of two secure systems need not be secure, lack of proof methods for individual components, proofs are overly complex when methods exist ◮ implementation and deployment: security not preserved by refinement, legacy, standardization, side-channels

slide-5
SLIDE 5

Modern cryptography

Shannon ’49 Diffie & Hellman ’76 Goldwasser & Micali’82 Yao’82 Bellare & Rogaway ’94

  • Mathematical proof of security
  • Perfect secrecy is impossible
  • Computational security
  • Asymptotic guarantees

PPT adversary has negligible advantage

  • Concrete bounds

Adversary advantage to win in time t is ≤ p

slide-6
SLIDE 6

Reductionist proof

Scheme Primitive

Generic construction

Attack Attack

Black-box reduction

slide-7
SLIDE 7

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-8
SLIDE 8

Indistinguishability

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

$

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

slide-9
SLIDE 9

Indistinguishability

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

$

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

slide-10
SLIDE 10

Indistinguishability

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

$

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

m0 m1

slide-11
SLIDE 11

Indistinguishability

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

$

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

m0 m1 $ b

slide-12
SLIDE 12

Indistinguishability

Game INDCPA(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-13
SLIDE 13

Indistinguishability

Game INDCPA(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-14
SLIDE 14

Indistinguishability

Game INDCPA(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-15
SLIDE 15

Indistinguishability

Game INDCPA(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-16
SLIDE 16

Indistinguishability

Game INDCPA(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-17
SLIDE 17

Indistinguishability

Game INDCPA(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′

?

=

  • PrINDCPA(A)
  • b′ = b
  • − 1

2

  • small
slide-18
SLIDE 18

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-19
SLIDE 19

One-way trapdoor permutations

Game OW(I) (sk, pk) ← K(); y

$

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

slide-20
SLIDE 20

One-way trapdoor permutations

Game OW(I) (sk, pk) ← K(); y

$

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

$

y

slide-21
SLIDE 21

One-way trapdoor permutations

Game OW(I) (sk, pk) ← K(); y

$

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

$

y fpk x⋆

slide-22
SLIDE 22

One-way trapdoor permutations

Game OW(I) (sk, pk) ← K(); y

$

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

$

y fpk x⋆ x⋆

slide-23
SLIDE 23

One-way trapdoor permutations

Game OW(I) (sk, pk) ← K(); y

$

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

$

y fpk x⋆ x⋆ y ′

slide-24
SLIDE 24

One-way trapdoor permutations

Game OW(I) (sk, pk) ← K(); y

$

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

$

y fpk x⋆ x⋆ y ′

?

=

slide-25
SLIDE 25

One-way trapdoor permutations

Game OW(I) (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-26
SLIDE 26

Optimal Asymmetric Encryption Padding

Encryption EOAEP(pk)(m) : r

$

← {0, 1}k0; s ← G(r) ⊕ (m0k1); t ← H(s) ⊕ r; return fpk(st) Oracle H(x) : if x / ∈ L then r

$

← {0, 1}k; L ← (x, r) :: L; return L[x]; 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 elsem ← ⊥; return m ⊕ exclusive or concatenation [·] projection 0 zero bitstring

slide-27
SLIDE 27

OAEP: provable security

Game INDCCA(A) (sk, pk) ← K(); (m0, m1) ← A1(pk); b

$

← {0, 1}; c⋆ ← Epk(mb); b′ ← A2(c⋆); return (b′ = b) Game SPDOW(I) (sk, pk) ← K(); y

$

← {0, 1}k2; z

$

← {0, 1}k3; x⋆ ← fpk(y z); Y ′ ← I(x⋆); return (y ∈ Y ′) FOR ALL IND-CCA adversary A against (K, EOAEP, DOAEP), THERE EXISTS a SPDOW adversary I against (K, f, f−1) st

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

2

PrSPDOW(I)[y ∈ Y ′] + 3qDqG+q2

D+4qD+qG

2k0

+ 2qD

2k1

and tI ≤ tA + qD qG qH Tf

slide-28
SLIDE 28

OAEP: provable security

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-29
SLIDE 29

Example: Bellare and Rogaway 1993 encryption

Game INDCPA(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 adversary A, there exists an inverter I st

  • PrINDCPA(A)
  • b′ = b
  • − 1

2

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

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|fpk (z)=x]; returny′

  • 1. For each hop

◮ prove validity of pRHL judgment ◮ derive probability claims ◮ (possibly) resolve some probability expressions using pHL

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

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 {⊤} INDCPA ∼ G

  • (¬r ∈ LA)2 → =b,b′
  • PrINDCPA
  • b′ = b
  • − PrG
  • b′ = b
  • ≤ PrG[r ∈ LA]
slide-32
SLIDE 32

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 {⊤} G ∼ G′ =b,b′,r,A

  • PrG[r ∈ LA] = PrG′[r ∈ LA]

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

2

slide-33
SLIDE 33

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 {⊤} G ∼ G′ =b,b′,r,A

  • PrINDCPA[b′ = b] − 1

2

  • ≤ PrG′[r ∈ LA]
slide-34
SLIDE 34

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 | fpk(z) = x]; returny ′

{⊤} G′ ∼ OW

  • (r ∈ LA)1 → (y′ = y)2
  • PrG′[r ∈ LA] ≤ PrOW(I)[y′ = y]
slide-35
SLIDE 35

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 | fpk(z) = x]; returny ′

{⊤} G′ ∼ OW

  • (r ∈ LA)1 → (y′ = y)2
  • PrINDCPA (A)[b′ = b] − 1

2

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

Automated proofs

f((m0) ⊕ G(r) r ⊕ H((m0) ⊕ G(r))) ◮ Hard to get security proofs right ◮ 6 months to formalize the proof! ◮ Many variants in the literature ◮ About 200 variants of SAEP/OAEP (Komano and Ohta) ◮ About 106 − 108 candidates schemes of “reasonable” size ◮ Can we automate analysis for finding attacks or proofs?

slide-37
SLIDE 37

ZooCrypt

◮ Extremely efficient logics for CPA and CCA security (up-to-bad, optimistic sampling, reduction, reject some ciphertexts) ◮ Extremely efficient procedures for detecting attacks ◮ Smart generation of candidate constructions

Experiments

◮ Generated 1,000,000 candidates ◮ For CPA security: 99,5% solved by the tool ◮ For CCA security: 80% solved by tool ◮ Practical interpretation (sql database) ◮ Manual inspection for grey zone ◮ Interactive tutor

slide-38
SLIDE 38

ZAEP

◮ OAEP (1994): f((m0) ⊕ G(r) r ⊕ H((m0) ⊕ G(r))) ◮ SAEP (2001): f(r (m0) ⊕ G(r)) ◮ ZAEP (2012): f(r | | m ⊕ G(r)) ☞ redundancy-free ☞ INDCCA secure for RSA with exponent 2 and 3

slide-39
SLIDE 39

Other automated tools

◮ Auto G&P: pairing-based crypto ◮ GGA: pairing-based crypto ◮ AutoLWE: lattice-based crypto ◮ Blockciphers Need general purpose tools

slide-40
SLIDE 40

EasyCrypt

Domain-specific proof assistant ◮ proof goals tailored to reductionist proofs ◮ proof tools support common proof techniques (bridging steps, failure events, hybrid arguments, eager sampling. . . ) Control and automation from state-of-art verification ◮ interactive proof engine and mathematical libraries (a la Coq/ssreflect) ◮ back-end to SMT solvers Many case studies: ◮ Encryption, signatures, key exchange, zero-knowledge, multi-party and verifiable computation, SHA3, voting, KMS

slide-41
SLIDE 41

probabilistic relational Hoare logic

◮ Code-based approach 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 ← F(E, . . . , E) procedure (oracle/adv) call ◮ Game-playing technique: {P} c1 ∼ c2 {Q} where P and Q are relations on states Let µ1, µ2 ∈ Dist(A) and R ⊆ A × A. Let µ ∈ Dist(A × A). ◮ µ is a coupling for (µ1, µ2) iff π1(µ) = µ1 and π2(µ) = µ2 ◮ µ is a R-coupling for (µ1, µ2) if moreover Pry←µ[y ∈ R] = 0

slide-42
SLIDE 42

Verified implementations

◮ FOR EVERY adversary that breaks assembly code, ◮ IF assembly code is safe and leakage resistent, ◮ AND assembly code correctly implements algorithm, ◮ THERE EXISTS an adversary that breaks the algorithm

slide-43
SLIDE 43

Summary

Foundations and tools for high-assurance cryptography ◮ Provable security ◮ Practical cryptography ◮ Reducing the gap between security proofs and implementations Methods apply to ◮ Differential privacy ◮ Machine Learning