Spi Calculus Gokhan Gokoz Chad R. Meiners. What Spi Calculus Is Spi calculus is a form of pi calculus extended to support cryptography. Pi calculus is.

Slides:



Advertisements
Similar presentations
Security attacks. - confidentiality: only authorized parties have read access to information - integrity: only authorized parties have write access to.
Advertisements

Off-the-Record Communication, or, Why Not To Use PGP
Foundations of Cryptography Lecture 10 Lecturer: Moni Naor.
SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
Sri Lanka Institute of Information Technology
Deeper Security Analysis of Web-based Identity Federation Apurva Kumar IBM Research – India.
1 Lecture 3 The CSP approach to the specification and analysis of Security protocols Communicating Sequential Processes [Hoare 78] Mathematical framework.
1 Digital Signatures & Authentication Protocols. 2 Digital Signatures have looked at message authentication –but does not address issues of lack of trust.
Mar 12, 2002Mårten Trolin1 This lecture Diffie-Hellman key agreement Authentication Certificates Certificate Authorities SSL/TLS.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Analysis of Security Protocols (V) John C. Mitchell Stanford University.
Co-operative Private Equality Test(CPET) Ronghua Li and Chuan-Kun Wu (received June 21, 2005; revised and accepted July 4, 2005) International Journal.
Mar 4, 2003Mårten Trolin1 This lecture Diffie-Hellman key agreement Authentication Certificates Certificate Authorities.
Receipt-freeness and coercion-resistance: formal definitions and fault attacks Stéphanie Delaune / Steve Kremer / Mark D. Ryan.
Encapsulation Security Payload Protocol Lan Vu. OUTLINE 1.Introduction and terms 2.ESP Overview 3.ESP Packet Format 4.ESP Fields 5.ESP Modes 6.ESP packet.
Modelling and Analysing of Security Protocol: Lecture 1 Introductions to Modelling Protocols Tom Chothia CWI.
1 © IBM, A Reactively Secure Dolev-Yao-style Cryptographic Library DIMACS, June 2004 Michael Backes, Birgit Pfitzmann, Michael Waidner IBM Research,
Mobile Ambients Luca Cardelli Digital Equipment Corporation, Systems Research Center Andrew D. Gordon University of Cambridge, Computer Laboratory Presented.
Feb 19, 2002Mårten Trolin1 Previous lecture Practical things about the course. Example of cryptosystem — substitution cipher. Symmetric vs. asymmetric.
1 CS 194: Distributed Systems Security Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer Sciences.
Inductive Verification of Protocols Anupam Datta CMU Fall A: Foundations of Security and Privacy.
Universally Composable Symbolic Analysis of Security Protocols Jonathan Herzog (Joint work with Ran Canetti) 7 June 2004 The author's affiliation with.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
CMSC 414 Computer and Network Security Lecture 13 Jonathan Katz.
Alexander Potapov.  Authentication definition  Protocol architectures  Cryptographic properties  Freshness  Types of attack on protocols  Two-way.
CS5204 – Fall Cryptographic Security Presenter: Hamid Al-Hamadi October 13, 2009.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 9: Cryptography.
Programming Satan’s Computer
AQA Computing A2 © Nelson Thornes 2009 Section Unit 3 Section 6.4: Internet Security Digital Signatures and Certificates.
Security in Process Calculi CS 259 Vitaly Shmatikov.
Protecting Internet Communications: Encryption  Encryption: Process of transforming plain text or data into cipher text that cannot be read by anyone.
Formal Analysis of Security Protocols Dr. Changyu Dong
The Spi Calculus A Calculus for Cryptographic Protocols Presented By Ramesh Yechangunja.
Lecture 14 ISAKMP / IKE Internet Security Association and Key Management Protocol / Internet Key Exchange CIS CIS 5357 Network Security.
Chapter 3: Basic Protocols Dulal C. Kar. Key Exchange with Symmetric Cryptography Session key –A separate key for one particular communication session.
Using Cryptography for Network Security Common problems: –Authentication - A and B want to prove their identities to one another –Key-distribution - A.
© UCL Crypto group oct.-15 On the Perfect Encryption Assumption in the Study of Security Protocols O. Pereira and J.-J. Quisquater UCL Crypto Group
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
Wireless LAN Security. Security Basics Three basic tools – Hash function. SHA-1, SHA-2, MD5… – Block Cipher. AES, RC4,… – Public key / Private key. RSA.
The design of a tutorial to illustrate the Kerberos protocol Lindy Carter Supervisors : Prof Wentworth John Ebden.
IPsec IPsec (IP security) Security for transmission over IP networks –The Internet –Internal corporate IP networks –IP packets sent over public switched.
Automatic Analysis of Security Protocols using SPASS by Christoph Weidenbach.
95-843: Service Oriented Architecture 1 Master of Information System Management Service Oriented Architecture Lecture 7: BPEL Some notes selected from.
Encryption Questions answered in this lecture: How does encryption provide privacy? How does encryption provide authentication? What is public key encryption?
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
Security in Process Calculi CS 395T. Overview uPi calculus Core language for parallel programming Modeling security via name scoping uApplied pi calculus.
Facilities for Secure Communication The Internet is insecure The Internet is a shared collection of networks. Unfortunately, that makes it insecure An.
Lecture 16: Security CDK4: Chapter 7 CDK5: Chapter 11 TvS: Chapter 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,
Cryptographic Hash Functions and Protocol Analysis
Authentication. Goal: Bob wants Alice to “prove” her identity to him Protocol ap1.0: Alice says “I am Alice” Failure scenario?? “I am Alice”
NEW DIRECTIONS IN CRYPTOGRAPHY Made Harta Dwijaksara, Yi Jae Park.
Network Protocols Network Systems Security Mort Anvari.
May University of Glasgow Generalising Feature Interactions in Muffy Calder, Alice Miller Dept. of Computing Science University of Glasgow.
Symmetric Encryption Lesson Introduction ●Block cipher primitives ●DES ●AES ●Encrypting large message ●Message integrity.
IPSec and TLS Lesson Introduction ●IPSec and the Internet key exchange protocol ●Transport layer security protocol.
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
9.2 SECURE CHANNELS JEJI RAMCHAND VEDULLAPALLI. Content Introduction Authentication Message Integrity and Confidentiality Secure Group Communications.
Types and Programming Languages Lecture 16 Simon Gay Department of Computing Science University of Glasgow 2006/07.
IP Security (IPSec) Matt Hermanson. What is IPSec? It is an extension to the Internet Protocol (IP) suite that creates an encrypted and secure conversation.
Model Checking for Security Protocols Will Marrero, Edmund Clarke, Shomesh Jha.
1 Seminar on SOA Seminar on Service Oriented Architecture BPEL Some notes selected from “Business Process Execution Language for Web Services” by Matjaz.
Message Authentication Code
Process Calculus and Security
The Inductive Approach to Verifying Cryptographic Protocols
Chapter 11 – Message Authentication and Hash Functions
Protocol Verification by the Inductive Method
The Secure Sockets Layer (SSL) Protocol
Protocol Verification by the Inductive Method
Presentation transcript:

Spi Calculus Gokhan Gokoz Chad R. Meiners

What Spi Calculus Is Spi calculus is a form of pi calculus extended to support cryptography. Pi calculus is a language for describing and implementing concurrent processes over communication channels. Pi calculus is designed to have a concise description when compared to CSP. Spi calculus adds operators to perform symmetric cryptography.

How Pi and Spi Calculus is used to verify security properties of protocols. Authenticity –Is the implementation equivalent to the specification? Secrecy –Can an external process distinguish one instance from another?

Basic Facilities of Pi Calculus Process: A system is constructed out of a set of concurrent processes. Scope: Variables and channels may be restricted to certain processes or they may be global. Channel: Processes communicate and synchronize with each other via channels.

Scope Extrusion Channels may be placed as messages on channels. Allows for scope restricted channel to be used outside of it original scope. Allows dataflow analysis. Spi calculus adds encryption operators.

Pi Grammar Pi calculus has four types of objects: Names: channels. –represented as m, n, p, q, and r. Variables: –represented as x, y, and z. Terms: objects in Pi calculus. –represented as L, M, N. Processes: –represented as P, Q, and R.

Terms A term can be one of the following five forms: n : the name of a channel (M, N) : a pair of terms. 0 : the number zero. suc(M) : the successor of M. x : a variable.

Process Primitives 0 : Is the nil process. P | Q : Is the process composition operator. !P : Is the process replication operator Examples: A := 0 : A is the nil process B := !A | C: B is an infinite number of A in parallel with C.

Process communication M.P –communicate message N on channel M –becomes P. M(x).P –block until it receives a message N from channel M –P where all occurrences of x in P are replaced by N –(We abbreviate such replacements with P[N/x]) Examples: A := c.0: A sends nil on c and becomes nil. B := c(x).0: B received x on c and becomes nil.

Process Decisions [M is N]P –P if M=N –else 0 let (x,y) = M in P –P[N/x][L/y] when M=(N,L) –otherwise 0 case M is 0 : P suc(x) : Q –P when M=0 –Q[N/x] if M=suc(N) –0 if M is not an integer.

Process Decisions Examples: A(M,N) := [M,N]B –A is B if M=N; otherwise, A is 0. B(M) := let (x,y) = M in A(x,y) –B is A(x,y) if M is a pair; otherwise, B is 0. C(M) := case M is 0 : 0 suc(x) : C(x) –C is 0 when M = 0 –C is C(M-1) when M > 0 –C is 0 if M  N

Process Scope and Extrusion (vn)P –P with the name n bound to P’s scope. Example: A(M) := (vc p )c a.c p.0 –Send private channel c p on c a then become nil. B := c a (x).x(y).0 –Receive channel x on c a then receive y on x then become 0. C := (vc a )(A(M) | B) –C is A in parallel with B. Channel c a is only in A’s and B’s scope.

Spi Calculus Extensions {M} N : term representing the message “M encrypted with the key N”. case L of {x} N in P : P[M/x] provided that L= {M} N otherwise it is 0. Examples: A(M) := c a.0 –A sends M encrypted with k on c a and then becomes nil. B := c a (y). case y of {x} k in F(x) –B receives y on c a and decrypts y into x using k. B then become F(x). C(M) := (vc a )(vk)(A(M) | B) –C is A and B with channel c a and key k.

Process Equivalence In Pi Calculus, we write P ≡ Q iff P and Q are indistinguishable to a separate process R. In Spi Calculus we write P(M) ≡ P(M’) iff given the two process instances a separate process R cannot tell which instance is the instance of M and which the instance of M’.

Pi Calculus Example Message 1 : A→B: M on c ab A(M) := c ab B := c ab (x).F(x) Inst(M) := (vc ab )(A(M) | B) Principal A sends message M on channel c ab to principal B. c ab is restricted, only A and B have access to c ab. Inst(M) is one instance of the protocol.

Pi Calculus Example (cont.) Specification: A(M) := c ab B spec (M) := c ab (x).F(M) Inst spec (M) := (vc ab )(A(M) | B spec (M)) Difference between protocol and specification: B spec (M) is a variant, which receives input from A and acts like B when B receives M.

Security Properties Authenticity property: Inst(M) ≡ Inst spec (M), for all M. The protocol with message M is indistinguishable from the specification with message M, for all messages M. Secrecy property: Inst(M) ≡ Inst(M’) if F(M) ≡ F(M’), for all M,M’. If F(M) is indistinguishable from F(M’), then the protocol with message M is indistinguishable from the protocol with message M’. These security properties hold because of the restriction on the channel c ab.

Channel Establishment Example Abstract and simplified version of the Wide Mouthed Frog protocol proposed by Michael Burrows in 1989 passes a restricted channel from A to B via restricted channels to S.

Channel Establishment Example (cont.) channels instead of the keys channel establishment and data communication happen only once Message 1: A→S: c ab on c as Message 2 : S→B: c ab on c sb Message 3 : A→B: M on c ab S BA 1. new channel 3. Data on new channel 2. new channel

Protocol Implementation A(M) := (vc ab )c as.c ab –A sends channel c ab over c as then sends M over c ab. S := c as (x).c sb –S forwards x from c as to c sb. B := c sb (x).x(y).F(y) –B receives channel x on c sb and receives y on x. Inst(M) := (vc as )(vc sb ) )(A(M) | S | B) –Inst is the composition of A, S and B.

Specification In the specification A(M) and S are same as above, B spec (M) := c sb (x).x(y).F(M) –Here B spec is similar to B except it knows what M is already for authenticity checking. Inst(M) spec :=(vc as )(vc sb ) )(A(M) | S | B spec (M)) The authenticity and secrecy properties hold.

Spi Calculus Example Same as the first Pi example except that a key is used to insure secrecy. Message 1: A→B: {M} k ab on c ab –A(M) := c ab A send a shared key encrypted message M on c ab. –B := c ab (x). case x of {y} k ab in F(y) B decrypts x into y. –Inst(M) :=(vk ab )(A(M) | B) The key k ab is restricted to only A and B.

Spi Example Specification Specification: A(M) := c ab B spec (M) := c ab (x). case x of {y} k ab in F(M) Inst spec (M) :=(vk ab )( A(M) | B spec (M)) Authenticity and secrecy properties are confirmed under a coarse-grained equivalence since an observer ´) can definitely distinguish between P(M) and P(M´).

Key establishment in Spi Calculus Same as the Pi frog protocol with key used instead of restricted channels. Message 1: A→S: {k ab } k as on c as Message 2: S→B: {k ab } k sb on c sb Message 3: A→B: {M} k ab on c ab S BA 1. new key k ab under k as 3. Data under new key k ab 2. new key k ab under k sb

Protocol A(M) := (vk ab )( c as.c ab ‹{M} k ab >) –A sends a key k ab to the server S and uses k ab to encrypt M to send to B. S := c as (x). case x of {y} k as in c sb –S forwards the key contained in x via the shared key k as. B := c sb (x). case x of {y} k sb in c ab (z). case z of {w} y in F(w) –B receives and decrypts the key in x then uses that key to get the message w. Inst(M) := (vk as ) (vk sb )( A(M) | S | B)

Specification Principals A(M) and S are the same as in the protocol; –B spec (M) := c sb (x). case x of {y} k sb in c ab (z). case z of {w} y in F(M) –Inst spec (M) := (vk as ) (vk sb )( A(M) | S | B spec (M)) The specification is more complex than the protocol but B spec (M) applies F only to the data from A and not to a message resulting from an attack or error.

Complete Authentication Example (with a flaw) A server and n other principals Each principal’s input channels are public and are named as c 1, c 2, …, c n and c s. Server shares a pair of keys with each other principal, k si and k is. Message sequence: Message 1: A→S: A,{B,k ab } k as on c s Message 2: S→B: {A, k ab } k sb on c b Message 3: A→B: A,{M} k ab on c b

Instance of the protocol We have two principals (A and B) and the message sent after key establishment. Instance I is a triple (i,j,M) where i: source address, j: destination address Send(i,j,M) := (vk)(c s | c j ) Recv(j) := c j (y cipher ). case y cipher of {x a,x key } kSj in c j (z a,z cipher ).[x a is z a ] case z cipher of {z plain } xkey in F(x a,j, z plain )

Instance of the protocol (Sending) Send(i,j,M) := (vk)(c s | c j ) –Creates a key k, sends to the server along with the names i and j of the principals of the instance. –Sends M under k with its name i.

Instance of the protocol (Receiving) Recv(j) := c j (y cipher ). case y cipher of {x a,x key } kSj in c j (z a,z cipher ).[x a is z a ] case z cipher of {z plain } xkey in F(x a,j, z plain ) –Waits for a message y cipher from server, extracts x key from this message –Then waits for a message z cipher under this key –At the end applies F to the name x a of the presumed sender, j and to z plain of the message.

Server The server S is the same for all instances: S := c s (x a,x cipher ).  i  1..n [x a is i] case x cipher of {x b,x key } k is in  j  1..n [x b is j] c j S receives a key that selects the correct branch to forward the key to the correct j.  i  1..k P i is the k-way composition P 1 |…|P k

Whole System Sys(I 1,…, I m ) := (vk iS )(vk Sj ) (Send(I 1 ) |…| Send(I m ) | !S | !Recv(1) |…| !Recv(n) ) Where (vk iS )(vk Sj ) stands for (vk 1s )…(vk ns ) (vk s1 )…(vk sn ) and Sys(I 1,…, I m ) represents a system with m instances of the protocol.

The Flaw The protocol is vulnerable to a replay attack. System: Sys(I,I) where I=(i,j,M), I=(i,j,M) An attacker can replay messages of one instance and get them mistaken for messages of the other instance. So M will be passed to F twice and Sys(I,I) could execute two copies of F(i,j,M) although Sys(I,I) can run F for both instances F(i,j,M) and F(i,j,M) only once. Therefore the authenticity equation doesn’t hold. Inst(M) ≡ Inst spec (M), for all M.

Complete Authentication Example (repaired) To protect previous protocol against replay attacks, nonce handshakes (tag in the message to authenticate the sender) are added. The new protocol, informally looks like: –Message 1: A→S: A on c s –Message 2: S→A: N s on c a –Message 3: A→S: A,{A,A,B,k ab,N s } k as on c s –Message 4: S→B: * on c b –Message 5: B→S: N b on c s –Message 6: S→B: {S,A,B, k ab, N b } k sb on c b –Message 7: A→B: A,{M } k ab on c b See Appendix for implementation.

What we get with Spi Calculus? Protocols in Spi Calculus are tedious. Good for proofing authenticity and secrecy. The scope of errors that it can find are limited though Spi Calculus is not as general as other logics, but this lack of generality allows us more confidence in the properties we can prove.

Tool Support Spi Calculus does not have any direct tool support. Security proprieties must be proven by humans. There is however a protocol language Cryptc that is based on Spi Calculus.

Cryptc Redefines Spi calculus’s grammar Adds protocol beginnings and endings Protocols are considered secure if every protocol ending has a distinct beginning. Cryptc performs an exhaustive search for paths that generate an end without a begin.

Online References A Calculus for Cryptographic Protocols: The Spi Calculus Martin Abadi and Andrew D. Gordon Digital SRC Research Report 149 January 25, search-reports/abstracts/src-rr-149. Html search-reports/abstracts/src-rr-149

Online References Authenticity by Typing for Security Protocols A.D. Gordon and A.S.A. Jeffrey Microsoft Research Technical Report MSR , 2001 ftp://fpl.cs.depaul.edu/pub/ajeffrey/spi-types.ps.gz ftp://fpl.cs.depaul.edu/pub/ajeffrey/spi-types.ps.gz The Cryptc webpage:

Appendix : Corrected Protocol Send(i,j,M) := c s | c i (x nonce ). (vk)(c s | c j ) S := c s (x a ).  i  1..n [x a is i](vN s )(c i | c s (x a,x cipher ).[x a is i] case x cipher of {y a,z a,x b,x key,x nonce } k is in  j  1..n [y a is i][z a is i][x b is j][x nonce is N s ] (c j | c S (y nonce ). c j ))

Recv(j) := c j (w). (vN b ) (c s | c j (y cipher ). case y cipher of {x s, x a, x b, x key, y nonce } k sj in  j  1..n [x s is S][x a is i][x b is j][y nonce is N b ] c j (z a,z cipher ).[ z a is x a ] case z cipher of {z plain } x key in F(i, j,z plain )) Sys(I 1,…, I m ) := (vk iS )(vk Sj ) (Send(I 1 ) |…| Send(I m ) | !S | !Recv(1) |…| !Recv(n) )

Authenticity: Sys(I 1,…,I m ) ≡ Sys spec (I 1,…,I m ) for any instances I 1,…,I m. This property holds because of the nonces. Secrecy: Sys(I 1,…,I m ) ≡ Sys spec (J 1,…,J m ) if each pair (I 1,J 1 ),…,(I m,J m ) is indistinguishable.