Encoding security protocols in the cryptographic λ-calculus. Eijiro Sumii Joint work with Benjamin Pierce University of Pennsylvania

Similar documents
Logical Relations for Encryption

Notes on BAN Logic CSG 399. March 7, 2006

A bisimulation for dynamic sealing

A Logic of Authentication

Proving Security Protocols Correct. Lawrence C. Paulson Computer Laboratory

2. Cryptography 2.5. ElGamal cryptosystems and Discrete logarithms

CIS 6930/4930 Computer and Network Security. Topic 5.2 Public Key Cryptography

Models and analysis of security protocols 1st Semester Security Protocols Lecture 6

Verification of Security Protocols in presence of Equational Theories with Homomorphism

MSR by Examples. Iliano Cervesato. ITT Industries, NRL Washington DC.

Practice Assignment 2 Discussion 24/02/ /02/2018

Proving Properties of Security Protocols by Induction

Cryptographical Security in the Quantum Random Oracle Model

A Logic of Authentication. Borrows, Abadi and Needham TOCS 1990, DEC-SRC 1989

MSR by Examples. Iliano Cervesato. ITT Industries, NRL Washington DC.

NSL Verification and Attacks Agents Playing Both Roles

CryptoVerif: A Computationally Sound Mechanized Prover for Cryptographic Protocols

Models for an Adversary-Centric Protocol Logic

A Formal Analysis for Capturing Replay Attacks in Cryptographic Protocols

A Calculus for Control Flow Analysis of Security Protocols

L7. Diffie-Hellman (Key Exchange) Protocol. Rocky K. C. Chang, 5 March 2015

Term Rewriting applied to Cryptographic Protocol Analysis: the Maude-NPA tool

Control Flow Analysis of Security Protocols (I)

CS 395T. Probabilistic Polynomial-Time Calculus

Typed MSR: Syntax and Examples

MSR 3.0: The Logical Meeting Point of Multiset Rewriting and Process Algebra. Iliano Cervesato. ITT Industries, NRL Washington, DC

CPSC 467b: Cryptography and Computer Security

Lecture 1: Introduction to Public key cryptography

Public-Key Cryptosystems CHAPTER 4

BAN Logic A Logic of Authentication

Elliptic Curve Cryptography

Verification of the TLS Handshake protocol

Strand Spaces Proving Protocols Corr. Jonathan Herzog 6 April 2001

CPSA and Formal Security Goals

A compositional logic for proving security properties of protocols

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2

Probabilistic Polynomial-Time Process Calculus for Security Protocol Analysis. Standard analysis methods. Compositionality

Lecture 19: Public-key Cryptography (Diffie-Hellman Key Exchange & ElGamal Encryption) Public-key Cryptography

A Resolution Strategy for Verifying Cryptographic Protocols with CBC Encryption and Blind Signatures

A one message protocol using cryptography, where K AB is a symmetric key shared between A and B for private communication. A B : {M} KAB on c AB

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

A new security notion for asymmetric encryption Draft #8

8 Elliptic Curve Cryptography

CPSC 467: Cryptography and Computer Security

On the Verification of Cryptographic Protocols

An Efficient Cryptographic Protocol Verifier Based on Prolog Rules

Time-Bounding Needham-Schroeder Public Key Exchange Protocol

A Bisimulation for Type Abstraction and Recursion

APPLICATIONS OF BAN-LOGIC JAN WESSELS CMG FINANCE B.V.

CRYPTOGRAPHY AND NUMBER THEORY

Exam Security January 19, :30 11:30

Automatic, computational proof of EKE using CryptoVerif

Lecture Notes, Week 10

Lecture 11: Key Agreement

Other Public-Key Cryptosystems

CPSC 467b: Cryptography and Computer Security

ECS 189A Final Cryptography Spring 2011

Question: Total Points: Score:

On the Key-collisions in the Signature Schemes

Chapter 7: Signature Schemes. COMP Lih-Yuan Deng

Automatic Verification of Complex Security Protocols With an Unbounded Number of Sessions

Elliptic Curve Cryptography

A Bisimulation for Dynamic Sealing

CPSC 467: Cryptography and Computer Security

Analysis of authentication protocols Intership report

Elliptic Curves. Giulia Mauri. Politecnico di Milano website:

Cryptography and Security Midterm Exam

Group Diffie Hellman Protocols and ProVerif

Univ.-Prof. Dr. rer. nat. Rudolf Mathar. Written Examination. Cryptography. Tuesday, August 29, 2017, 01:30 p.m.

CS 4110 Programming Languages & Logics. Lecture 16 Programming in the λ-calculus

Probabilistic Model Checking of Security Protocols without Perfect Cryptography Assumption

Mechanizing Elliptic Curve Associativity

CHAPTER 6: OTHER CRYPTOSYSTEMS, PSEUDO-RANDOM NUMBER GENERATORS and HASH FUNCTIONS. Part VI

An Introduction. Dr Nick Papanikolaou. Seminar on The Future of Cryptography The British Computer Society 17 September 2009

Elliptic curves: Theory and Applications. Day 4: The discrete logarithm problem.

Lecture 17 - Diffie-Hellman key exchange, pairing, Identity-Based Encryption and Forward Security

Leftovers from Lecture 3

Lecture Notes, Week 6

Shift Cipher. For 0 i 25, the ith plaintext character is. E.g. k = 3

6.897: Advanced Topics in Cryptography. Lecturer: Ran Canetti

A Semantics for a Logic of Authentication. Cambridge, MA : A; B

Chapter 4 Asymmetric Cryptography

Asymmetric Cryptography

Math 299 Supplement: Modular Arithmetic Nov 8, 2013

MATH 158 FINAL EXAM 20 DECEMBER 2016

Lecture 1: Perfect Secrecy and Statistical Authentication. 2 Introduction - Historical vs Modern Cryptography

Asymmetric Encryption

A process algebraic analysis of privacy-type properties in cryptographic protocols

Analysing privacy-type properties in cryptographic protocols

Private Authentication

March 19: Zero-Knowledge (cont.) and Signatures

The RSA public encryption scheme: How I learned to stop worrying and love buying stuff online

OWO Lecture: Modular Arithmetic with Algorithmic Applications

Revisiting Cryptographic Accumulators, Additional Properties and Relations to other Primitives

Final Exam Math 105: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 30 April :30 11:00 a.m.

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University

Notes for Lecture 17

SIGNATURE SCHEMES & CRYPTOGRAPHIC HASH FUNCTIONS. CIS 400/628 Spring 2005 Introduction to Cryptography

Lecture th January 2009 Fall 2008 Scribes: D. Widder, E. Widder Today s lecture topics

Elliptic Curve Cryptography

Transcription:

Encoding security protocols in the cryptographic λ-calculus Eijiro Sumii Joint work with Benjamin Pierce University of Pennsylvania

An obvious fact Security is important Cryptography is a major way to achieve security Therefore, cryptography is important

A less obvious fact There are nice cryptosystems like RSA, 3DES, etc....but how to use them is often nontrivial

Example: Needham-Schroeder public-key protocol [NS78] Assumption: all encryption keys and the network are public Purpose: principals A and B authenticate each other, and exchange two secret nonces A B: { A, Na } Kb B A: { Na, Nb } Ka A B: { Nb } Kb

An attack on the protocol [Lowe 95] If some B is malicious (say, E), it can impersonate A and fool another B A E: { A, Na } Ke E(A) B: { A, Na } Kb B E(A): { Na, Nb } Ka E A: { Na, Nb } Ka A E: { Nb } Ke E(A) B: { Nb } Kb N.B. ( ) means forgery or interception

A fix [Lowe 95] A B: { A, Na } Kb B A: { Na, Nb, B } Ka A B: { Nb } Kb

How does it prevent the attack? A E: { A, Na } Ke E(A) B: { A, Na } Kb B E(A): { Na, Nb, B } Ka E A: { Na, Nb, B } Ka (* Here, A asserts E = B, which is false *) A E: { Nb } Ke E(A) B: { Nb } Kb

So what? We want a way to specify and verify security protocols But informal notation is too ambiguous (It is often unclear how each principal reacts to various messages) So we need a formal model λ-calculus + cryptographic primitives

Why λ-calculus? (not π-calculus, for example) It's simple and high-level It's standard and well-studied For instance, logical relations help to prove various properties, such as contextual equivalence (cf. [Mitchell 96, Chapter 8]) Equivalences in process calculi are hard to prove! (e.g. [Abadi & Gordon 96]) It's actually (almost) expressive enough to model various protocols and attacks

The cryptographic λ-calculus Simply-typed call-by-value λ-calculus + shared-key cryptographic primitives e ::= k new x in e {e1} e2 λ{x} e1. e2 τ ::= key bits(τ) (λ{x} k. e) {v} k e[v/x] Subsumes public-key cryptography k + λz.{z} k k λ{z} k.z

Encoding protocols configuration = record (or tuple) of principals and public keys principal = function from messages to messages with a continuation (of the principal itself) sound network and scheduler = context applying "right" principals to right messages in a right order malicious attacker = arbitrary context

Encoding Needham-Schroeder new Ka in new Kb in new Ke in { A =, B =, Ka + = λz.{z} ka, Kb + = λz.{z} kb, Ke = Ke }

Encoding Needham-Schroeder new Ka in new Kb in new Ke in { A = new Na in send { "A", Na } Kb to B in, B =, Ka + = λz.{z} ka, Kb + = λz.{z} kb, Ke = Ke }

Encoding Needham-Schroeder new Ka in new Kb in new Ke in { A = new Na in send { "A", Na } Kb to B in, B = receive { "A", Na } Kb in new Nb in send { Na, Nb } Ka to A in, Ka + = λz.{z} ka, Kb + = λz.{z} kb, Ke = Ke }

Encoding Needham-Schroeder new Ka in new Kb in new Ke in { A = new Na in send { "A", Na } Kb to B in receive { Na', Nb } Ka in assert Na = Na' in send { Nb } Kb to B in, B = receive { "A", Na } Kb in new Nb in send { Na, Nb } Ka to A in, Ka + = λz.{z} ka, Kb + = λz.{z} kb, Ke = Ke }

Encoding Needham-Schroeder send m to X in c new Ka in new Kb in new Ke in ("X", m, c { A = new Na in ("B", { "A", Na } Kb, receive m in c λ{ Na', Nb } Ka. λm. c if Na' Na then else ("B", { Nb } Kb, )), B = λ{ "A", Na } Kb. new Nb in ("A", { Na, Nb } Ka, ), Ka + = λz.{z} ka, Kb + = λz.{z} kb, Ke = Ke }

Encoding Needham-Schroeder new Ka in new Kb in new Ke in { A = λn. let Kn = lookup n in new Na in (n, { "A", Na } Kn, λ{ Na', Nn } Ka. if Na' Na then else (n, { Nn } Kn, )), B = λ{ "A", Na } Kb. new Nb in ("A", { Na, Nb } Ka, ), + +

Encoding the network and scheduler "A context applying right principals to right messages in a right order" Net[r] = let (_, m 1, c A ) = # A (r) "B" in let (_, m 2, c B ) = # B (r) m 1 in let (_, m 3, c A ') = c A m 2 in

Encoding the attacker Attack[r] = let Ke = # Ke (r) in let Kb + = # Kb+ (r) in let (_, { _, Na } Ke, c A ) = # A (r) "E" in let (_, m, c B ) = # B (r) Kb + (A, Na) in (* m becomes { Na, Nb } Ka *) let (_, { Nb } Ke, c A ') = c A m in (* use Nb to trick B *)

Another example: ffgg protocol An artificial protocol with a "necessarily parallel" attack A B : A B A : N 1, N 2 A B : A, { N 1, N 2, M } Kb as {N 1, X, Y} Kb B A : N 1, X, { X, Y, N 1 } Kb

A "parallel" attack to the protocol A B : A (A) B' : A B (A) : N 1, N 2 B' (A) : N 1 ', N 2 ' (B) A : N 1, N 1 ' A B : { N 1, N 1 ', M } Kb B and B' are two concurrent processes for the same principa ( ) means forgery or interception of a message by the attacker B (A) : N 1, N 1 ', { N 1 ', M, N 1 } Kb (A) B' : { N 1 ', M, N 1 } Kb B' (A) : N 1 ', M, { M, N 1, N 1 ' } Kb

Encoding ffgg new Kb in { A = ("B", "A", λ(n 1, N 2 ). ("B", { N 1, N 2, M } Kb, )), B = λn. new N 1 in new N 2 in (n, (N 1, N 2 ), λ{ N 1 ', X, Y } Kb. if N 1 ' N 1 then else (n, (N 1, X, { X, Y, N 1 } Kb ), )) }

Encoding the attacker Attack[r] = let (_, (N 1, N 2 ), c B ) = # B (r) "A" in let (_, (N 1 ', N 2 '), c B ') = # B (r) "A" in let (_, m A, _) = # A (r) (N 1, N 1 ') in (* m A becomes { N 1, N 1 ', M } Kb *) let (_, (_, _, m B ), _) = c B m A in (* m B becomes { N 1 ', M, N 1 } Kb *) let (_, (_, M, _), _) = c B ' m B in (* use M for whatever *)

Secrecy non-interference contextual equivalence Let NS[i] be: new in { A = receive { x } Nn in x mod 2, B = send { i } Nb to A in (), } Then, the secrecy of i can be expressed as, say,

Using logical relation to prove contextual equivalence e e' : τ e e' : τ "Logical relation implies contextual equivalence" Defined by induction on τ, and (hopefully) easier to prove Whole topic of another talk!

A drawback There is no "state" of principals Some attacks might be bogus (i.e., impossible in reality) Consider linear λ-calculus?