• Ingen resultater fundet

Needham-Schroeder ’78 Dolev-Yao ’81

N/A
N/A
Info
Hent
Protected

Academic year: 2022

Del "Needham-Schroeder ’78 Dolev-Yao ’81"

Copied!
52
0
0

Indlæser.... (se fuldtekst nu)

Hele teksten

(1)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Control Flow Analysis

of Security Protocols (I)

Mikael Buchholtz

(2)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

History of Protocol Analysis

Needham-Schroeder ’78 Dolev-Yao ’81

Algebraic view

of cryptography

(3)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

History of Protocol Analysis

Needham-Schroeder ’78 Dolev-Yao ’81

Algebraic view of cryptography

Millen ’84, Meadows ’89, ...

State/transition model

(4)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

History of Protocol Analysis

Needham-Schroeder ’78 Dolev-Yao ’81

Algebraic view of cryptography

Millen ’84, Meadows ’89, ...

State/transition model

Burrows-Abadi-Needham ’89, ...

Modal logics

(5)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

History of Protocol Analysis

Needham-Schroeder ’78 Dolev-Yao ’81

Algebraic view of cryptography

Millen ’84, Meadows ’89, ...

State/transition model

Burrows-Abadi-Needham ’89, ...

Modal logics

Woo-Lam ’93

Lowe ’95

Language-based

Model checking of CSP

. . . LySa

(6)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

History of Protocol Analysis

Needham-Schroeder ’78 Dolev-Yao ’81

Algebraic view of cryptography

Millen ’84, Meadows ’89, ...

State/transition model

Burrows-Abadi-Needham ’89, ...

Modal logics

Woo-Lam ’93

Lowe ’95

Language-based

Model checking of CSP

. . . LySa

Thayer-Herzog- Guttman ’98, ...

Strand Spaces

(7)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

History of Protocol Analysis

Needham-Schroeder ’78 Dolev-Yao ’81

Algebraic view of cryptography

Millen ’84, Meadows ’89, ...

State/transition model

Burrows-Abadi-Needham ’89, ...

Modal logics

Woo-Lam ’93

Lowe ’95

Language-based

Model checking of CSP

. . . LySa

Thayer-Herzog- Guttman ’98, ...

Strand Spaces Probabalistic/complexity

theoretic view

of cryptography Herzog ’03,

Zunino-Degano ’04

(8)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Analysing a Protocol

[Bodei-Buchholtz-Degano-Nielson-Nielson ’04]

1. Write the protocol in the process calculus L Y S A

2. Specify an attacker

3. Analyse the protocol and the attacker using control flow analysis

4. Inspect the analysis result to determine

(security) properties of the protocol.

(9)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

L Y S A for Symmetric Cryptography

E ::= n name ( n ∈ N )

x variable (x ∈ X )

{E 1 , · · · , E k } E

0

encryption P ::= hE 1 , · · · , E k i. P output

(E 1 , · · · , E j ; x j +1 , · · · , x k ). P input (with matching)

decrypt E as {E 1 , · · · , E j ; x j +1 , · · · , x k } E

0

in P

decryption (with matching)

P 1 | P 2 parallel composition

(ν n)P introduce new name n

! P replication

(10)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Wide-mouthed-frog Protocol

(without timestamps) [Burrows-Abadi-Needham ’89]

1. A → S : A, {B, K AB } K A

2. S → B : {A, K AB } K B

3. A → B : { mess } K AB

A

S Network

K A

K

(11)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Wide-mouthed-frog Protocol

(without timestamps) [Burrows-Abadi-Needham ’89]

1. A → S : A, {B, K AB } K A

2. S → B : {A, K AB } K B

3. A → B : { mess } K AB

A

S Network

A, {B, K AB } K A

(12)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Wide-mouthed-frog Protocol

(without timestamps) [Burrows-Abadi-Needham ’89]

1. A → S : A, {B, K AB } K A

2. S → B : {A, K AB } K B

3. A → B : { mess } K AB

A

S Network

{A, K AB } K B

(13)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Wide-mouthed-frog Protocol

(without timestamps) [Burrows-Abadi-Needham ’89]

1. A → S : A, {B, K AB } K A

2. S → B : {A, K AB } K B

3. A → B : { mess } K AB

A

S Network { mess } K AB

(14)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Semantics

L Y S A has a reduction semantics defined by two relations

P → P 0 the reduction relation

P ≡ P 0 the structural congruence

(P → R P 0 parameterised reduction relation used in

the paper )

(15)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Reduction Relation P → P 0

◦ ◦

◦ ◦

· · ·

· · ·

· · ·

· · ·

· · ·

Executions with the attacker

(16)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Reduction Relation P → P 0

◦ ◦

◦ ◦

· · ·

· · ·

· · ·

· · ·

· · ·

Executions

Executions with the attacker

(17)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Reduction Relation

P → P 0

(ν n)P → (ν n)P 0

j i =1 E i = E i 0

hE 1 , · · · , E k i. P | (E 1 0 , · · · , E j 0 ; x j +1 , · · · , x k ). Q →

P | Q[E j +1 /x j +1 , · · · , E k /x k ]

P → P 0

P | Q → P 0 | Q

(18)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Structural Congruence

The structural congruence, P ≡ Q , brings processes

“on the right form” for the reduction relation

P ≡ Q ∧ Q → Q 0 ∧ Q 0 ≡ P 0

P → P 0

(19)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Structural Congruence

P ≡ P

P 1 ≡ P 2 ⇒ P 2 ≡ P 1

P 1 ≡ P 2 ∧ P 2 ≡ P 3 ⇒ P 1 ≡ P 3

P 1 ≡ P 2 ⇒ hE 1 , · · · , E k i. P 1 ≡ hE 1 , · · · , E k i. P 2 P 1 ≡ P 2 ⇒ (E 1 , · · · , E j ; x j +1 , · · · , x k ). P 1 ≡

(E 1 , · · · , E j ; x j +1 , · · · , x k ). P 2

P 1 ≡ P 2 ∧ P 3 ≡ P 4 ⇒ P 1 | P 3 ≡ P 2 | P 4

P 1 ≡ P 2 ⇒ (ν n)P 1 ≡ (ν n)P 2

P 1 ≡ P 2 ⇒ !P 1 ≡ !P 2

P ≡ P ⇒ E {E , · · · , E ; x , · · · , x } P ≡

(20)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Structural Congruence

P 1 ≡ P 2 if P 1 and P 2 are disciplined α -equivalent

P 1 | P 2 ≡ P 2 | P 1

(P 1 | P 2 ) | P 3 ≡ P 1 | (P 2 | P 3 ) P | 0 ≡ P

(ν n) 0 ≡ 0

(ν n)(ν n 0 )P ≡ (ν n 0 )(ν n)P

(ν n)(P 1 | P 2 ) ≡ P 1 | (ν n)P 2 if n 6∈ fn(P 1 )

!P ≡ P | !P

(21)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Semantics at Work

((ν n)hni. 0 ) | (; x). hn, xi. 0

(22)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Semantics at Work

((ν n)hni. 0 ) | (; x). hn, xi. 0

≡ ((ν m)hmi. 0 ) | (; x). hn, xi. 0

≡ (ν m)(hmi. 0 | (; x). hn, xi. 0 )

(23)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Semantics at Work

((ν n)hni. 0 ) | (; x). hn, xi. 0

≡ ((ν m)hmi. 0 ) | (; x). hn, xi. 0

≡ (ν m)(hmi. 0 | (; x). hn, xi. 0 )

→ (ν m)( 0 | hn, mi. 0 )

(24)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Semantics at Work

((ν n)hni. 0 ) | (; x). hn, xi. 0

≡ ((ν m)hmi. 0 ) | (; x). hn, xi. 0

≡ (ν m)(hmi. 0 | (; x). hn, xi. 0 )

→ (ν m)( 0 | hn, mi. 0 )

≡ 0 | (ν m)hn, mi. 0

≡ (ν m)hn, mi. 0

(25)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Algebraic View of Cryptography

[Dolev-Yao ’81]

For example, to model

encrypt as E K (P ) and decrypt as D K (C ) such

that D K (E K (m)) = m and nothing else

(26)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Symmetric Cryptography in L Y S A

Encryption:

{E 1 , · · · , E k } E 0

Decryption:

decrypt E as {E 1 , · · · , E j ; x j +1 , · · · , x k } E 0 in P Semantics models perfect cryptography:

j i =0 E i = E i 0

decrypt {E 1 , · · · , E k } E

0

as {E 1 0 , · · · , E j 0 ; x j +1 , · · · , x k } E

0

0

in P

→ P [E j +1 /x j +1 , · · · , E k /x k ]

(27)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Asymmetric Cryptography in L Y S A

Keys:

± m)P introduces two keys m + , m in P

Encryption:

{|E 1 , · · · , E k |} E 0

Decryption:

decrypt E as {|E 1 , · · · , E j ; x j +1 , · · · , x k |} E 0 in P

(28)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Asymmetric Cryptography in L Y S A

Decryption with private key:

j i =1 E i = E i 0

decrypt {|E 1 , · · · , E k |} m

+

as {|E 1 0 , · · · , E j 0 ; x j +1 , · · · , x k |} m

in P

→ P [E j +1 /x j +1 , · · · , E k /x k ] Signature validation public key:

j i =1 E i = E i 0

decrypt {|E 1 , · · · , E k |} m

as {|E 1 0 , · · · , E j 0 ; x j +1 , · · · , x k |} m

+

in P

→ P [E j +1 /x j +1 , · · · , E k /x k ]

(29)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Asymmetric Cryptography in L Y S A

E ::= . . . . . .

m + , m public and private keys {|E 1 , · · · , E k |} E

0

asymmetric encryption

P ::= . . . . . .

± m)P key pair creation

decrypt E as {|E 1 , · · · , E j ; x j +1 , · · · , x k |} E

0

in

asymmetric decryption

(30)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Analysis

◦ ◦

◦ ◦

· · ·

· · ·

· · ·

· · ·

· · ·

Executions

(31)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Analysis

◦ ◦

◦ ◦

· · ·

· · ·

· · ·

· · ·

Executions

Analysis

(32)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Analysis

◦ ◦

◦ ◦

· · ·

· · ·

· · ·

· · ·

· · ·

Executions

Analysis

(33)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Analysis Components

Network messages: Variable bindings:

κ ∈ P (V ) ρ : X → P (V )

where values from V are variable-free terms i.e.

V ::= n | {V 1 , · · · , V k } V 0 | {|V 1 , · · · , V k |} V 0

Example

hA, B, { mess } K i. 0 | (A, B ; x). 0

hA, B, { } i ∈ κ

(34)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Analysis Judgements

ρ, κ | = P

reads: “ ρ and κ are valid analysis estimates for P ”

Example

P 1 def = hAi. 0 | (; x). 0 P 2 def = hA, B i. 0 | (B ; x). 0 κ a = {hA, B i}

ρ a = [x 7→ ∅]

κ b = {hAi}

ρ b = [x 7→ {A}]

κ c = {hAi, hB i}

ρ c = [x 7→ {A, B }]

(35)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Analysing Restriction

!(ν n)hni. 0

≡ (ν m)hmi. 0 | (ν o)hoi. 0 | (ν p)hpi. 0 | (ν q )hq i. 0 | (ν r)hri. 0 | . . . |

!(ν n)hni. 0

Each name, n , is assigned a canonical name bnc The semantics uses disciplined α -equivalence:

(ν n)P is α -equivalent to (ν n 0 )P 0 and bnc = bn 0 c

For example

bmc = boc = bpc = bq c = brc = . . . = bnc

(36)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Analysing Restriction

!(ν n)hni. 0 ≡ (ν m)hmi. 0 | (ν o)hoi. 0 | (ν p)hpi. 0 | (ν q )hq i. 0 | (ν r )hri. 0 | . . . |

!(ν n)hni. 0 Each name, n , is assigned a canonical name bnc

The semantics uses disciplined α -equivalence:

(ν n)P is α -equivalent to (ν n 0 )P 0 and bnc = bn 0 c

For example

bmc = boc = bpc = bq c = brc = . . . = bnc

(37)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Analysing Restriction

!(ν n)hni. 0 ≡ (ν m)hmi. 0 | (ν o)hoi. 0 | (ν p)hpi. 0 | (ν q )hq i. 0 | (ν r )hri. 0 | . . . |

!(ν n)hni. 0

Each name, n , is assigned a canonical name bnc The semantics uses disciplined α -equivalence:

(ν n)P is α -equivalent to (ν n 0 )P 0 and bnc = bn 0 c

For example

(38)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Canonical Names and Variables

Network messages: Variable bindings:

κ ∈ P (bVc ) ρ : bX c → P (bVc)

Example

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 )

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) | (ν n 1 )hn 1 , n 1 i. 0 | (; x 1 , y 1 ). 0 → (!(ν n)hn, ni. 0 ) | (!(; x, y). 0 )≡

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) | (ν n 2 )hn 2 , n 2 i. 0 | (; x 2 , y 2 ). 0 → . . .

but bnc = bn 1 c = bn 2 c = . . .

(39)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Canonical Names and Variables

Network messages: Variable bindings:

κ ∈ P (bVc ) ρ : bX c → P (bVc)

Example

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) ≡

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) | (ν n 1 )hn 1 , n 1 i. 0 | (; x 1 , y 1 ). 0

→ (!(ν n)hn, ni. 0 ) | (!(; x, y). 0 )≡

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) | (ν n 2 )hn 2 , n 2 i. 0 | (; x 2 , y 2 ). 0 → . . .

but bnc = bn 1 c = bn 2 c = . . .

(40)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Canonical Names and Variables

Network messages: Variable bindings:

κ ∈ P (bVc ) ρ : bX c → P (bVc)

Example

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) ≡

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) | (ν n 1 )hn 1 , n 1 i. 0 | (; x 1 , y 1 ). 0 → (!(ν n)hn, ni. 0 ) | (!(; x, y). 0 )

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) | (ν n 2 )hn 2 , n 2 i. 0 | (; x 2 , y 2 ). 0 → . . .

but bnc = bn 1 c = bn 2 c = . . .

(41)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Canonical Names and Variables

Network messages: Variable bindings:

κ ∈ P (bVc ) ρ : bX c → P (bVc)

Example

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) ≡

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) | (ν n 1 )hn 1 , n 1 i. 0 | (; x 1 , y 1 ). 0 → (!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) ≡

(!(ν n)hn, ni. 0 ) | (!(; x, y). 0 ) | (ν n 2 )hn 2 , n 2 i. 0 | (; x 2 , y 2 ). 0 →

. . .

(42)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Analysis of the Attacker

◦ ◦

◦ ◦

· · ·

· · ·

· · ·

· · ·

· · ·

Executions Analysis

n 1

n 2 n 3

bn i c

Executions with the attacker

(43)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

The Analysis of the Attacker

◦ ◦

◦ ◦

· · ·

· · ·

· · ·

· · ·

Executions Analysis

n 1

n 2 n 3

bn i c

Executions with the attacker

(44)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Protocol Scenarios

Network

S

A

B

In LySa: A | B | S

|

(45)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Protocol Scenarios

Network

S

A

B

M

In LySa: A | B | S | M

legitimate part of system the attacker

(46)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Protocol Scenarios

Network

S

A

B

M

In LySa: A | B | S | M

legitimate part of system the attacker

We write the legitimate part of the system

(47)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Protocols Scenarios

Network

S M

A

B K A

K B

(48)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Protocols Scenarios

Network

S M

A i A 3 A 2 A 1

B i

B 3

B 2

B 1

(49)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Protocols Scenarios

Network

S M

A i A 3 A 2 A 1

B i B 3 B 2 B 1 K A 1

K A i

K B 1 K B i

(50)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Meta Level

E ::= n i 1 ···i k Indexed names x i 1 ···i k Indexed variables . . .

P ::= . . .

| i∈S Indexed parallel

i∈S n i )P Indexed restriction

± i S n i )P Indexed key pair restriction

let X ⊆ S in P Declare set

Example

(51)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

Analysing a Protocol

1. Write the protocol in the process calculus L Y S A 2. Specify an attacker

3. Analyse the protocol and the attacker using control flow analysis

4. Inspect the analysis result to determine

(security) properties of the protocol.

(52)

Technical University of Denmark / Informatics and Mathematical Modelling / Safe and Secure IT-Systems

For Next Time

Write one or two protocols from Appendix A of [BBDNN04] in L Y S A

Things to consider:

The use of pattern matching, The use of restriction (ν n)P

Scenarios (number of principals, sharing keys, etc.)

To be presented on slides next time:

Starting 9.30! (February 18 th )

(Try to parse your LySa through the LySatool?)

Referencer

RELATEREDE DOKUMENTER

Department of Informatics and Mathematical Modelling.. A Very Short Introduction to

ES = Earliest start for a particular activity EF = Earliest finish for a particular activity where EF = ES + duration.. Informatics and Mathematical Modelling / Operations

• Suppose Chandy and Lamport’s distributed snapshot algorithm is initiated by process p 1 just after event e 1 in the following

Department of Management Engineering Technical University of Denmark..

DTU Management Engineering, Technical University of Denmark. Building 424, Room

the department of mathematical modeling (IMM) and the transportation and traffic center (CTT) at the technical uni- versity of Denmark (DTU) and the departments of mathematics

Ida Marie Olesen 21 DTU Management Engineering, Technical University of Denmark.. DTU Transport, Technical University of Denmark. Svenske

Skoglund, Three-dimensional face modelling and analysis, Informatics and Mathematical Modelling, Technical University of Denmark, 2003. ∗ Karl Sj¨ ostrand: