• Aucun résultat trouvé

Security Models Lecture 4 Active Intruder

N/A
N/A
Protected

Academic year: 2022

Partager "Security Models Lecture 4 Active Intruder"

Copied!
89
0
0

Texte intégral

(1)

Security Models Lecture 4 Active Intruder

Security Models Lecture 4 Active Intruder

Pascal Lafourcade

2020-2021

(2)

Security Models Lecture 4 Active Intruder

Outline of Today

1 Unification Notions Terms and Messages Unification

2 Active Intruder: Security Problem 3 Bounded Number of Sessions

4 NP-Hardness for Bounded Number of Sessions 5 Conclusion

(3)

Security Models Lecture 4 Active Intruder

Outline of Today

1 Unification Notions Terms and Messages Unification

2 Active Intruder: Security Problem

3 Bounded Number of Sessions

4 NP-Hardness for Bounded Number of Sessions 5 Conclusion

(4)

Security Models Lecture 4 Active Intruder

Outline of Today

1 Unification Notions Terms and Messages Unification

2 Active Intruder: Security Problem 3 Bounded Number of Sessions

4 NP-Hardness for Bounded Number of Sessions 5 Conclusion

(5)

Security Models Lecture 4 Active Intruder

Outline of Today

1 Unification Notions Terms and Messages Unification

2 Active Intruder: Security Problem 3 Bounded Number of Sessions

4 NP-Hardness for Bounded Number of Sessions

5 Conclusion

(6)

Security Models Lecture 4 Active Intruder

Outline of Today

1 Unification Notions Terms and Messages Unification

2 Active Intruder: Security Problem 3 Bounded Number of Sessions

4 NP-Hardness for Bounded Number of Sessions 5 Conclusion

(7)

Security Models Lecture 4 Active Intruder Unification Notions

Outline

1 Unification Notions Terms and Messages Unification

2 Active Intruder: Security Problem 3 Bounded Number of Sessions

4 NP-Hardness for Bounded Number of Sessions 5 Conclusion

(8)

Security Models Lecture 4 Active Intruder Unification Notions

Terms and Messages

Arity

Definition

• F is a finite set

• Arity is a mapping fromF into N

• (F,Arity) is a ranked alphabet orsignature denoted Σ

• The arityof a symbolf ∈ F is Arity(f)

• The set of symbols of arity p is denoted byFp.

• Elements of arity 0, 1, . . .p are respectively called constants, unary, . . .p-ary symbols.

(9)

Security Models Lecture 4 Active Intruder Unification Notions

Terms and Messages

Example

Example

LetF ={enc,pair,k1,k2,0,1}

Arity(enc) =Arity(pair) = 2

Arity(k1) =Arity(k2) =Arity(0) =Arity(1) = 0

We also denoteF ={enc/2,pair/2,k1/0,k2/0,0/0,1/0}

(10)

Security Models Lecture 4 Active Intruder Unification Notions

Terms and Messages

Terms

LetX be a set of symbols calledvariables.

Definition

The setT(F,X) oftermsover the ranked alphabet F and the set of variablesX is the smallest set defined by:

- F0 ⊆ T(F,X) - X ⊆ T(F,X)

- ifp ≥1,f ∈ Fpandt1, . . . ,tp ∈ T(F,X), thenf(t1, . . . ,tp)∈ T(F,X).

• IfX =∅ thenT(F,X) is also written T(F). Terms inT(F) are called ground terms.

• T(F,X

(11)

Security Models Lecture 4 Active Intruder Unification Notions

Terms and Messages

Example

Example

LetF ={enc/2,pair/2,k1/0,k2/0,0/0,1/0}andX ={x,y,z} pair(x,1), enc(pair(y,z),k1) and enc(0,k1) are terms in T(F,X) pair(0,1), enc(0,k1) are terms in T(F), i.e., ground terms We also denote{ } for enc( , ) andh , ifor pair( , ).

(12)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Substitution

Definition

• A substitution(respectively a ground substitution) σ is a mapping fromX into T(F,X) (respectively intoT(F)) where there are only finitely many variables not mapped to themselves.

• Substitutions can be extended to T(F,X) in such a way that

∀f ∈ Fn,∀t1, . . . ,tn∈ T(F,X):

σ(f(t1, . . . ,tn)) =f(σ(t1), . . . , σ(tn)).

Thedomain of a substitutionσ is the subset of variablesx∈ X

(13)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Example:

Letσ ={x ←NA,y← {hNA,NBi}kB} andt =hx,hy,hx,xiii.

Then,

σ(t) =hNA,h{hNA,NBi}kB,hNA,NAiii

(14)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Unification

Definition

Twot ands are unifiable if there exists a substitutionσ such that σ(s) =σ(t)

Examples:

(15)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Unification

Definition

Twot ands are unifiable if there exists a substitutionσ such that σ(s) =σ(t)

Examples:

s =a t =X

(16)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Unification

Definition

Twot ands are unifiable if there exists a substitutionσ such that σ(s) =σ(t)

Examples:

s =a t =X σ ={X ←a}

(17)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Unification

Definition

Twot ands are unifiable if there exists a substitutionσ such that σ(s) =σ(t)

Examples:

s =a t =X σ ={X ←a}

s =a t =p(X)

(18)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Unification

Definition

Twot ands are unifiable if there exists a substitutionσ such that σ(s) =σ(t)

Examples:

s =a t =X σ ={X ←a}

s =a t =p(X) No unifier

(19)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Unification

Definition

Twot ands are unifiable if there exists a substitutionσ such that σ(s) =σ(t)

Examples:

s =a t =X σ ={X ←a}

s =a t =p(X) No unifier s =p(a,X) t =p(Y,b)

(20)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Unification

Definition

Twot ands are unifiable if there exists a substitutionσ such that σ(s) =σ(t)

Examples:

s =a t =X σ ={X ←a}

s =a t =p(X) No unifier

s =p(a,X) t =p(Y,b) σ ={X ←b;Y ←a}

(21)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Unification

Definition

Twot ands are unifiable if there exists a substitutionσ such that σ(s) =σ(t)

Examples:

s =a t =X σ ={X ←a}

s =a t =p(X) No unifier

s =p(a,X) t =p(Y,b) σ ={X ←b;Y ←a}

s =p(f(X),g(Z)) t =p(f(a),Y)

(22)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Unification

Definition

Twot ands are unifiable if there exists a substitutionσ such that σ(s) =σ(t)

Examples:

s =a t =X σ ={X ←a}

s =a t =p(X) No unifier

s =p(a,X) t =p(Y,b) σ ={X ←b;Y ←a}

s =p(f(X),g(Z)) t =p(f(a),Y) σ={X ←a;Y ←g(Z)}

(23)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Unification

Definition

Twot ands are unifiable if there exists a substitutionσ such that σ(s) =σ(t)

Examples:

s =a t =X σ ={X ←a}

s =a t =p(X) No unifier

s =p(a,X) t =p(Y,b) σ ={X ←b;Y ←a}

s =p(f(X),g(Z)) t =p(f(a),Y)

σ={X ←a;Y ←g(Z)} or σ={X ←a;Y ←g(b);Z ←b}

(24)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Most General Unifier

Definition

The most general unification between two termss and t, denoted bymgu(s,t) if: ∀σ such that sσ =tσ,∃θ such that

σ=mgu(s,t)θ

Example:

s =p(f(X),g(Z)) t=p(f(a),Y)

σ1 ={X ←a;Y ←g(Z)}σ2={X ←a;Y ←g(b);Z ←b} θ={z 7→b},σ21θ

(25)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Most General Unifier

Definition

The most general unification between two termss and t, denoted bymgu(s,t) if: ∀σ such that sσ =tσ,∃θ such that

σ=mgu(s,t)θ Example:

s =p(f(X),g(Z)) t=p(f(a),Y)

σ1 ={X ←a;Y ←g(Z)}σ2={X ←a;Y ←g(b);Z ←b} θ={z 7→b},σ21θ

(26)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Most General Unifier

Definition

The most general unification between two termss and t, denoted bymgu(s,t) if: ∀σ such that sσ =tσ,∃θ such that

σ=mgu(s,t)θ Example:

s =p(f(X),g(Z)) t=p(f(a),Y)

σ1 ={X ←a;Y ←g(Z)}σ2={X ←a;Y ←g(b);Z ←b}

θ={z 7→b},σ21θ

(27)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Most General Unifier

Definition

The most general unification between two termss and t, denoted bymgu(s,t) if: ∀σ such that sσ =tσ,∃θ such that

σ=mgu(s,t)θ Example:

s =p(f(X),g(Z)) t=p(f(a),Y)

σ1 ={X ←a;Y ←g(Z)}σ2={X ←a;Y ←g(b);Z ←b}

θ={z 7→b},σ21θ

(28)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Goal

Design an algorithm that for a given unification problems =? t

• returns an mgu of s andt if they are unifiable.

• reports failure otherwise.

(29)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Naive Algorithm

Write down two terms and set markers at the beginning of the terms. Then:

1 Move the markers simultaneously, one symbol at a time, until both move off the end of the term (success), or until they point to two different symbols;

2 If the two symbols are both non-variables, then fail;

otherwise, one is a variable (call it x) and the other one is the first symbol of a subterm (call it t):

Ifx occurs int, then fail;

Otherwise, replacex everywhere by t (including in the solution), write down ”xt” as a part of the solution, and return to 1.

(30)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Example: f (x , g (a), g (z )) =

?

f (g (y ), g (y ), g (g (x)))

f(x,g(a),g(z)) f(g(y),g(y),g(g(x)))

(31)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Example: f (x , g (a), g (z )) =

?

f (g (y ), g (y ), g (g (x)))

f(x,g(a),g(z))

f(g(y),g(y),g(g(x)))

(32)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Example: f (x , g (a), g (z )) =

?

f (g (y ), g (y ), g (g (x)))

f(x,g(a),g(z))

f(g(y),g(y),g(g(x)))

σ={x ←g(y)}

(33)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Example: f (x , g (a), g (z )) =

?

f (g (y ), g (y ), g (g (x)))

f(g(y),g(a),g(z))

f(g(y),g(y),g(g(g(y))))

σ={x ←g(y)}

(34)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Example: f (x , g (a), g (z )) =

?

f (g (y ), g (y ), g (g (x)))

f(g(y),g(a),g(z))

f(g(y),g(y),g(g(g(y))))

σ={x ←g(y)}

(35)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Example: f (x , g (a), g (z )) =

?

f (g (y ), g (y ), g (g (x)))

f(g(a),g(a),g(z))

f(g(a),g(a),g(g(g(a))))

σ={x ←g(a),y ←a}

(36)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Example: f (x , g (a), g (z )) =

?

f (g (y ), g (y ), g (g (x)))

f(g(a),g(a),g(z))

f(g(a),g(a),g(g(g(a))))

σ={x ←g(a),y ←a}

(37)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Example: f (x , g (a), g (z )) =

?

f (g (y ), g (y ), g (g (x)))

f(g(a),g(a),g(g(g(a))))

f(g(a),g(a),g(g(g(a))))

σ={x ←g(a),y ←a,z ←g(g(a))}

(38)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Questions

1 Correctness:

Does the algorithm always terminate?

Does it always produce an mgu for two unifiable terms, and fail for non-unifiable terms?

Do these answers depend on the order of operations?

2 Complexity:

How much space does this take, and how much time?

3 Extension with equational theory, e.g., ab=ba.

(39)

Security Models Lecture 4 Active Intruder Unification Notions

Unification

Syntactic Unification is Unitary

Theorem (Robinson)

Without equational theory there exists an unique mgu for syntactic unification (modulo renaming). Unification is called unitary.

Herbrand, Martelli, Montanari, Plotkin, Robinson, Huet, Knuth, Bendix, Siekman, Baader.

(40)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Outline

1 Unification Notions Terms and Messages Unification

2 Active Intruder: Security Problem 3 Bounded Number of Sessions

4 NP-Hardness for Bounded Number of Sessions 5 Conclusion

(41)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Active Intruder with bounded number of sessions

• Theoriticaly: decidable

• Interestingpractically:

Find flaws

Usually attacks usefew sessions!

(42)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Dolev-Yao Deduction System

Deduction System : T0 `?s

(A) uT0

T0`u (UL) T0` hu,vi

T0`u

(P) T0`u T0`v

T0` hu,vi (UR) T0` hu,vi T0`v

(C) T0`u T0`v T0` {u}v

(D) T0` {u}v T0`v T0`u

(43)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Model: actions, roles and protocol

Definition (Action)

Anactionis a couple (recv(u),send(v))such that

u∈ T(F,X)∪ {init},v ∈ T(F,X)∪ {stop}. Denoted (u →v).

Example

First and last actions of Needham Schroeder

• (init,Xb→ {Na,A}pk(Xb))

• ({Nb}pk(B) →stop)

(44)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Model: actions, roles and protocol

Definition (Action)

Anactionis a couple (recv(u),send(v))such that

u∈ T(F,X)∪ {init},v ∈ T(F,X)∪ {stop}. Denoted (u →v).

Example

First and last actions of Needham Schroeder

• (init,Xb→ {Na,A}pk(Xb))

• ({Nb}pk(B) →stop)

(45)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Model: actions, roles and protocol

Definition (Role)

Aroleis a finite sequence of actions:

(u1 →v1), . . . ,(un→vn) such thatvars(vi)⊆ [

1≤j≤i

vars(uj).

Definition (Protocol)

AprotocolP is a finite set of roles: P ={R1, . . . ,Rk}

(46)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Model: actions, roles and protocol

Definition (Role)

Aroleis a finite sequence of actions:

(u1 →v1), . . . ,(un→vn) such thatvars(vi)⊆ [

1≤j≤i

vars(uj).

Definition (Protocol)

AprotocolP is a finite set of roles: P ={R1, . . . ,Rk}

(47)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

1st Example:

Example (Needham-schroeder)

1. A → B :{Na,A}pk(B) 2. B → A :{Na,Nb}pk(A) 3. A → B :{Nb}pk(B)

Write down each agent’s role description, thisA talks with anybody.

RA = (init,Xb→ {Na,A}pk(Xb)), ({Na,xNb}pk(A)→ {xNb}pk(Xb)), RB = ({xNa,xA}pk(B)→ {xNa,Nb}pk(x

A)) ({N } →stop)

(48)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Scyther Notation

A: const Na: Nonce;

var Nb: Nonce;

send(A,B, {Na,A}pk(B));

recv(B,A, {Na,Nb}pk(A));

send(A,B, {Nb}pk(B));

B: const Nb: Nonce;

var Na: Nonce;

recv(A,B,{Na,A}pk(B));

send(B,A,{Na,Nb}pk(A));

(49)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Exercise

Denning-Sacco Protocol

1. A→S : hA,Bi

2. S →A: {hhB,NABi,hNs,{hNAB,hA,Nsii}KBSii}KAS 3. A→B : {hNAB,hA,Nsii}KBS

4. B→A: {SAB}NAB

PDS ={RA,RB,RS}models one session ofA,B andS.

RA= (init,XB → hA,XBi),

({hhXB,xNABi,hxNS,zAii}KAS →zA), ({wA}xNAB →stop)

RB = ({yNAB,hXA,yNSii}KBS → {SAB}yNAB)

RS = (hXA,XBi → {hXB,NAB,hNS,{hNAB,hXA,NSii}KBSii}KAS)

(50)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Exercise

Denning-Sacco Protocol

1. A→S : hA,Bi

2. S →A: {hhB,NABi,hNs,{hNAB,hA,Nsii}KBSii}KAS 3. A→B : {hNAB,hA,Nsii}KBS

4. B→A: {SAB}NAB

PDS ={RA,RB,RS}models one session ofA,B andS. RA= (init,XB → hA,XBi),

({hhXB,xNABi,hxNS,zAii}KAS →zA), ({wA}xNAB →stop)

(51)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Semantics

Definition (States)

• T is a set of ground terms (intruder knowledge)

• P a protocol

Astate is a couple (T,P) Definition (Transtion)

Is arelation between states(T,P)→σ (T0,P0)

• P =Sk

i Ri, take an i : Ri = (ui →vi)

• Possible σ:T `uiσ (dom(σ) =vars(ui))

• Update intruder knowledge : T0=T∪ {viσ}

• Update Protocol ∀j 6=i,R ∈P0,P0 = (P\ {R})∪Rσ

(52)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Example

Example

Simple LetT ={a,b,kI}and P ={R} where R= (hx,yi → h{y}k,xi),(z → hx,hy,zii).

• (T,P)→σ (T ∪ {h{b}k,ai},{(z → ha,hb,zii)}) σ ={x ←a,y ←b}

• (T,P)→σ (T ∪ {h{{a}kI}k,ai},{(z → ha,h{a}kI,zii)} σ ={x ←a,y ← {a}kI}

• (T,P)6→σ (T ∪ {h{{a}k}k,ai},{(z → ha,h{a}k,zii)}) σ ={x ←a,y ← {a}k}

Each branch has afinite depth (protocol are finite),

butpossibly a infinite branching(infinite number of terms).

(53)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Example

Example

Simple LetT ={a,b,kI}and P ={R} where R= (hx,yi → h{y}k,xi),(z → hx,hy,zii).

• (T,P)→σ (T ∪ {h{b}k,ai},{(z → ha,hb,zii)}) σ ={x ←a,y ←b}

• (T,P)→σ (T ∪ {h{{a}kI}k,ai},{(z → ha,h{a}kI,zii)}

σ ={x ←a,y ← {a}kI}

• (T,P)6→σ (T ∪ {h{{a}k}k,ai},{(z → ha,h{a}k,zii)}) σ ={x ←a,y ← {a}k}

Each branch has afinite depth (protocol are finite),

butpossibly a infinite branching(infinite number of terms).

(54)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Example

Example

Simple LetT ={a,b,kI}and P ={R} where R= (hx,yi → h{y}k,xi),(z → hx,hy,zii).

• (T,P)→σ (T ∪ {h{b}k,ai},{(z → ha,hb,zii)}) σ ={x ←a,y ←b}

• (T,P)→σ (T ∪ {h{{a}kI}k,ai},{(z → ha,h{a}kI,zii)}

σ ={x ←a,y ← {a}kI}

• (T,P)6→σ (T ∪ {h{{a}k}k,ai},{(z → ha,h{a}k,zii)}) σ ={x ←a,y ← {a}k}

Each branch has afinite depth (protocol are finite),

butpossibly a infinite branching(infinite number of terms).

(55)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Example

Example

Simple LetT ={a,b,kI}and P ={R} where R= (hx,yi → h{y}k,xi),(z → hx,hy,zii).

• (T,P)→σ (T ∪ {h{b}k,ai},{(z → ha,hb,zii)}) σ ={x ←a,y ←b}

• (T,P)→σ (T ∪ {h{{a}kI}k,ai},{(z → ha,h{a}kI,zii)}

σ ={x ←a,y ← {a}kI}

• (T,P)6→σ (T ∪ {h{{a}k}k,ai},{(z → ha,h{a}k,zii)}) σ ={x ←a,y ← {a}k}

Each branch has afinite depth (protocol are finite),

butpossibly a infinite branching(infinite number of terms).

(56)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Example

Example

Simple LetT ={a,b,kI}and P ={R} where R= (hx,yi → h{y}k,xi),(z → hx,hy,zii).

• (T,P)→σ (T ∪ {h{b}k,ai},{(z → ha,hb,zii)}) σ ={x ←a,y ←b}

• (T,P)→σ (T ∪ {h{{a}kI}k,ai},{(z → ha,h{a}kI,zii)}

σ ={x ←a,y ← {a}kI}

• (T,P)6→σ (T ∪ {h{{a}k}k,ai},{(z → ha,h{a}k,zii)}) σ ={x ←a,y ← {a}k}

Each branch has afinite depth (protocol are finite),

(57)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Preservation of the secrecy

Definition (Secrecy)

LetT1 be a ground set of terms (Initial knowledge of the intruder).

A protocolP does not preserve the secrecy of a ground terms for T1 if there exists a state (T0,P0), such that

• T0`s

• (T1,P)→ (T0,P0)

where→ is the reflexive and transitive closure of→.

If there does not exist a such state(T0,P0) we say that P preserves the secrecy ofs for the initial intruder knowledgeT1.

(58)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Interleaving

Definition (Partial Order<p)

A protocolP define apartial order <P on actions ofP, s.t (ui →vi)<P (uj →vj)

ifR ∈P,R = (u1→v1). . .(ui →vi). . .(uj →vj). . .(un→ vn) (1≤i ≤j ≤n).

Definition (Execution Order<E)

An execution order<E of P is a total order on the subset Aof actions of P, compatible with <P and stable by predecessor, i.e.

ifb∈Aet a<P b then a∈Aanda<E b

It corresponds to an interleaving of roles.

(59)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Interleaving

Definition (Partial Order<p)

A protocolP define apartial order <P on actions ofP, s.t (ui →vi)<P (uj →vj)

ifR ∈P,R = (u1→v1). . .(ui →vi). . .(uj →vj). . .(un→ vn) (1≤i ≤j ≤n).

Definition (Execution Order<E)

An execution order<E of P is a total order on the subset Aof actions ofP, compatible with <P and stable by predecessor, i.e.

ifb∈Aet a<P b then a∈Aanda<E b

(60)

Security Models Lecture 4 Active Intruder Active Intruder: Security Problem

Secrecy

Definition (Secrecy over<E)

Let an execution order<E ofP. We assume that (u1 →v1)<E . . . <E (un→vn)

<E does not preserve the secrecy ofs, givenT1 if there exists σ1, . . . , σn such that

(T1,P)→(T1∪ {v1σ1},P1)→. . .→(T1∪ {v1σ1, . . . ,vnσn},Pn) andT1∪ {v1σ1, . . . ,vnσn} `s.

(61)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Outline

1 Unification Notions Terms and Messages Unification

2 Active Intruder: Security Problem 3 Bounded Number of Sessions

4 NP-Hardness for Bounded Number of Sessions 5 Conclusion

(62)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Constraints System

Symbolic representation of execution tree by constraints system.

Definition (Constraints System) Aconstraintis an expression T u whereT is a set of terms andu a term.

Aconstraints systemC is a finite set of constraints ∪1≤i≤nTi ui such that

• Ti ⊆Ti+1 (1≤i ≤n)

• if Ti ui ∈C andx ∈vars(Ti) then

Tj =min{T0|T0v ∈C,x∈vars(v)} exists and j <i A substitutionσ is a solution ofC ifTσ`uσ for all T u ∈C.

(63)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

From Protocols to Constraints system

LetP a protocol,<E an execution order ofP ands a secret term.

(u1 →v1)<E (u2 →v2)<E . . . <E (un→vn)

We associateC:

T1 u1

T2=T1∪ {v1} u2 ... Tn=Tn−1∪ {vn−1} un

Tn+1=Tn∪ {vn} s

We show thatC has a solution iff<E does not preserve the secret

(64)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Exercises

Exercise 1

A→B: hA,NAi B →A: {hNA,NBi}Kab A→B: NB

B →A: {hK,NBi}Kab A→B: {s}K

Intruder knows only identities of AandB.

• Give role specification of this protocol of an instance of execution between AandB.

• Give a constraint system associated to this protocol between A andB.

(65)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Solution

A→B: hA,NAi B →A: {hNA,NBi}Kab A→B: NB

B →A: {hK,NBi}Kab A→B: {s}K

T1=

{A,B,hA,NAi,{hNA,NBi}Kab,NB,{hK,NBi}Kab,{s}K,init,stop}

Roles

RA = (init → hA,NAi), ({hNA,XNBi}K(A,

XB) →XNB), ({hXK,XNBi}K

(A,XB) → {s}XK) RB = (hXA,XNAi → {hXNA,NBi}K

(XA,B))

(66)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Solution

A→B: hA,NAi B →A: {hNA,NBi}Kab A→B: NB

B →A: {hK,NBi}Kab A→B: {s}K

T1=

{A,B,hA,NAi,{hNA,NBi}Kab,NB,{hK,NBi}Kab,{s}K,init,stop}

Constraint System

T1 init

T2 =T1∪ {hA,NAi} hXA,XNAi T3 =T2∪ {{hXNA,NBi}K(

XA,B)} {hNA,XNBi}K(A,

XB)

T4 =T3∪ {XNB} NB

(67)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Resolution of Constraints systems

Definition (Rules of simplification: C σ C0)

R1 C∪ {Tu} C ifT∪ {x|

T0xC,T0T} `u R2 C∪ {Tu} σ Cσ∪ {Tσuσ} σ=mgu(t,u),tst(T),

t,uno variables

R3 C∪ {Tu} σ Cσ∪ {Tσuσ} σ=mgu(t1,t2),t1,t2st(T), t1,t2no variables

R4 C∪ {T{u}v} C∪ {Tu,Tv}

R5 C∪ {Thu,vi} C∪ {Tu,Tv}

R6 C∪ {Tu} ifT=or

var(T) =var(u) =andT6`u

(68)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Properties of simplification rules

Lemma (Preservation)

Simplification rules transform a constraints system into a constraints system.

Lemma (Correctness)

IfC σ C0 then if θis a solution of C0,σθ is also a solution of C .

Lemma (Termination)

Simplification rules always terminate: There does not exist infinite chainC σ1C1 σ2 C2 σ3. . ..

(69)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Properties of simplification rules

Lemma (Preservation)

Simplification rules transform a constraints system into a constraints system.

Lemma (Correctness)

IfC σ C0 then if θis a solution of C0,σθ is also a solution of C .

Lemma (Termination)

Simplification rules always terminate: There does not exist infinite chainC σ1C1 σ2 C2 σ3. . ..

(70)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Properties of simplification rules

Lemma (Preservation)

Simplification rules transform a constraints system into a constraints system.

Lemma (Correctness)

IfC σ C0 then if θis a solution of C0,σθ is also a solution of C .

Lemma (Termination)

Simplification rules always terminate: There does not exist infinite chainC σ1C1 σ2 C2 σ3. . ..

(71)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Properties

Definition (Solved Form)

A constraints systemC is insolved form if C =⊥or if each constraint is of the following formT x wherex is a variable T 6=∅.

Lemma

All constraints systems in solved form different of⊥ has at least one solution.

Lemma (Completeness)

IfC is a constraint system not in solved form and if σ is a solution ofC then there existsθ, τ such that C θC0,σ =θτ and τ is a solution ofC0.

(72)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Properties

Definition (Solved Form)

A constraints systemC is insolved form if C =⊥or if each constraint is of the following formT x wherex is a variable T 6=∅.

Lemma

All constraints systems in solved form different of⊥ has at least one solution.

Lemma (Completeness)

IfC is a constraint system not in solved form and if σ is a solution ofC then there existsθ, τ such that C C0,σ =θτ and τ is a

(73)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Decidability

Theorem

Preservation of the secrecy for protocol with bounded number of sessions is decidable.

• Guess an interleaving and build constraints system associated.

• Using previous lemma C has a solution iff there existsC0 in solved form such that C0 6=⊥andC τ C0

• Using termination lemma to conclude.

We also can show that the problem is in co-NP.

(74)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Exercises

Exercise 1

A→B: hA,NAi B →A: {hNA,NBi}Kab A→B: NB

B →A: {hK,NBi}Kab A→B: {s}K

Intruder knows only identities ofA andB.

• Use simplification rules to transform the system in solved form.

• There exists an easy attack, can you find it ?

(75)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Solution

T1={A,B,hA,NAi,{hNA,NBi}Kab,NB,{hK,NBi}Kab,{s}K,init,stop}

C1 T1 init

C2 T2=T1∪ {hA,NAi} hXA,XNAi C3 T3=T2∪ {{hXNA,NBi}K(XA,B)} {hNA,XNBi}K(A,XB)

C4 T4=T3∪ {XNB} NB

C5 T5=T4∪ {{hK,NBi}K(XA,B)} {hXK,XNBi}K(A,XB)

C6 T6=T5∪ {{s}XK} {Xs}K

C7 T7=T6∪ {stop} s

Road book

Interleaving: (u1A,v1A)(u1B,v1B)(u2A,v2A)(u2B,v2B)(u3A,v3A)(u3B,v3B)

R2 C∪ {T u} σ Cσ∪ {Tσuσ} σ=mgu(t,u),t st(T), t,uno variables

Apply nothing onC , already in resolved form.

(76)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Solution

T1={A,B,hA,NAi,{hNA,NBi}Kab,NB,{hK,NBi}Kab,{s}K,init,stop}

C3σ1 T3=T2∪ {{hNA,NBi}K(A,B)} {hNA,XNBi}K(A,XB)

C4σ1 T4=T3∪ {XNB} NB

C5σ1 T5=T4∪ {{hK,NBi}K(A,B)} {hXK,XNBi}K(A,XB)

C6σ1 T6=T5∪ {{s}XK} {Xs}K

C7σ1 T7=T6∪ {stop} s

Road bookσ1={XNA NA,XAA}

ApplyR2onC3givesσ2={XNB NB,XB B}(orNA) andR1

(77)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Solution

T1={A,B,hA,NAi,{hNA,NBi}Kab,NB,{hK,NBi}Kab,{s}K,init,stop}

C5σ1σ2 T5=T4∪ {{hK,NBi}K(A,B)} {hXK,NBi}K(A,B) C6σ1σ2 T6=T5∪ {{s}XK} {Xs}K

C7σ1σ2 T7=T6∪ {stop} s

Road bookσ1={XNA NA,XAA} σ2={XNB NB,XB B}

ApplyR2onC5σ1σ2 giveσ3={XK NA}

ApplyR2, onσ1σ2σ3C6 giveσ4={XS s}

(78)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Solution

1 A→B : hA,NAi 2 B →A: {hNA,NBi}Kab 3 A→B : NB

4 B →A: {hK,NBi}Kab 5 A→B : {s}K

The resolution of constraint system gives the following attack:

Send 2nd message{hNA,NBi}Kab instead of the 4th message {hK,NBi}Kab. HenceA will replay{s}NA because intruder knows NA

(79)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Exercises

Exercise 2

A→B : {hA,Ki}Kab B →A: {s}Kab

Intruder knows only identities ofA andB. Show that the secret datas is preserved by one single session betweenA andB.

(80)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Solution

A→B : {hA,Ki}Kab B →A: {s}Kab

T1={A,B,{hA,Ki}Kab,{s}Kab} Constraint System

C1 T1 init

C2 T2 =T1∪ {{hA,XKi}Kab} {hA,XKi}Kab C3 T3 =T2∪ {{s}X

Kab} {s}X

Kab

C4 T4 =T3∪ {stop} s

(81)

Security Models Lecture 4 Active Intruder Bounded Number of Sessions

Solution

C1 T1 init

C2 T2 =T1∪ {{hA,XKi}Kab} {hA,XKi}Kab C3 T3 =T2∪ {{s}X

Kab} {s}X

Kab

C4 T4 =T3∪ {stop} s

T1={A,B,{hA,Ki}Kab,{s}Kab} Road book

• Apply nothing or R4 or R5 andR2 onC1 give σ0={XK ←K,XKab ←Kab}

Each time you meet a solved form of the form⊥with R6.

(82)

Security Models Lecture 4 Active Intruder NP-Hardness for Bounded Number of Sessions

Outline

1 Unification Notions Terms and Messages Unification

2 Active Intruder: Security Problem 3 Bounded Number of Sessions

4 NP-Hardness for Bounded Number of Sessions 5 Conclusion

(83)

Security Models Lecture 4 Active Intruder NP-Hardness for Bounded Number of Sessions

NP-hardness

Theorem

Decide if a protocolP does not preserve the secrecy of a ground terms from an initial knowledgeT1 is NP-difficult.

(84)

Security Models Lecture 4 Active Intruder NP-Hardness for Bounded Number of Sessions

Recall 3-SAT Problem

Definition

Input: set of propositional variables {x1, . . . ,xn} and a conjunction of clauses with 3 literals.

f(~x) = ^

1≤i≤I

(xi,1i,1∨xi,2i,2∨xi,3i,3)

wherei,j ∈ {+,−}andx+=x,x=¬x.

Question : Does exist a valuation V of {x1, . . . ,xn}, such that V(f(~x)) =>.

Theorem

(85)

Security Models Lecture 4 Active Intruder NP-Hardness for Bounded Number of Sessions

NP-difficulty

We build a protocol such that an intruder can deduces iff f(~x) is satisfaisable.

g(xi,ji,j) =

xi,j if i,j = + {xi,j}K if i,j =−

∀1≤i ≤I : fi(~x) =hg(xi,1i,1),hg(xi,2i,2),g(xi,3i,3)ii We suppose Initial intruder knowledge is {⊥,>}.

A: hx1,h. . . ,xnii → {hf1(~x),hf2(~x),h. . . ,hfn(~x),endi. . .ii}p

∀1≤i ≤I :

Bi : {hh>,hx,yii,zi}p → {z}p Bi : {hh{⊥}K,hx,yii,zi}p→ {z}p

Ci : {hhx,h>,yii,zi}p → {z}p Ci : {hhx,h{⊥}K,yii,zi}p→ {z}p Di : {hhx,hy,>ii,zi}p → {z}p

(86)

Security Models Lecture 4 Active Intruder Conclusion

Outline

1 Unification Notions Terms and Messages Unification

2 Active Intruder: Security Problem 3 Bounded Number of Sessions

4 NP-Hardness for Bounded Number of Sessions 5 Conclusion

(87)

Security Models Lecture 4 Active Intruder Conclusion

Summary

Today

• Active Intruder

• Bounded Number of Sessions

• NP-Hardness

• Tools

(88)

Security Models Lecture 4 Active Intruder Conclusion

Next Time

• Playing with Tools:

Scyther

Avispa: OFMC, Cl-Atse, SATMC, TA4SP

Proverif

(89)

Security Models Lecture 4 Active Intruder Conclusion

Thank you for your attention

Questions ?

Références

Documents relatifs

A first reason is that discrete logarithm is harder in prime order groups (but it is still hard in non-prime order groups).. A second reason is because finding generator is

3 Conclusion: Under this assumption there does not exist an adversary in polynomial time which can break the security of the scheme.. Application: ElGamal is IND-CPA secure under

Recall the CFB mode and prove that is not IND-CCA2 secure.. Recall the CTR mode and prove that is not

Security Models Lecture 3 Passive Intruder Undecidability for unbounded number of

Show that the secret data s is preserved by one single session between A and

• XOR-ProVerif and DH-ProVerif: are two tools developed by Kuesters et al for analyzing cryptographic protocols with Exclusive-Or and Diffie-Hellman properties, using ProVerif PC

Security for Data Scientists Lecture 1 RGPD Apr` es le 25 mai 2018.. R` eglement G´ en´ eral sur la Protection des Donn´ ees GDPR : General Data

Security for Data Scientists Lecture 2 La s´ ecurit´ e et vous4. Devenir acteur de sa s´ ecurit´ e