Complexity of automatic verification of cryptographic protocols - - PowerPoint PPT Presentation

complexity of automatic verification of cryptographic
SMART_READER_LITE
LIVE PREVIEW

Complexity of automatic verification of cryptographic protocols - - PowerPoint PPT Presentation

Complexity of automatic verification of cryptographic protocols Clermont Ferrand 02/02/2017 Vincent Cheval Equipe Pesto, INRIA, Nancy 1 Cryptographic protocols Communication on public network Cryptographic protocols: Concurrent programs


slide-1
SLIDE 1

Clermont Ferrand 02/02/2017

1

Complexity of automatic verification of cryptographic protocols

Vincent Cheval Equipe Pesto, INRIA, Nancy

slide-2
SLIDE 2

/ 29

Cryptographic protocols

2

Communication on public network

Cryptographic protocols:

  • Concurrent programs designed to secure communications
  • Rely on cryptographic primitives
slide-3
SLIDE 3

/ 29 3

Context

The protocol: Honest participants

slide-4
SLIDE 4

/ 29

Intruder Controls the network

3

Context

The protocol: Honest participants

slide-5
SLIDE 5

/ 29

Intruder Controls the network

3

Context

The protocol: Honest participants Security properties

slide-6
SLIDE 6

/ 29

On the web

4

Protocol HTTPS

  • Password based authentication
  • Confidentiality of personal data
slide-7
SLIDE 7

/ 29

Payment with credit card

5

  • Authorization through PIN code
  • Wireless payment
  • Confidentiality of the transaction
  • Authenticity of the bank card
slide-8
SLIDE 8

/ 29

Electronic passport

6

  • RFID chip inside the passport
  • Secret key printed on the passport
  • Confidentiality of personal data
  • Anonymity
  • Untraceability
slide-9
SLIDE 9

/ 29

Electronic voting

7

  • Vote from personal computer
  • Vote from dedicated machines
  • Verifiability of the votes
  • Confidentiality of the vote
  • No partial results
  • One vote per voter
  • Anonymity of the voter
  • Coercition resistance
slide-10
SLIDE 10

/ 29

Attacks

8

Designing a secure protocol is hard !

Concrete attacks on:

  • authentication used by Google Apps
  • unlinkability of french passports
  • authentication of credit card (Yes-Card)
  • vote privacy on the Helios e-voting system
  • anonymity of routing protocols

These attacks are the consequence of a bad design and not of a:

  • implementation bug
  • weak cryptographic primitives
  • usage of magical hacking techniques
slide-11
SLIDE 11

/ 29

Existing models

9

Cryptographic model Symbolic model

slide-12
SLIDE 12

/ 29

Existing models

9

Cryptographic model Symbolic model

Messages

Bitstring

slide-13
SLIDE 13

/ 29

Existing models

9

Cryptographic model Symbolic model

Messages

Bitstring

Cryptographic primitives

Real algorithms

slide-14
SLIDE 14

/ 29

Existing models

9

Cryptographic model Symbolic model

Messages

Bitstring Function symbols

Cryptographic primitives

Real algorithms

slide-15
SLIDE 15

/ 29

Existing models

9

Cryptographic model Symbolic model

Terms

Messages

Bitstring Function symbols

Cryptographic primitives

Real algorithms

slide-16
SLIDE 16

/ 29

Existing models

9

Cryptographic model Symbolic model

Terms

Messages

Bitstring Function symbols

Cryptographic primitives

Real algorithms Idealized

Attacker

PPT

slide-17
SLIDE 17

/ 29

Existing models

9

Cryptographic model Symbolic model

Terms

Messages

Bitstring Function symbols

Cryptographic primitives

Real algorithms Idealized

Attacker

PPT "Easier" and mechanized

Proofs

Difficult and by hand

slide-18
SLIDE 18

/ 29

Existing models

9

Cryptographic model Symbolic model

Terms

Messages

Bitstring Function symbols

Cryptographic primitives

Real algorithms Idealized

Attacker

PPT "Easier" and mechanized

Proofs

Difficult and by hand Unclear

Security guarantees

Strong and clear

slide-19
SLIDE 19

/ 29

Symbolic models

10

Symbolic terms enc(x, y) hx, yi x y enc h i x y a ⊕ x x, y, z, . . . a, b, c, . . .

Nonces: Variables: Functions symbols: enc, dec, h i, , . . .

slide-20
SLIDE 20

/ 29

Symbolic models

10

Symbolic terms enc(x, y) hx, yi x y enc h i x y a ⊕ x dec(enc(x, y), y) → x Rewrite rules proj1(hx, yi) ! x x, y, z, . . . a, b, c, . . .

Nonces: Variables: Functions symbols: enc, dec, h i, , . . .

slide-21
SLIDE 21

/ 29

Symbolic models

10

Symbolic terms enc(x, y) hx, yi x y enc h i x y a ⊕ x dec(enc(hm1, m2i, k), k) ! hm1, m2i Example: dec(enc(x, y), y) → x Rewrite rules proj1(hx, yi) ! x x, y, z, . . . a, b, c, . . .

Nonces: Variables: Functions symbols: enc, dec, h i, , . . .

slide-22
SLIDE 22

/ 29

Symbolic models

10

Symbolic terms enc(x, y) hx, yi x y enc h i x y a ⊕ x dec(enc(hm1, m2i, k), k) ! hm1, m2i Example: dec(enc(x, y), y) → x Rewrite rules proj1(hx, yi) ! x x, y, z, . . . a, b, c, . . .

Nonces: Variables: Functions symbols: enc, dec, h i, , . . .

Subterm convergent

unblind(sign(blind(x, y), z), y) → sign(x, z)

Monadic convergent

slide-23
SLIDE 23

/ 29

Symbolic models

11

Example : Electronic passport

Passeport Reader

nT enc(hnR, nT , kRi, ke) enc(hnT , nR, kT i, ke)

Knows ke Knows ke

slide-24
SLIDE 24

/ 29

Symbolic models

11

Example : Electronic passport

Passeport Reader

nT

Freshly generated by Passport

enc(hnR, nT , kRi, ke) enc(hnT , nR, kT i, ke)

Knows ke Knows ke

slide-25
SLIDE 25

/ 29

Symbolic models

11

Example : Electronic passport

Passeport Reader

nT

Freshly generated by Passport

enc(hnR, nT , kRi, ke) enc(hnT , nR, kT i, ke)

Knows ke Knows ke Reader expects a nonce and returns it

slide-26
SLIDE 26

/ 29

Symbolic models

11

Example : Electronic passport

Passeport Reader

nT

Freshly generated by Passport

enc(hnR, nT , kRi, ke) enc(hnT , nR, kT i, ke)

Knows ke Knows ke Reader expects a nonce and returns it Freshly generated by Reader

slide-27
SLIDE 27

/ 29

Symbolic models

11

Example : Electronic passport

Passeport Reader

nT enc(hnR, nT , kRi, ke) enc(hnT , nR, kT i, ke)

Knows ke Knows ke

Knowledge of intruder: nonces he can generate + nT enc(hnR, nT , kRi, ke) enc(hnT , nR, kT i, ke)

1: 2: 3:

slide-28
SLIDE 28

/ 29

Symbolic models

12

Another trace of the Electronic passport

Passeport Reader

nT

Knows ke Knows ke

KO enc(hnR, KO, kRi, ke) Error Knowledge of intruder: nonces he can generate (e.g. ) + nT

1: 2: 3:

KO enc(hnR, KO, kRi, ke) Error

slide-29
SLIDE 29

/ 29 13

Applied pi calculus

Nil P + Q Non deterministic choice P | Q Parallel if u = v then P else Q Test in(c, x).P Input

  • ut(c, u).P

Output νk.P Name restriction !P Replication

slide-30
SLIDE 30

/ 29 14

Applied pi calculus

Passeport Reader

nT enc(hnR, nT , kRi, ke) enc(hnT , nR, kT i, ke)

Knows ke Knows ke

P(ke) = νnT .out(c, nT ).in(c, x). if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error) !νke!P(ke) | R(ke) Main process:

slide-31
SLIDE 31

/ 29 15

Trace

P(ke) = νnT .out(c, nT ).in(c, x). if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error)

A trace = one execution of the process

(∅, νke.P(ke), id) Initial configuration:

Set of private names The process Substitution representing the knowledge of the attacker

slide-32
SLIDE 32

/ 29 16

Trace

P(ke) = νnT .out(c, nT ).in(c, x). if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error) (∅, νke.P(ke), id) w1

slide-33
SLIDE 33

/ 29 16

Trace

P(ke) = νnT .out(c, nT ).in(c, x). if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error) (∅, νke.P(ke), id) ({ke}, P(ke), id) w1

slide-34
SLIDE 34

/ 29 16

Trace

(∅, νke.P(ke), id) ({ke}, P(ke), id) ({ke, nT }, P1, id) P1 =

  • ut(c, nT ).in(c, x).

if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error) w1

slide-35
SLIDE 35

/ 29 16

Trace

(∅, νke.P(ke), id) ({ke}, P(ke), id) ({ke, nT }, P1, id) P2 = in(c, x). if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error)

  • ut(c, w1)

({ke, nT }, P2, {nT /w1}) w1

slide-36
SLIDE 36

/ 29 16

Trace

(∅, νke.P(ke), id) ({ke}, P(ke), id) ({ke, nT }, P1, id) P2 = in(c, x). if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error)

  • ut(c, w1)

({ke, nT }, P2, {nT /w1})

in(c, M)

w1

slide-37
SLIDE 37

/ 29 16

Trace

(∅, νke.P(ke), id) ({ke}, P(ke), id) ({ke, nT }, P1, id) P2 = in(c, x). if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error)

  • ut(c, w1)

({ke, nT }, P2, {nT /w1})

in(c, M)

Cannot contain private names

w1

slide-38
SLIDE 38

/ 29 16

Trace

(∅, νke.P(ke), id) ({ke}, P(ke), id) ({ke, nT }, P1, id) P2 = in(c, x). if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error)

  • ut(c, w1)

({ke, nT }, P2, {nT /w1})

in(c, M)

Cannot contain private names Can contain variables from the frame, i.e.w1

slide-39
SLIDE 39

/ 29 16

Trace

(∅, νke.P(ke), id) ({ke}, P(ke), id) ({ke, nT }, P1, id) P2 = in(c, x). if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error)

  • ut(c, w1)

({ke, nT }, P2, {nT /w1})

in(c, M)

Cannot contain private names Can contain variables from the frame, i.e.w1

M = hnI, w1i Ex:

slide-40
SLIDE 40

/ 29 16

Trace

(∅, νke.P(ke), id) ({ke}, P(ke), id) ({ke, nT }, P1, id) P2 = in(c, x). if proj3(dec(x, ke)) = nT then νkT .out(c, hnT , proj1(dec(x, ke)), kT i) else out(c, Error)

  • ut(c, w1)

({ke, nT }, P2, {nT /w1})

in(c, M)

Cannot contain private names Can contain variables from the frame, i.e.w1

M = hnI, w1i Ex: x ! hnI, nT i

slide-41
SLIDE 41

/ 29 16

Trace

(∅, νke.P(ke), id) ({ke}, P(ke), id) ({ke, nT }, P1, id)

  • ut(c, w1)

({ke, nT }, P2, {nT /w1})

in(c, M)

Cannot contain private names Can contain variables from the frame, i.e.w1

M = hnI, w1i Ex: x ! hnI, nT i P3 = if proj3(dec(hnI, nT i, ke)) = nT then νkT .out(c, hnT , proj1(dec(hnI, nT i, ke)), kT i) else out(c, Error) ({ke, nT }, P3, {nT /w1})

slide-42
SLIDE 42

/ 29 16

Trace

(∅, νke.P(ke), id) ({ke}, P(ke), id) ({ke, nT }, P1, id)

  • ut(c, w1)

({ke, nT }, P2, {nT /w1})

in(c, M)

w1 P3 = if proj3(dec(hnI, nT i, ke)) = nT then νkT .out(c, hnT , proj1(dec(hnI, nT i, ke)), kT i) else out(c, Error) ({ke, nT }, P3, {nT /w1})

The sequence of label with the set and the frame represents a trace.

  • ut(c, w1).in(c, M)

{ke, nT }

{nT /w1}

slide-43
SLIDE 43

/ 29 17

Internal communication

Communication can happen internally

  • n private channels

({d}, in(d, x).P | out(d, a).Q, Φ) ({d}, P{a/x} | Q, Φ)

slide-44
SLIDE 44

/ 29

Security properties

18

  • What we verify well : Confidentiality, authenticity

Equivalence properties Trace properties

  • What we don’t verify well : Anonymity, privacy, traceability, properties


for electronic voting

Tools : Avispa, ProVerif, Scyther, CSP/FdR… Tools : ProVerif, AkiSs, SPEC, APTE

slide-45
SLIDE 45

/ 29

Trace equivalence

19

Untraceability of electronic passport

Situation 1 Situation 2

slide-46
SLIDE 46

/ 29

Trace equivalence

19

Untraceability of electronic passport

Situation 1 Situation 2

slide-47
SLIDE 47

/ 29

Trace equivalence

19

Untraceability of electronic passport

Situation 1 Situation 2 Two protocols are in equivalence if for all traces of one of the protocol, we can find an equivalent trace in the other protocol

slide-48
SLIDE 48

/ 29

Trace equivalence

19

Untraceability of electronic passport

Situation 1 Situation 2 Two protocols are in equivalence if for all traces of one of the protocol, we can find an equivalent trace in the other protocol Knowledges of the attacker obtain in two traces with similar actions

M1, M2, . . . , Mk N1, N2, . . . , Nk

slide-49
SLIDE 49

/ 29

Decision procedure

20

How to automatically decide equivalence ?

  • General problem: Undecidable
  • Usual restrictions: Bounded number of sessions,

stronger notion of equivalence, simple algebraic properties for the cryptographic properties,…

  • Technics used : Saturation of Horn Clauses, Constraint

solving, Equivalence of constraint systems

slide-50
SLIDE 50

/ 29

Decision procedure

21

How difficult is it to automatically decide equivalence ?

  • P : Decidable by a deterministic Turing machine in polynomial time
  • EXP : Decidable by a deterministic Turing machine in exponential time
  • NP : Decidable by a non-deterministic Turing machine in polynomial time
  • NEXP : Decidable by a non-deterministic Turing machine in exponential time
  • PSPACE : Decidable by a deterministic Turing machine in polynomial space
  • Σ0 = P and Σi = NPΣi-1
  • Σ1 = NP
slide-51
SLIDE 51

/ 29

Complexity

22

Applied Pi Calculus Static equivalence Trace equivalence Observational equivalence Diff equivalence Positive, finite, subterm convergent P complete [AC’04] Decidable ? CoNP complete Finite, subterm convergent P complete [AC’04] Decidable ? ? Finite, monadic convergent P hard ? ? ?

slide-52
SLIDE 52

/ 29

Complexity Results

23

Applied Pi Calculus Static equivalence Trace equivalence Observational equivalence Diff equivalence Positive, finite, subterm convergent P complete [AC’04] Decidable [CK’17] coNEXP hard CoNP complete Finite, subterm convergent P complete [AC’04] Decidable [CK’17] coNEXP hard coNEXP hard ? Finite, monadic convergent P hard coNEXP hard coNEXP hard ? Pure Pi Calculus Static equivalence Trace equivalence Observational equivalence Positive, finite LOGSPACE coΣ2 complete PSPACE easy coΣ4 hard Finite LOGSPACE coΣ2 complete PSPACE easy coΣ4 hard

slide-53
SLIDE 53

/ 29

Complexity Results

24

Applied Pi Calculus Static equivalence Trace equivalence Observational equivalence Diff equivalence Positive, finite, subterm convergent PTIME complete [AC’04] Decidable [CK’17] coNEXP easy ? coNEXP hard coNEXP complete ? CoNP complete Finite, subterm convergent PTIME complete [AC’04] Decidable [CK’17] coNEXP hard coNEXP complete ? coNEXP hard coNEXP complete ? coNP complete ? Finite, monadic convergent PTIME hard coNEXP hard coNEXP hard ? Pure Pi Calculus Static equivalence Trace equivalence Observational equivalence Positive, finite LOGSPACE coΣ2 complete PSPACE easy coΣ4 hard Finite LOGSPACE coΣ2 complete PSPACE easy coΣ4 hard

slide-54
SLIDE 54

/ 29

Trace equivalence in pi-calculus

25

Reduction from QSAT2

A 6⇡tr B iff 9~ x 8~ y, '(~ x, ~ y) = 1 ∃~ x = ∃x1∃x2 . . . ∃xn ∀~ y = ∀y1∀y2 . . . ∀ym

No else branche, no cryptographic primitive

slide-55
SLIDE 55

/ 29

Boolean formula in pi-calculus

26

c3 c1 c2

slide-56
SLIDE 56

/ 29

Boolean formula in pi-calculus

26

c3 c1 c2

in(c1, x).in(c2, y).( if x = 1 then if y = 1 then out(c3, 1) | if x = 1 then if y = 0 then out(c3, 0) | if x = 0 then if y = 0 then out(c3, 0) | if x = 0 then if y = 0 then out(c3, 0) )

slide-57
SLIDE 57

/ 29

Boolean formula in pi-calculus

26

c3 c1 c2

in(c1, x).in(c2, y).( if x = 1 then if y = 1 then out(c3, 1) | if x = 1 then if y = 0 then out(c3, 0) | if x = 0 then if y = 0 then out(c3, 0) | if x = 0 then if y = 0 then out(c3, 0) )

Enforces that inputs are booleans !

slide-58
SLIDE 58

/ 29

Boolean formula in pi-calculus

26

in(c1, x) in(c2, y)

  • ut(c3, x ∧ y)

c3 c1 c2

in(c1, x).in(c2, y).( if x = 1 then if y = 1 then out(c3, 1) | if x = 1 then if y = 0 then out(c3, 0) | if x = 0 then if y = 0 then out(c3, 0) | if x = 0 then if y = 0 then out(c3, 0) )

slide-59
SLIDE 59

/ 29

Boolean formula in pi-calculus

27

∧ ∨ ¬

c1 c2 c3 c4 c5 c6

slide-60
SLIDE 60

/ 29

Boolean formula in pi-calculus

27

inp

| | | |

P(x)

in(c1, x) in(c2, y)

  • ut(c4, x ∧ y)

in(c3, x)

  • ut(c5, ¬x)

in(c4, x) in(c5, y)

  • ut(c6, x ∨ y)
  • ut(c1, b1)
  • ut(c2, b2)
  • u

t ( c3 , b3 ) in(c6, x)

∧ ∨ ¬

c1 c2 c3 c4 c5 c6

slide-61
SLIDE 61

/ 29

Boolean formula in pi-calculus

27

Enforces that inputs are booleans !

inp

| | | |

P(x)

in(c1, x) in(c2, y)

  • ut(c4, x ∧ y)

in(c3, x)

  • ut(c5, ¬x)

in(c4, x) in(c5, y)

  • ut(c6, x ∨ y)
  • ut(c1, b1)
  • ut(c2, b2)
  • u

t ( c3 , b3 ) in(c6, x)

∧ ∨ ¬

c1 c2 c3 c4 c5 c6

slide-62
SLIDE 62

/ 29

Boolean formula in pi-calculus

27

Enforces that inputs are booleans !

x ← ϕ(b1, b2, b3).P(x)

inp

| | | |

P(x)

in(c1, x) in(c2, y)

  • ut(c4, x ∧ y)

in(c3, x)

  • ut(c5, ¬x)

in(c4, x) in(c5, y)

  • ut(c6, x ∨ y)
  • ut(c1, b1)
  • ut(c2, b2)
  • u

t ( c3 , b3 ) in(c6, x)

∧ ∨ ¬

c1 c2 c3 c4 c5 c6

slide-63
SLIDE 63

/ 29

Universal quantification

28

A 6⇡tr B iff 9~ x 8~ y, '(~ x, ~ y) = 1

How to express universality in pi-calculus ?

slide-64
SLIDE 64

/ 29

Universal quantification

28

A 6⇡tr B iff 9~ x 8~ y, '(~ x, ~ y) = 1

How to express universality in pi-calculus ?

Guess(y).P

def

= νd. ((out(d, 0) + out(d, 1) | in(d, y).P)

slide-65
SLIDE 65

/ 29

Universal quantification

28

A 6⇡tr B iff 9~ x 8~ y, '(~ x, ~ y) = 1

How to express universality in pi-calculus ?

P{0/y} P{1/y} Can reduce in either

  • r

Guess(y).P

def

= νd. ((out(d, 0) + out(d, 1) | in(d, y).P)

slide-66
SLIDE 66

/ 29

Reduction

29

A 6⇡tr B iff 9~ x 8~ y, '(~ x, ~ y) = 1

A

def

= in(c, ~ x). test ← ^ ~ x. B

def

= in(c, ~ x). test ← ^ ~ x. Guess(~ y).

  • ut(c, 0) + out(c, 1)

(v ← '(~ x, ~ y). out(c, v) + out(c, 1))

slide-67
SLIDE 67

/ 29

Reduction

29

A 6⇡tr B iff 9~ x 8~ y, '(~ x, ~ y) = 1

The processes can only output if the inputs are booleans

A

def

= in(c, ~ x). test ← ^ ~ x. B

def

= in(c, ~ x). test ← ^ ~ x. Guess(~ y).

  • ut(c, 0) + out(c, 1)

(v ← '(~ x, ~ y). out(c, v) + out(c, 1))

slide-68
SLIDE 68

/ 29

Reduction

29

A 6⇡tr B iff 9~ x 8~ y, '(~ x, ~ y) = 1

The processes can only output if the inputs are booleans Whatever the boolean input, the process B can always output 0 or 1

A

def

= in(c, ~ x). test ← ^ ~ x. B

def

= in(c, ~ x). test ← ^ ~ x. Guess(~ y).

  • ut(c, 0) + out(c, 1)

(v ← '(~ x, ~ y). out(c, v) + out(c, 1))

slide-69
SLIDE 69

/ 29

Reduction

29

A 6⇡tr B iff 9~ x 8~ y, '(~ x, ~ y) = 1

The processes can only output if the inputs are booleans Whatever the boolean input, the process B can always output 0 or 1

A

def

= in(c, ~ x). test ← ^ ~ x. B

def

= in(c, ~ x). test ← ^ ~ x. Guess(~ y).

  • ut(c, 0) + out(c, 1)

(v ← '(~ x, ~ y). out(c, v) + out(c, 1))

If holds then A can never output 0 when is input

∀~ y.'(~ x0, ~ y) = 1

~ x0