Logic for Computer Security Protocols John Mitchell Stanford University.

Slides:



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

Semantics Static semantics Dynamic semantics attribute grammars
Last Class: The Problem BobAlice Eve Private Message Eavesdropping.
Reasoning About Code; Hoare Logic, continued
Hoare’s Correctness Triplets Dijkstra’s Predicate Transformers
11111 Functional Program Verification CS 4311 A. M. Stavely, Toward Zero Defect Programming, Addison-Wesley, Y. Cheon and M. Vela, A Tutorial on.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 9,10,11- Logic; Deduction Theorem 23/1/09 to 30/1/09.
Non-monotonic Properties for Proving Correctness in a Framework of Compositional Logic Koji Hasebe Mitsuhiro Okada (Dept. of Philosophy, Keio University)
David Evans CS655: Programming Languages University of Virginia Computer Science Lecture 19: Minding Ps & Qs: Axiomatic.
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.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
Formal Derivation of Security Protocols Anupam DattaAnte Derek John C. Mitchell Dusko Pavlovic Stanford University Kestrel Institute HCSS April 15, 2004.
Compositional Protocol Logic CS 395T. Outline uFloyd-Hoare logic of programs Compositional reasoning about properties of programs uDDMP protocol logic.
Analysis of Security Protocols (I) John C. Mitchell Stanford University.
Formally (?) Deriving Security Protocols Anupam Datta WIP with Ante Derek, John Mitchell, Dusko Pavlovic October 23, 2002.
Authentication John C. Mitchell Stanford University CS 99j.
Abstraction and Refinement in Protocol Derivation Anupam DattaAnte Derek John C. Mitchell Dusko Pavlovic Stanford University Kestrel Institute CSFW June.
Symbolic Logic for Complexity- theoretic Model of Security Protocols Anupam Datta Ante Derek John C. Mitchell Vitaly Shmatikov Mathieu Turuani May 5, 2005.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 7 Wenbing Zhao Department of Electrical and Computer Engineering.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
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.
Slide 1 Vitaly Shmatikov CS 378 Key Establishment Pitfalls.
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,
Software Verification Bertrand Meyer Chair of Software Engineering Lecture 2: Axiomatic semantics.
Protocol Composition Logic John Mitchell Stanford TECS Week2005.
Logic for Protocol Composition A. Datta, A. Derek, J. Mitchell, D. Pavlovic.
Describing Syntax and Semantics
Logics for Security Protocols Anupam Datta Fall A: Foundations of Security and Privacy.
1 CS 194: Distributed Systems Security Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer Sciences.
THE TRANSITION FROM ARITHMETIC TO ALGEBRA: WHAT WE KNOW AND WHAT WE DO NOT KNOW (Some ways of asking questions about this transition)‏
1 Authentication Protocols Celia Li Computer Science and Engineering York University.
Contract-Signing Protocols J. Mitchell CS 259. Revised schedule uTuesday 1/24 Contract-signing protocols uThursday 1/26 Secure hardware architecture (XOM)
Lecture #12 Distributed Algorithms (I) CS492 Special Topics in Computer Science: Distributed Algorithms and Systems.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
Analysis of a Fair Exchange Protocol Vitaly Shmatikov John Mitchell Stanford University.
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.
Security protocols  Authentication protocols (this lecture)  Electronic voting protocols  Fair exchange protocols  Digital cash protocols.
Computer Science School of Computing Clemson University Discrete Math and Reasoning about Software Correctness Joseph E. Hollingsworth
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.
MATH 224 – Discrete Mathematics
Correctness Proofs and Counter-model Generation with Authentication-Protocol Logic Koji Hasebe Mitsuhiro Okada Department of Philosophy, Keio University.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
CS4026 Formal Models of Computation Part II The Logic Model Lecture 2 – Prolog: History and Introduction.
6 June Lecture 2 1 TU Dresden - Ws on Proof Theory and Computation Formal Methods for Security Protocols Catuscia Palamidessi Penn State University,
Program Analysis and Verification Spring 2014 Program Analysis and Verification Lecture 4: Axiomatic Semantics I Roman Manevich Ben-Gurion University.
CS 395T Game-Based Verification of Contract Signing Protocols.
Alternating Temporal Logic and Game-Based Properties CS 259 John Mitchell with slides from Vitaly Shmatikov.
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.
Identify Friend or Foe (IFF) Chapter 9 Simple Authentication protocols Namibia Angola 1. N 2. E(N,K) SAAF Impala Russian MIG 1 Military needs many specialized.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Protocol Composition Logic II
Great Theoretical Ideas in Computer Science
Logic for Computer Security Protocols
Axiomatic semantics Points to discuss: The assignment statement
Programming Languages and Compilers (CS 421)
Protocol Composition Logic (PCL)
Programming Languages 2nd edition Tucker and Noonan
Protocol Verification by the Inductive Method
Logic for Computer Security Protocols
Efficient Short-Password Key Exchange (ESP-KE)
Predicate Transformers
Protocol Verification by the Inductive Method
Programming Languages and Compilers (CS 421)
Formal Methods for Security Protocols
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

Logic for Computer Security Protocols John Mitchell Stanford University

Outline uPerspective Math foundations vs computer science uMotivating example Floyd-Hoare logic of programs uSecurity protocols Examples of protocols Toward logics of security protocols

This is a logic conference … uGeneral properties of logical systems First-order logic –Model theory Constructive logic –Proof theory uSpecific theories Set theory –Large cardinals, independence results, …

“All mathematics is set theory” uNumbers represented as sets “There is only one principle of induction, induction on the integers… That’s what the axiom is.” – P. Cohen uEvery other mathematical thing is represented using sets Functions, graphs, algebraic structures, geometry (?), … Platonic universe = Set theory ?

CS View uNumbers are a special case Sets are a special case too, but less important since sets are unordered uMany other important structures Data structures –Lists, Trees, Graphs, … Algorithmic concepts –Programs, Functions, Objects, …

Some CS Goals uGeneral theories Frameworks for defining and reasoning about computational concepts –Data structures and computations –Numbers and sets could be examples in the framework, but not especially important uSpecific theories Logic of simple imperative programs Logic of recursive functional programs Data type specification and refinement

Disclaimer/Context (Digression) uTheoretical computer science Quantitative theory – how many steps –Algorithm design and Complexity theory –Dominant subject in US computer science Qualitative theory - understand computational universe and its properties –Programming languages and semantics –Logics for specification and verification

Part II Logic of programs Historical references: Floyd, … Hoare, …

Before-after assertions uMain idea F G –If F is true before executing P, then G after uTwo variants Total correctness F [P] G –If F before, then P will halt with G Partial correctness F {P} G –If F before, and if P halts, then G

While programs uPrograms 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)

Assertion about assignment uAssignment axiom F(t) { x := t } F(x) uExamples 7=7 { x := 7 } x=7 (y+1)>0 { x := y+1 } x>0 x+1=2 { x := x+1 } x=2 This is not most general case. Need to assume no aliasing…

Rule of consequence uIf F { P } G uAnd F’  F and G  G’ uThen F’ { P } G’

Example uAssertion y>0 { x := y+1 } x>0 uProof (y+1)>0 { x := y+1 } x>0 (assignment axiom) y>0 { x := y+1 } x>0 (consequence) uAssertion x=1 { x := x+1 } x=2 uProof x+1=2 { x := x+1 } x=2 (assignment axiom) x=1 { x := x+1 } x=2 (consequence)

Conditional F  B { P 1 } G F  B {P 2 } G F { if B then P 1 else P 2 } G uExample true { if y  0 then x := y else x := -y } x  0

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

Loop Invariant F  B { P } F F { while B do P } F  B uExample true { while x  0 do x := x-1 } x=0

Example: Compute d=x-y uAssertion y  x {d:=0; while (y+d)<x do d := d+1} y+d=x uMain ideas in proof Choose loop invariant y+d  x y+d  x  B {P 1 } y+d  x y+d  x {while B do P 1 } y+d  x  B Use assignment axiom and sequence rule to complete the proof of property of P 1 P0P0 BP1P1

Facts about Hoare logic uCompositional Proof follows structure of program uSound u“Relative completeness” Properties of computation over N provable from properties of N Some technical issues … uImportant concept: Loop invariant !!! Common practice beyond Hoare logic

Part III Protocol Examples Warning: bait and switch

Contract signing uBoth parties want to sign a contract uNeither wants to commit first Immunity deal

General protocol outline uTrusted third party can force contract Third party can declare contract binding if presented with first two messages. AB I am going to sign the contract Here is my signature

B A m1= sign(A,  c, hash(r_A)  ) sign(B,  m1, hash(r_B)  ) r_A r_B Agree A B Network T Abort ??? ResolveAttack? B A Net T sig T (m 1, m 2 ) m1m1 ??? m2m2 A T Asokan-Shoup-Waidner protocol If not already resolved a 1 sig T (a 1,abort)

Needham-Schroeder Key Exchange { A, Nonce a } { Nonce a, Nonce b } { Nonce b } KaKa Kb Result: A and B share two private numbers not known to any observer without Ka -1, Kb -1 AB Kb

Anomaly in Needham-Schroeder AE B { A, N a } { N a, N b } { N b } Ke Kb Ka Ke Evil agent E tricks honest A into revealing private key N b from B. Evil E can then fool B. [Lowe]

Analysis Methods uSimplified model Exhaustive search methods –Limited to finite model Grungy proof methods based on traces –Isabelle, etc; Attempts to identify reasoning methods uNot so simple model Ad hoc proofs Attempts to identify reasoning methods

Part IV A Logic for Security Protocols work with N. Durgin, D. Pavlovic

Intuition uReason about local information I chose a new number I sent it out encrypted I received it decrypted Therefore: someone decrypted it uIncorporate knowledge about protocol Protocol: Server only sends m if sent m’ If server not corrupt and I receive m signed by server, then server received m’

Intuition: Picture uAlice’s information Protocol Private data Sends and receives Honest Principals, Attacker Protocol Send Receive

Logical assertions uModal operator [ actions ] P  - after actions, P reasons  uPredicates in  Sent(X,m) - principal X sent message m Created(X,m) – X assembled m from parts Decrypts(X,m) - X has m and key to decrypt m Knows(X,m) - X created m or received msg containing m and has keys to extract m from msg Source(m, X, S) – Y  X can only learn m from set S Honest(X) – X follows rules of protocol

Semantics uProtocol Q Defines set of roles (e.g, initiator, responder) Run R of Q is sequence of actions by principals following roles, plus attacker uSatisfaction Q, R |  [ actions ] P  Some role of P in R does exactly actions and  is true in state after actions completed Q |  [ actions ] P  Q, R |  [ actions ] P  for all runs R of Q Formula is [ actions ] P  where  has no [ …] P’

Sample axioms about actions uNew data [ new x ] P Knows(P,x) [ new x ] P Knows(Y,x)  Y=P uSend [ send m ] P Sent(P,m) uReceive [recv m] P Knows(P,m) uDecyption [x := decrypt(k,encrypt(k,m))] P Decrypts(P, encrypt(k,m))

Reasoning about “Knows” uPairing Knows(X,  m,n  )  Knows(X, m)  Knows(X, n) uEncryption Knows(X, encrypt(k,m))  Knows(X, k -1 )  Knows(X, m)

Source predicate uNew data [ new x ] P Source(x,P,{ }) uMessage [ acts ] P Source(x,Q,S) [ acts; send m] P Source(x,Q,S  {m}) uReasoning Source{m,X,{ encrypt(k,m) })  Knows(Y,m)  Y  X   Z. Decrypts(Z, encrypt(k,m) )

Bidding conventions (motivation) uBlackwood response to 4NT –5  : 0 or 4 aces –5  : 1 ace –5 : 2 aces –5  : 3 aces uReasoning If my partner is following Blackwood, then if she bid 5, she must have 2 aces

Honesty rule (rule scheme)  roles R of Q.  initial segments A  R. Q |- [ A ] X  Q |- Honest(X)   This is a finitary rule: –Typical protocol has 2-3 roles –Typical role has 1-3 receives –Only need to consider A waiting to receive

Honesty hypotheses for NSL [ new m; send encrypt( Key(Y),  X,m  ) ] X  [ new m; send encrypt( Key(Y),  X,m  ); recv encrypt( Key(X),  m, B, n  ); send encrypt( Key(B), n ) ] X  [ ] X  [ recv encrypt( Key(X),  Y,m  ); new n; send encrypt( Key(Y),  m, X, n  ) ] X  [ recv encrypt( Key(B),  A,m  ); new n; send encrypt( Key(A),  m, B, n  ); recv encrypt( Key(B), n ) ] X  “Alice” “Bob”

Honesty rule (example use)  roles R of Q.  initial segments A  R. Q |- [ A ] X  Q |- Honest(X)   Example use: –If Y receives a message from X, and Honest(X)  (Sent(X,m)  Received(X,m’)) then Y can conclude Honest(X)  Received(X,m’))

Benchmarks uCan prove repaired NSL protocol uProof fails for original NS protocol

Correctness of NSL uBob knows he’s talking to Alice [ recv encrypt( Key(B),  A,m  ); new n; send encrypt( Key(A),  m, B, n  ); recv encrypt( Key(B), n ) ] B Honest(A)  Csent(A, msg1)  Csent(A, msg3) where Csent(A, …)  Created(A, …)  Sent(A, …) msg1msg3

Proof uses “honesty rule” uConsequent of honesty rule Honest(A)  Decrypts(A, encrypt( Key(A),  m, B, n  ))  Csent(A, msg1)  Csent(A, msg3) The implication Decrypts(X,…)  Csent(X,…)  Csent(X,…) is an invariant of the protocol. It is true at each waiting state of each role X.

Initiator role OK for NS,NSL uAlice wants similar conclusions, e.g., [ new m; send encrypt( Key(B),  A,m  ); recv encrypt( Key(A),  m, B, n  ); send encrypt( Key(B), n ) ] A Honest(B)  Csent(B, msg2)

Proof uses “honesty rule” uConsequent of honesty rule Honest(X)  Csent(X, encrypt( Key(Y),  m, Z, n  )  X=Z FIX THIS !!! Do not use slide as is!

Failure for “buggy” NS uBob hopes he’s talking to Alice [ recv encrypt( Key(B),  A,m  ); new n; send encrypt( Key(A),  m, B, n  ); recv encrypt( Key(B), n ) ] B Honest(A)  Csent(A, m1(B))  Csent(A, m3(B)) where Csent(A, …)  Created(A, …)  Sent(A, …) m1(B) m3(B)

Attempt use of “honesty rule” uProtocol invariant Honest(A)  Decrypts(A, encrypt( Key(A),  m, B, n  ))  Csent(A, m1(Z))  Csent(A, m3(Z)) Cannot prove Z=B

Status of this logic uJust starting This is a first attempt at a style of protocol logic uLots more to do Work out more examples Simplify the formalism –Express Created using Knows and Sent, Decrypts using Knows, … Refine the proof rules, semantics Make sure others can use this

Conclusion uComputer security is good application People care about correctness Cryptography understood, usage less so uSecurity protocols Simple distributed programs Complexity comes from possible attacks uProposed protocol logic Hide behavior of attacker in model Identify concepts that give understanding