The Formal Method CAPSL Kyle Taylor Zhenxiao Yang.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

CPSC 388 – Compiler Design and Construction
Semantics Static semantics Dynamic semantics attribute grammars
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.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Lecture 3Dr. Verma1 COSC 6397 – Information Assurance Module M2 – Protocol Specification and Verification University of Houston Rakesh Verma Lecture 3.
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)
Luu Anh Tuan. Security protocol Intruder Intruder behaviors Overhead and intercept any messages being passed in the system Decrypt messages that are.
August Moscow meeting1August Moscow meeting1August Moscow meeting11 Deductive tools in insertion modeling verification A.Letichevsky.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
ISBN Chapter 3 Describing Syntax and Semantics.
Fall Semantics Juan Carlos Guzmán CS 3123 Programming Languages Concepts Southern Polytechnic State University.
CS 355 – Programming Languages
1 Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications.
Formally (?) Deriving Security Protocols Anupam Datta WIP with Ante Derek, John Mitchell, Dusko Pavlovic October 23, 2002.
1 Semantic Processing. 2 Contents Introduction Introduction A Simple Compiler A Simple Compiler Scanning – Theory and Practice Scanning – Theory and Practice.
Chapter 3 Program translation1 Chapt. 3 Language Translation Syntax and Semantics Translation phases Formal translation models.
CSE Michigan State University Extensions of BAN by Heather Goldsby Michelle Pirtle.
©Ian Sommerville 2000Software Engineering, 6/e, Chapter 91 Formal Specification l Techniques for the unambiguous specification of software.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Axiomatic Semantics ICS 535.
© 2005 The MITRE Corporation. All rights reserved For Internal MITRE Use Alice & Bob Specifications Jon Millen June 2005.
Progress Report on Java Based Protocol Analysis Presented by Stephen W. Mancini, 1Lt, USAF/AFIT Robert P. Graham, MAJ, USAF/AFIT Presentation date: 09.
Describing Syntax and Semantics
Syntax & Semantic Introduction Organization of Language Description Abstract Syntax Formal Syntax The Way of Writing Grammars Formal Semantic.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 9 Slide 1 Formal Specification l Techniques for the unambiguous specification of software.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 2.
BAN LOGIC Amit Chetal Monica Desai November 14, 2001
PART I: overview material
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
Muhammad Idrees Lecturer University of Lahore 1. Outline Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute.
Formal Specification of Intrusion Signatures and Detection Rules By Jean-Philippe Pouzol and Mireille Ducassé 15 th IEEE Computer Security Foundations.
Correctness Proofs and Counter-model Generation with Authentication-Protocol Logic Koji Hasebe Mitsuhiro Okada Department of Philosophy, Keio University.
Review: Compiler Phases: Source program Lexical analyzer Syntax analyzer Semantic analyzer Intermediate code generator Code optimizer Code generator Symbol.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
ISBN Chapter 3 Describing Semantics.
Chapter 3 Part II Describing Syntax and Semantics.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Semantics In Text: Chapter 3.
1 CSC384: Intro to Artificial Intelligence Lecture 5.  Knowledge Representation.
Compiler Construction By: Muhammad Nadeem Edited By: M. Bilal Qureshi.
1 A Simple Syntax-Directed Translator CS308 Compiler Theory.
UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine1 CSE 503 – Software Engineering Lecture 3: An introduction to Alloy Rob DeLine 5 Apr 2004.
CS412/413 Introduction to Compilers Radu Rugina Lecture 13 : Static Semantics 18 Feb 02.
Programming Languages and Design Lecture 2 Syntax Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
1-1 An Introduction to Logical Programming Sept
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
C H A P T E R T W O Linking Syntax And Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications Chapter.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Syntax Analysis Or Parsing. A.K.A. Syntax Analysis –Recognize sentences in a language. –Discover the structure of a document/program. –Construct (implicitly.
Defects of UML Yang Yichuan. For the Presentation Something you know Instead of lots of new stuff. Cases Instead of Concepts. Methodology instead of the.
CS 326 Programming Languages, Concepts and Implementation
Introduction to Parsing (adapted from CS 164 at Berkeley)
Logical architecture refinement
Logic for Computer Security Protocols
Semantics In Text: Chapter 3.
Efficient Short-Password Key Exchange (ESP-KE)
Chapter 3 Describing Syntax and Semantics.
High-Level Programming Language
Faculty of Computer Science and Information System
Presentation transcript:

The Formal Method CAPSL Kyle Taylor Zhenxiao Yang

CAPSL Common Authentication Protocol Specification Language Message list protocol description A B: {A, N a } PB B A: {N a, N b } PA A B: {N b } PB AB {A, N a } PB {N a, N b } PA {N b } PB

Overview

CAPSL Notation Declarations – Imports – Types – Variables – Functions – Constants Modules – Typespec – Protocol – Environment

Typespec Introduce New Types Define Functions for a Type Extend Existing Types Syntax – Declarations – Axioms TYPESPEC PPK; IMPORTS SPKE; TYPES PKUser : Principal Functions pk(PKUser): Pkey; sk(PKUser): Pkey, PRIVATE; VARIABLES A: PKUser; X: Field; Axioms ped(sk(A), ped(pk(A), X)) = X; ped(pk(A), ped(sk(A), X)) = X; INVERT ped(pk(A), X): X | sk(A); INVERT ped(sk(A), X): X | pk(A);

Protocol The Message List Syntax – Declaration – Assumptions – Messages – Goals PROTOCOL Simple; VARIABLES A, B: Principal; K: Skey, FRESH, CRYPTO; F: Field; ASSUMPTIONS HOLDS A: B; MESSAGES A -> B: {A,K}pk(B); GOALS SECRET K;

Protocol Declaration and Assumptions Declaration – Denotes Allows a variable to be defined as the value of an expression Assumptions – Boolean-valued terms or equalities – BELIEVES Used to indicate a initial belief – HOLDS Used to indicate knowledge of another entity – KNOWS Belief plus truth Example: BELIEVES A : BELIEVES B : HOLDS A : K

Protocol Messages Message Format – id. sender -> receiver : field, …; Concatenation of Fields – {,} denotes associative concatenation – [,] denotes non-associative concatenation Encryption – Built in functions ped(), pk(), se(), sd() – {A, K}pk(B) == ped(pk(B), {A, K}) – {X}K == se(K, X) and {X}’K == sd(K, X)

Protocol Messages Continued Arithmetic – Allows +, -, *, /, and ^ with built in type Skey %-operator – Distinguishes between the senders and the receivers view of a message – {A%B, C%D} Sender constructs {A, C} Receiver constructs {B, D}

Protocol Messages Continued Actions – Assignment or comparison test – Assume and Prove Assumptions and Goals that are associated with intermediate states rather than initial and final states Phrases – Phrase = message + actions before and after it – “/” used to separate receiver actions from sender actions A -> B: X; X < Y;/ A -> C: Z;

Protocol Messages Continued Subprotocols – A protocol may invoke a different protocol using the INCLUDE P; – No statements may follow and INCLUDE Conditional Selection – IF A=B THEN INCLUDE P2; – ELSE INCLUDE P3; ENDIF;

Protocol Goals States security objectives SECRET V : P 1, … – Variable V is a secret shared only by P 1, … PRECEDES A : B | V 1, V 2 – If B reaches its final state, it agrees with A on V 1, V 2 AGREE A, B : V 1, … | W 1, … – If A and B agree on W 1 then they must agree on V 1

Environment Used for setup Syntax – Declaration – Agent Define Roles – Exposed Defines initial knowledge of an attacker – Axioms Defines assumptions about constants – Order Species series parrallel sequencing of agents ENVIORNMENT Test IMPORTS NSPK; CONSTANTS Alice, Bob: PKUser; Mallory: PKUser, EXPOSED; AGENT A1 HOLDS A = Alice; B = Bob; AGENT B1 HOLDS B = Bob; EXPOSED {Bob}sk(Alice); END;

Needham-Schroeder Public Key Handshake ENVIORNMENT Test IMPORTS NSPK; CONSTANTS Alice, Bob: PKUser; Mallory: PKUser, EXPOSED; AGENT A1 HOLDS A = Alice; B = Bob; AGENT B1 HOLDS B = Bob; EXPOSED {Bob}sk(Alice); END; PROTOCOL NSPK; Variables A, B: PKUser; Na, Nb: Nonce, CRYPTO; ASSUMPTIONS HOLDS A: B; MESSAGES A-> B: {A, Na}pk(B); B-> A: {Na, Nb}pk(A); A-> B: {Nb}pk(B); GOALS SECRET Na; SECRET Nb; PRECEDES A: B | Na; PRECEDES B: A | Nb; END;

CIL CAPSL Intermediate Language Two purposes – Defines CAPSL Semantics – Interface to tool support Uses Multiset Term Rewriting Rules

CIL Design General and Expressive enough to represent a wide range of protocols At a low enough level to be useful to verification and model checking tools Represents state-transitions in a pattern- matching style, with symbolic terms to represent encryption and other computations

Rewrite Rules 0 + x -> x s(x) + y -> s(x +y) 0 * x -> 0 s(x) * y -> y + (x * y) fact(0) -> s(0) fact(s(x)) -> s(x) * fact(x) gcd(0, x) -> x gcd(x, x+y) -> gcd(x, y) Examples Fact(s(s(0)))) ->s(s(0)) * fact(s(0)) ->s(s(0)) * s(0) * fact(0) ->s(s(0)) * s(0) * s(0) ->s(s(0)) * s(0) + (0 * s(0)) ->s(s(0)) * s(0) + 0 ->s(s(0)) * s(0) ->s(s(0)) + (0 * s(s(0))) ->s(s(0)) + 0 ->s(s(0) = 2 s(s(s(0))) = 3 s(0) + (0 * s(0)) ->s(0) + 0 ->s(0) = 1 gcd(s(s(s(s(0)))), s(s(0))) ->gcd(s(s(0)), s(s(0))) ->gcd(0, s(s(0))) ->s(s(0)) = 2

Multi-Set Rewrite F 1, …, F k  (  X 1, …, X m ) G 1, …, G n –  i,j F i and G j are facts – Existentially quantified variables are instantiated with fresh (unused) constants A rule is eligible to fire when the facts on the left side can be matched with facts in the multiset When a rule fires, facts on the left side of the rule are removed from the multiset and facts on the right side of the rule are inserted into the multiset after being instantiated according to the substitution required by the pattern match.

MSR Example Rule that defines two new agents –  A 0 (A, B),B 0 (B) The message “A  B: A, {N}sk(A) results in at least two rules – A 0 (A,B)  (  N)A 1 (A,B,N), M(A, B, { A, {N}sk(A)} – B 0 (B), M(X, B, { A, {N}sk(A)})  B 1 (B, A, N)

Translation Output Slot Table – Maps each protocol variable to an argument position in the state predicate of each role Symbol Table – Contains all identifiers declared in all the specification modules Axioms – Single list generated form Typespec and Environment Localized Assumptions and Goals – Axioms localized to a particular state Protocol Rewrite Rules – MSR rules Environment Information – CIL AST representation of an Environment

Translation Stages Parsing – Checks syntax and produces a parse tree Type Checking – Confirms consistency of type and signature declarations Syntax Transformations – Syntactical sugar is removed Rule Generation – Creation of rewrite rules from messages and actions Local Assertions – Transformation of Assertions from interleaved to Associated Optimization – Reduces the number or rules and the number of states per role by 50%

CAPSL Example AP1.0

CAPSL Example AP1.0 (cont’d) PROTOCOL AP10; VARIABLES A, B: Principal; ASSUMPTIONS HOLDS A:B; MESSAGES A -> B: A; END;

CAPSL Example AP2.0

CAPSL Example AP2.0 (cont’d) PROTOCOL AP20; VARIABLES A, B: Principal; IP: Field; ASSUMPTIONS HOLDS A: B, IP; MESSAGES A -> B: {A,IP}; END;

CAPSL Example AP3.0

CAPSL Example AP3.0 (cont’d) PROTOCOL AP30; VARIABLES A, B: Principal; C: Field; P: Field, CRYPTO; ASSUMPTIONS HOLDS A: B, P; HOLDS B: C; MESSAGES A -> B: {A, P}; B -> A: C; END;

CAPSL Example AP4.0

CAPSL Example AP4.0 (cont’d) PROTOCOL AP40; VARIABLES A, B: Principal; R: Nonce; K: Skey; S: Field; ASSUMPTIONS HOLDS A: B, K; HOLDS B: K, S; MESSAGES A -> B: A; B -> A: R; A -> B: {R}K; B -> A: S; END;

CAPSL Example AP5.0

CAPSL Example AP5.0 (cont’d) PROTOCOL AP50; VARIABLES A, B: PKUser; R: Nonce; C, S: Field; ASSUMPTIONS HOLDS A: B; HOLDS B: S, C; MESSAGES A -> B: A; B -> A: R; A -> B: {R}sk(A); B -> A: S; A -> B: pk(A); B -> A: C; END;

CAPSL Example AP5.0 (cont’d)

Tools Support Translators Connectors Maude, PVS, NRL, etc.

Translator CAPSL Parser and Type Checker – Checks syntax and type consistency Rule Generator – Uses maude to generate CIL rewrite rules CIL Optimizer – Optimizes CIL while preserving behavior

Connectors Objective – A bridge between CIL and various analyzer tools Example Connectors – cil2pvs – cil2maude

Maude Rewriting Logic Interpreter Contains an LTL Model Checker Reflective Computation Through Meta-Level Modules

Conclusion and Discussions Good Idea – Unambiguous because of CIL – Simple to describe protocols – Inflexible in that it only specifies protocols – The power of this language is in the tool support – Insightful in the abstraction of the tool support More Connectors Needed Better documentation of Tool Support MuCAPSL

References CAPSL Homepage: G. Denker and J. Millen. CAPSL intermediate language. In N. Heintze and E. Clarke, editor, Workshop on Formal Methods and Security Protocols (FMSP99), Trento, Italy, URL: G. Denker, J. Millen, and H. Ruess. The CAPSL integrated protocol environment. Technical Report SRI-CSL , Oct URL:

References Grit Denker. Design of a CIL connector to maude. In 2000 Workshop on Formal Methods and Computer Security, Chicago, USA, July URL: Narciso Mart-Oliet and Jos Meseguer. Rewriting logic: Roadmap and bibliography. Theoretical Computer Science, 285(2): , Aug URL: citeseer.nj.nec.com/ html