Compositional Protocol Logic CS 395T. Outline uFloyd-Hoare logic of programs Compositional reasoning about properties of programs uDDMP protocol logic.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Security attacks. - confidentiality: only authorized parties have read access to information - integrity: only authorized parties have write access to.
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Hoare’s Correctness Triplets Dijkstra’s Predicate Transformers
CS470, A.SelcukCryptographic Authentication1 Cryptographic Authentication Protocols CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Non-monotonic Properties for Proving Correctness in a Framework of Compositional Logic Koji Hasebe Mitsuhiro Okada (Dept. of Philosophy, Keio University)
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
Formal Derivation of Security Protocols Anupam DattaAnte Derek John C. Mitchell Dusko Pavlovic Stanford University Kestrel Institute HCSS April 15, 2004.
Logic for Computer Security Protocols John Mitchell Stanford University.
CS 395T Computational Soundness of Formal Models.
Security Analysis of Network Protocols Anupam Datta Stanford University May 18, 2005.
 Public key (asymmetric) cryptography o Modular exponentiation for encryption/decryption  Efficient algorithms for this o Attacker needs to factor large.
PCL: A Logic for Security Protocols Anupam Datta Stanford University Secure Software Systems, CMU October 3, 5, 2005.
Formally (?) Deriving Security Protocols Anupam Datta WIP with Ante Derek, John Mitchell, Dusko Pavlovic October 23, 2002.
Abstraction and Refinement in Protocol Derivation Anupam DattaAnte Derek John C. Mitchell Dusko Pavlovic Stanford University Kestrel Institute CSFW June.
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Cryptography.
Symbolic Logic for Complexity- theoretic Model of Security Protocols Anupam Datta Ante Derek John C. Mitchell Vitaly Shmatikov Mathieu Turuani May 5, 2005.
8-1 What is network security? Confidentiality: only sender, intended receiver should “understand” message contents m sender encrypts message m receiver.
Proving Security of Industrial Network Protocols: Theory and Practice Anupam Datta Stanford University Oakland PC Crystal Ball Workshop January 2007.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 7 Wenbing Zhao Department of Electrical and Computer Engineering.
Modelling and Analysing of Security Protocol: Lecture 1 Introductions to Modelling Protocols Tom Chothia CWI.
Security Analysis of Network Protocols: Compositional Reasoning and Complexity-theoretic Foundations Anupam Datta Stanford University May 23, 2005.
EEC 688/788 Secure and Dependable Computing Lecture 7 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Logic for Computer Security Protocols Ante Derek.
Just Fast Keying (JFK) Protocol 18739A: Foundations of Security and Privacy Anupam Datta CMU Fall
Protocol Composition Logic Arnab Roy joint work with A. Datta, A. Derek, N. Durgin, J.C. Mitchell, D. Pavlovic CS259: Security Analysis of Network Protocols,
Protocol Composition Logic II Anupam Datta Fall A: Foundations of Security and Privacy.
An Encapsulated Authentication Logic for Reasoning about Key Distribution Protocols Iliano Cervesato Tulane University Protocol eXchangeJune 10, 2005 Catherine.
Protocol Composition Logic John Mitchell Stanford TECS Week2005.
Logic for Protocol Composition A. Datta, A. Derek, J. Mitchell, D. Pavlovic.
Describing Syntax and Semantics
Protocol Composition Logic John Mitchell Stanford CS
Information Security of Embedded Systems : BAN-Logic Prof. Dr. Holger Schlingloff Institut für Informatik und Fraunhofer FIRST.
Network Security – Part 2 V.T. Raja, Ph.D., Oregon State University.
Logics for Security Protocols Anupam Datta Fall A: Foundations of Security and Privacy.
Computational Soundness for PCL Dilsun Kaynar Carnegie Mellon University Foundations of Security and Privacy October 11, 2007.
Slide 1 Vitaly Shmatikov CS 380S Oblivious Transfer and Secure Multi-Party Computation With Malicious Parties.
Rachana Y. Patil 1 1.
Programming Satan’s Computer
Formal Analysis of Security Protocols Dr. Changyu Dong
CSI 3125, Axiomatic Semantics, page 1 Axiomatic semantics The assignment statement Statement composition The "if-then-else" statement The "while" statement.
1 Formal Semantics of Programming Languages “Program testing can be used to show the presence of bugs, but never to show their absence!” --Dijkstra.
BAN LOGIC Amit Chetal Monica Desai November 14, 2001
1 Reasoning about Concrete Security in Protocol Proofs A. Datta, J.Y. Halpern, J.C. Mitchell, R. Pucella, A. Roy.
The TAOS Authentication System: Reasoning Formally About Security Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
Lecture 16: Security CDK4: Chapter 7 CDK5: Chapter 11 TvS: Chapter 9.
Digital Signatures, Message Digest and Authentication Week-9.
Correctness Proofs and Counter-model Generation with Authentication-Protocol Logic Koji Hasebe Mitsuhiro Okada Department of Philosophy, Keio University.
6 June Lecture 2 1 TU Dresden - Ws on Proof Theory and Computation Formal Methods for Security Protocols Catuscia Palamidessi Penn State University,
Authenticated Key Exchange I. Definitions I. MAP I. matching conversations II. oracles II. (I)KA II. AKEP2 III. AKEP2 Security I. Session Keys II. Perfect.
13 Aug 2013 Program Verification. Proofs about Programs Why make you study logic? Why make you do proofs? Because we want to prove properties of programs.
Protocol Composition Logic (PCL): Part II Anupam Datta CS 259.
PCL: A Logic for Proving Security of Industrial Network Protocols Anupam Datta CMU May 2007.
This Week Lecture on relational semantics Exercises on logic and relations Labs on using Isabelle to do proofs.
1 Secure Key Exchange: Diffie-Hellman Exchange Dr. Rocky K. C. Chang 19 February, 2002.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Protocol Composition Logic II
Logic for Computer Security Protocols
Just Fast Keying (JFK) Protocol
Axiomatic semantics Points to discuss: The assignment statement
Protocol Composition Logic (PCL)
Protocol Verification by the Inductive Method
Logic for Computer Security Protocols
CDK4: Chapter 7 CDK5: Chapter 11 TvS: Chapter 9
An Executable Model for Security Protocol JFKr
CDK: Chapter 7 TvS: Chapter 9
Protocol Verification by the Inductive Method
Presentation transcript:

Compositional Protocol Logic CS 395T

Outline uFloyd-Hoare logic of programs Compositional reasoning about properties of programs uDDMP protocol logic Developed by Datta, Derek, Mitchell, and Pavlovic for logical reasoning about security properties

Floyd-Hoare Logic uMain idea: before-after assertions F G –If F is true before executing P, then G is true after uTotal correctness or partial correctness Total correctness: F [P] G –If F is true, then P will halt and G will be true Partial correctness: F {P} G –If F is true and if P halts, then G will be true

While Programs P ::= x := e | P ; P | if B then P else P | while B do P where x is any variable e is any integer expression B is a Boolean expression (true or false)

Assignment and Rule of Consequence uAssignment axiom: F(t) { x := t } F(x) If F holds for t, and t is assigned to x, then F holds for x aftewards This assumes that there is no aliasing! Examples: 7=7 { x := 7 } x=7 (y+1)>0 { x := y+1 } x>0 x+1=2 { x := x+1 } x=2 uRule of consequence: If F { P } G and F’  F and G  G’, then F’ { P } G’

Simple Examples uAssertion: y>0 { x := y+1 } x>0 Proof: (y+1)>0 { x := y+1 } x>0 (assignment axiom) y>0 { x := y+1 } x>0 (rule of consequence) uAssertion: x=1 { x := x+1 } x=2 Proof: x+1=2 { x := x+1 } x=2 (assignment axiom) x=1 { x := x+1 } x=2 (rule of consequence) y>0  y+1>0

Conditional F & B { P } G F &  B { Q } G F { if B then P else Q } G Example: true { if y  0 then x := y else x := -y } x  0

Sequence F { P } G G { Q } H F { P; Q } H Example: x=0 { x := x+1 ; x := x+1 } x=2

Loop Invariant F & B { P } F F { while B do P } F &  B Example: true { while x  0 do x := x-1 } x=0 F is the loop invariant; it should hold before and after the loop body

Example: Compute d=x-y uAssertion: y  x {d:=0; while (y+d)<x do d := d+1} y+d=x uProof: Choose loop invariant F = y+d  x y+d  x & B {Q} y+d  x y+d  x {while B do Q} y+d  x &  B –Important: proving a property of the entire loop has been reduced to proving a property of one iteration of the loop To prove y+d  x & B {Q} y+d  x, use assignment axiom and sequence rule PBQ After loop execution, y+d  x &  (y+d<x), thus y+d=x

Goal: Logic for Security Protocols u“Floyd-Hoare” reasoning about security properties Would like to derive global properties of protocols from local assertions about each protocol participant Use a rigorous logical framework to formalize the reasoning that each participant carries out uCompositionality is important Security properties must hold even if the protocol is executed in parallel with other protocols Compositionality is the main advantage of process calculi and protocol logics

Intuition uReason about local information I chose a fresh, unpredictable number I sent it out encrypted I received it decrypted Therefore: someone decrypted it uIncorporate knowledge about protocol into reasoning According to the protocol specification, server only sends m if it received m’ If server not corrupt and I receive m signed by server, then server received m’ A {N a } pk(B) NaNa

Alice’s “View” of the Protocol Honest principals, attacker Protocol spec Private data Sent and received messages

Example: Challenge-Response AB m, A n, sig B {m, n, A} sig A {m, n, B} uAlice’s reasoning: If Bob is honest, then only Bob can generate his signature If honest Bob generates a signature of the form sig B {m, n, A}, then 1.Bob must have received m, A from Alice 2.Bob sent sig B {m, n, A} as part of his 2 nd message uAlice concludes: Received(B,msg1) & Sent(B,msg2) protocol-independent reasoning protocol-specific reasoning

Protocol Composition Logic uA formal language for describing protocols Terms and actions instead of informal arrows-and- messages notation uOperational semantics Describe how the protocol executes uProtocol logic State security properties (in particular, secrecy and authentication) uProof system Axioms and inference rules for formally proving security properties [Datta et al.]

Terms t ::=c |constant x |variable N |name K |key t, t |tuple sig K {t} |signature enc K {t}encryption

Actions new mgenerate fresh value send U, V, tsend term t from U to V receive U, V, xreceive term and assign into variable x match t/p(x)match term t against pattern p(x) uA thread is a sequence of actions Defines the “program” for a protocol participant, i.e., what messages he sends and receives and the checks he performs For notational convenience, omit “match” actions –Write “receive sig B {A, n}” instead of “receive x; match x/sig B {A, n}”

Challenge-Response Threads InitCR(A, X) = [ new m; send A, X, {m, A}; receive X, A, {x, sig X {m, x, A}}; send A, X, sig A {m, x, X}; ] RespCR(B) = [ receive Y, B, {y, Y}; new n; send B, Y, {n, sig B {y, n, Y}}; receive Y, B, sig Y {y, n, B}; ] AB m, A n, sig B {m, n, A} sig A {m, n, B}

Execution Model uA protocol is a finite set of roles Initial configuration specifies a set of principals and keys; assignment of  1 role to each principal uA run is a concurrent execution of the roles Models a protocol session Send and receive actions are matched up new x send{x} B receive{x} B A B C Position in run receive{z} B new z send{z} B

Action Formulas uPredicates over action sequences a ::= Send(X,m) | Message m was sent in thread X Receive(X,m) | Message m was received in thread X New(X,t) | Term t was generated as new in X Decrypt(X,t) | Term t was decrypted in thread X Verify(X,t) Term t was verified in X

Formulas  ::= a | Action formula Has(X,m)| Thread X created m or received a message containing m and has keys to extract m from the message Fresh(X,t)| Term t hasn’t been “seen” outside X Honest(N)| Principal N follows protocol rules in all of its threads Contains(t,t’) | Term t contains subterm t’  |  1   2 |  x  |   |   Temporal logic operators on past actions Modal operator [actions] X  After actions, X reasons   was true

Trace Semantics uProtocol Q Defines a set of roles (e.g., initiator and responder) uRun R Sequence of actions by principals following protocol roles and the attacker (models a protocol session) uSatisfaction Q, R |  [ actions ] P  –Some role of principal P in R performs exactly actions and  is true in the state obtained after actions complete Q |  [ actions ] P  –Q, R |  [ actions ] P  for all runs R of Q

Specifying Authentication uInitiator authentication in Challenge-Response CR |  [ InitCR(A, B) ] A Honest(B)  ActionsInOrder( Send(A, {A,B,m}), Receive(B, {A,B,m}), Send(B, {B,A,{n, sig B {m, n, A}}}), Receive(A, {B,A,{n, sig B {m, n, A}}}) ) After initiator executes his programIf B is honest… …then msg sends and receives must have happened in order prescribed by protocol spec

Specifying Secrecy uShared secret in key establishment KE |  [ InitKE(A, B) ] A Honest(B)  (Has(X, m)  X=A  X=B ) After initiator executes his programIf B is honest… … then if some party X knows secret m, then X can only be either A, or B

Proof System uGoal: formally prove properties of security protocols uAxioms are simple formulas Provable by hand uInference rules are proof steps uTheorem is a formula obtained from axioms by application of inference rules

Sample Axioms uNew data [ new x ] P Has(P,x) [ new x ] P Has(Y,x)  Y=P uAcquiring new knowledge [ receive m ] P Has(P,m) uPerforming actions [ send m ] P  Send(P,m) [ match x/sig X {m} ] P  Verify(P,m)

Reasoning About Cryptography uPairing Has(X, {m,n})  Has(X, m)  Has(X, n) uSymmetric encryption Has(X, enc K (m))  Has(X, K -1 )  Has(X, m) uPublic-key encryption Honest(X)   Decrypt(Y, enc X {m})  X=Y uSignatures Honest(X)   Verify(Y, sig X {m})   m’ (  Send(X, m’)  Contains(m’, sig X {m})

Sample Inference Rules [ actions ] P Has(X, t) [ actions; action ] P Has(X, t) [ actions ] P  [ actions ] P  [ actions ] P   

Honesty Rule  roles R of Q.  initial segments A  R. Q |- [ A ] X  Q |- Honest(X)   Finitary rule (finite number of premises to choose from) –Typical protocol has 2-3 roles, typical role has 1-3 actions Example: –If Honest(X)  (Sent(X,m)  Received(X,m’)) and Y receives a message from X, then Y can conclude Honest(X)  Received(X,m’)

Correctness of Challenge-Response CR |- [ InitCR(A, B) ] A Honest(B)  ActionsInOrder( Send(A, {A,B,m}), Receive(B, {A,B,m}), Send(B, {B,A,{n, sig B {m, n, A}}}), Receive(A, {B,A,{n, sig B {m, n, A}}}) ) InitCR(A, X) = [ new m; send A, X, {m, A}; receive X, A, {x, sig X {m, x, A}}; send A, X, sig A {m, x, X}; ] RespCR(B) = [ receive Y, B, {y, Y}; new n; send B, Y, {n, sig B {y, n, Y}}; receive Y, B, sig Y {y, n, B}}; ]

1: A Reasons about Own Actions CR |- [ InitCR(A, B) ] A  Verify(A, sig B {m, n, A}) InitCR(A, X) = [ new m; send A, X, {m, A}; receive X, A, {x, sig X {m, x, A}}; send A, X, sig A {m, x, X}; ] RespCR(B) = [ receive Y, B, {y, Y}; new n; send B, Y, {n, sig B {y, n, Y}}; receive Y, B, sig Y {y, n, B}; ] If A completed a protocol session, it must have verified B’s signature at some point

2: Properties of Signatures CR |- [ InitCR(A, B) ] A Honest(B)   t’ (  Send(B, t’)  Contains(t’, sig B {m, n, A}) InitCR(A, X) = [ new m; send A, X, {m, A}; receive X, A, {x, sig X {m, x, A}}; send A, X, sig A {m, x, X}; ] RespCR(B) = [ receive Y, B, {y, Y}; new n; send B, Y, {n, sig B {y, n, Y}}; receive Y, B, sig Y {y, n, B}; ] If A completed protocol and B is honest, then B must have sent its signature as part of some message

This condition disambiguates sig x (…) sent by responder from sig A (…) sent by initiator Honesty Invariant CR |- Honest(X)   Send(X, t’)  Contains(t’, sig x {y, x, Y})    New(X, y)   Receive(X, {Y, X, {y, Y}}) InitCR(A, X) = [ new m; send A, X, {m, A}; receive X, A, {x, sig X {m, x, A}}; send A, X, sig A {m, x, X}; ] RespCR(B) = [ receive Y, B, {y, Y}; new n; send B, Y, {n, sig B {y, n, Y}}; receive Y, B, sig Y {y, n, B}; ] Honest responder only sends his signature if he received a properly formed first message of the protocol

Reminder: Honesty Rule  roles R of Q.  initial segments A  R. Q |- [ A ] X  Q |- Honest(X)  

3: Use Honesty Rule CR |- [ InitCR(A, B) ] A Honest(B)   Receive(B, {A,B,{m,A}}) InitCR(A, X) = [ new m; send A, X, {m, A}; receive X, A, {x, sig X {m, x, A}}; send A, X, sig A {m, x, X}; ] RespCR(B) = [ receive Y, B, {y, Y}; new n; send B, Y, {n, sig B {y, n, Y}}; receive Y, B, sig Y {y, n, B}; ] If A completed protocol and B is honest, then B must have received A’s first message

4: Nonces Imply Temporal Order CR |- [ InitCR(A, B) ] A Honest(B)  ActionsInOrder(…) InitCR(A, X) = [ new m; send A, X, {m, A}; receive X, A, {x, sig X {m, x, A}}; send A, X, sig A {m, x, X}; ] RespCR(B) = [ receive Y, B, {y, Y}; new n; send B, Y, {n, sig B {y, n, Y}}; receive Y, B, sig Y {y, n, B}; ]

Complete Proof

Properties of Proof System u Soundness If  is a theorem, then  is a valid formula –Q |-  implies Q |=  Informally: if we can prove something in the logic, then it is actually true uProved formula holds in any step of any run There is no bound on the number of sessions! Unlike finite-state checking, the proved property is true for the entire protocol, not for specific session(s)

Weak Challenge-Response AB m n, sig B {m, n} sig A {m, n} InitWCR(A, X) = [ new m; send A, X, {m}; receive X, A, {x, sig X {m, x}}; send A, X, sig A {m, x}; ] RespWCR(B) = [ receive Y, B, {y}; new n; send B, Y, {n, sig B {y, n}}; receive Y, B, sig Y {y, n}; ]

1: A Reasons about Own Actions InitWCR(A, X) = [ new m; send A, X, {m}; receive X, A, {x, sig X {m, x}}; send A, X, sig A {m, x}; ] RespWCR(B) = [ receive Y, B, {y}; new n; send B, Y, {n, sig B {y, n}}; receive Y, B, sig Y {y, n}; ] WCR |- [ InitWCR(A, B) ] A  Verify(A, sig B {m, n})

2: Properties of Signatures InitWCR(A, X) = [ new m; send A, X, {m}; receive X, A, {x, sig X {m, x}}; send A, X, sig A {m, x}}; ] RespWCR(B) = [ receive Y, B, {y}; new n; send B, Y, {n, sig B {y, n}}; receive Y, B, sig Y {y, n}}; ] WCR |- [ InitWCR(A, B) ] A Honest(B)   t’ (  Send(B, t’)  Contains(t’, sig B {m, n})

Honesty Invariant InitWCR(A, X) = [ new m; send A, X, {m}; receive X, A, {x, sig X {m, x}}; send A, X, sig A {m, x}; ] RespWCR(B) = [ receive Y, B, {y}; new n; send B, Y, {n, sig B {y, n}}; receive Y, B, sig Y {y, n}; ] WCR |- Honest(X)   Send(X, t’)  Contains(t’, sig x {y, x})    New(X, y)   Receive(X, {Y, X, {y}}) In this protocol, sig x {y,x} does not explicitly include identity of intended recipient Y

3: Use Honesty Rule InitWCR(A, X) = [ new m; send A, X, {m}; receive X, A, {x, sig X {m, x}}; send A, X, sig A {m, x}; ] RespWCR(B) = [ receive Y, B, {y}; new n; send B, Y, {n, sig B {y, n}}; receive Y, B, sig Y {y, n}; ] WCR |- [ InitWCR(A, B) ] A Honest(B)   Receive(B, {Y,B,sig Y {y,n}}) B receives 3 rd message from someone, not necessarily A

Failed Proof and Counterexample uWCR does not provide the strong authentication property for the initiator uCounterexample: intruder can forge sender’s and receiver’s identity in first two messages A -> X(B) A, B, m X(C) -> B C, B, m [X pretends to be C] B -> X(C) n, sig B (m, n) X(B) -> A n, sig B (m, n)

Further Work on Protocol Logic uSee papers by Datta, Derek, Mitchell, and Pavlovic on the course website With a Diffie-Hellman primitive, prove authentication and secrecy for key exchange (STS, ISO ) With symmetric encryption and hashing, prove authentication for ISO , SKID3 uWork on protocol derivation Build protocols by combining standard parts –Similar to the derivation of JFK described in class Reuse proofs of correctness for building blocks –Compositionality pays off!