Logic for Computer Security Protocols

Slides:



Advertisements
Similar presentations
Chapter 4: Control Structures I (Selection)
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Program verification: flowchart programs Book: chapter 7.
Program verification: flowchart programs Book: chapter 7.
Semantics Static semantics Dynamic semantics attribute grammars
PZ03D Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03D - Program verification Programming Language Design.
Copyright , Doron Peled and Cesare Tinelli. These notes are based on a set of lecture notes originally developed by Doron Peled at the University.
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
Hoare’s Correctness Triplets Dijkstra’s Predicate Transformers
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
This Week Finish relational semantics Hoare logic Interlude on one-point rule Building formulas from programs.
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.
Predicate Transformers
CSE 331 Software Design & Implementation Dan Grossman Winter 2014 Lecture 2 – Reasoning About Code With Logic 1CSE 331 Winter 2014.
1/22 Programs : Semantics and Verification Charngki PSWLAB Programs: Semantics and Verification Mordechai Ben-Ari Mathematical Logic for Computer.
CS 355 – Programming Languages
Compositional Protocol Logic CS 395T. Outline uFloyd-Hoare logic of programs Compositional reasoning about properties of programs uDDMP protocol logic.
CSE115/ENGR160 Discrete Mathematics 04/12/11 Ming-Hsuan Yang UC Merced 1.
Axiomatic Semantics Dr. M Al-Mulhem ICS
1 Protocols are programs too The meta-heuristic search for security protocols By John A. Clark.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Axiomatic Semantics ICS 535.
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.
Describing Syntax and Semantics
Information Security of Embedded Systems : BAN-Logic Prof. Dr. Holger Schlingloff Institut für Informatik und Fraunhofer FIRST.
Chapter 3 (Part 3): Mathematical Reasoning, Induction & Recursion  Recursive Algorithms (3.5)  Program Correctness (3.6)
Formal Analysis of Security Protocols Dr. Changyu Dong
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
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
CS 363 Comparative Programming Languages Semantics.
Recursive Algorithms &
Program Analysis and Verification Spring 2014 Program Analysis and Verification Lecture 4: Axiomatic Semantics I Roman Manevich Ben-Gurion University.
Semantics In Text: Chapter 3.
Great Theoretical Ideas in Computer Science.
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen.
Network Protocols Network Systems Security Mort Anvari.
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.
Principle of Programming Lanugages 3: Compilation of statements Statements in C Assertion Hoare logic Department of Information Science and Engineering.
Cs7100(Prasad)L18-9WP1 Axiomatic Semantics Predicate Transformers.
1 Section 8.2 Program Correctness (for imperative programs) A theory of program correctness needs wffs, axioms, and inference rules. Wffs (called Hoare.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Chapter 3 of Programming Languages by Ravi Sethi
Gödel's Legacy: The Limits Of Logics
Reasoning About Code.
Great Theoretical Ideas in Computer Science
Mathematical Structures for Computer Science Chapter 1
Lecture 5 Floyd-Hoare Style Verification
Lecture 2: Axiomatic semantics
Axiomatic semantics Points to discuss: The assignment statement
Programming Languages and Compilers (CS 421)
Protocol Composition Logic (PCL)
Semantics In Text: Chapter 3.
Axiomatic Verification I
Predicate Transformers
Functional Program Verification
Axiomatic Semantics Will consider axiomatic semantics (A.S.) of IMP:
Axiomatic Verification I
Program correctness Axiomatic semantics
CSCE 715: Network Systems Security
Lecture 2: Axiomatic semantics
CIS 720 Lecture 3.
Programming Languages and Compilers (CS 421)
CIS 720 Lecture 3.
COP4020 Programming Languages
Program Correctness an introduction.
Presentation transcript:

Logic for Computer Security Protocols John Mitchell Stanford University

Outline Example BAN logic Current Protocol Logic Floyd-Hoare logic of programs BAN logic Current Protocol Logic

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

Before-after assertions Main idea F <P> G If F is true before executing P, then G after Two 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 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)

Assertion about assignment Assignment axiom F(t) { x := t } F(x) Examples 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 If And Then F { P } G F’  F and G  G’

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

Conditional Example F  B { P1 } G F B {P2 } G F { if B then P1 else P2 } G Example true { if y  0 then x := y else x := -y } x  0

Sequence Example F { P1 } G G { P2 } H F { P1; P2 } H x=0 { x := x+1 ; x := x+1 } x=2

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

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

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

Part II BAN Logic

There is something called BAN Needham “The main contribution of BAN logic was to make the study of 3-line protocols intellectually respectable.” Paper, A Logic of Authentication", ACM Transactions on Computer Systems, Vol. 8, No. 1, pp. 18-36, February 1990.

Using BAN Logic Protocol expressed in “idealized” form Identify initial assumptions in the language of BAN logic Use postulates and rules of BAN logic to deduce new predicate

Notation P |X: P believes X P X: P sees X P would be entitled to believe X. The principal P may act as though X is true. P X: P sees X P can read the contents of X (possibly after decryption, assuming P has the needed keys) P can include X in messages to other principals

BAN Logic P |~ X P once said X P | X P controls X #(X) X is fresh P sent a message including the statement X. Possibly in the past or in the current run of the protocol P believed that X was true when it send the message P | X P controls X P has jurisdiction over X P is a trusted authority on the truth of X. #(X) X is fresh The present begins with the start of the current execution of the current protocol X is fresh if it is not contained in any message in the past

BAN Logic K P  Q: K is a shared key for P and Q. K is a secure key for communication between P and Q K will never be discovered by any principal except for P or Q, or a principal trusted by either P or Q. | P K is a public key for P The matching secret key (the inverse of K, denoted by K-1) will never be discovered by any principal except P, or a principals trusted by P