Cryptographic Logical Relations What is the contextual equivalence - - PowerPoint PPT Presentation

cryptographic logical relations
SMART_READER_LITE
LIVE PREVIEW

Cryptographic Logical Relations What is the contextual equivalence - - PowerPoint PPT Presentation

Cryptographic Logical Relations What is the contextual equivalence for cryptographic protocols and how to prove it? Yu ZHANG Including joint work with J. Goubault-Larrecq, D. Nowak and S. Lasota EVEREST, INRIA Sophia-Antipolis February


slide-1
SLIDE 1

Cryptographic Logical Relations

— What is the contextual equivalence for cryptographic protocols and how to prove it?

Yu ZHANG

Including joint work with J. Goubault-Larrecq, D. Nowak and S. Lasota EVEREST, INRIA Sophia-Antipolis February 12, 2007

slide-2
SLIDE 2

Cryptographic Logical Relations

1

Cryptography

Kdec

Hello, buddy!

Kenc Using cryptography to hide information:

Encryption Decryption Hello, buddy! %$8?λ@ ¥∂^#+

But, how to distribute keys on Internet?

Hello, buddy! %$8? λ@ ¥∂^#+

slide-3
SLIDE 3

Cryptographic Logical Relations

2

The Needham-Schroeder’s protocol

Alice Bob

Secret

{ }NONCEA

NONCEA becomes the session key

slide-4
SLIDE 4

Cryptographic Logical Relations

3

The Needham-Schroeder’s protocol

Alice Bob Charlie

NONCEA

{ }PKCharlie

slide-5
SLIDE 5

Cryptographic Logical Relations

4

Formal verification

1978 — The invention of the NS protocol [NS 78]. 1995 — G. Lowe found the flaw [Lowe 95]. The protocol is secure, because I don’t find any attack!

As a logician, I’d like to tell you very seriously: It’s NOT True!!!

What are you talking about? “Insecure”? We use CRYPTOGRAPHY here.

Tho hose w who ho t thi hink t tha hat t the heir pr problem c can b be s solved b by simpl ply a appl pplying c crypt ptography phy, d don’t u understand crypt ptography phy a and d don’t u understand t the heir pr problem.

  • --- R
  • R. N

Needha ham

{m}k

slide-6
SLIDE 6

Cryptographic Logical Relations

5

Formal verification community

Verify security properties with formal methods.

Formal verification

1978 — The invention of the NS protocol [NS 78]. 1995 — G. Lowe found the flaw [Lowe 95].

slide-7
SLIDE 7

Cryptographic Logical Relations

6

Secrecy by contextual equivalence

  • Ehm, seems these

stupid guys always talkin about the same thing …

Internet

{ }k

Charlie IS stupid

Run 1

A
  • > B
: message 1 B
  • > S
: message 2 S
  • > A
: message 3 A
  • > B
: message 4 B
  • > A
: message 5 A
  • > B
: message 1 B
  • > S
: message 2 S
  • > A
: message 3 A
  • > B
: message 4 B
  • > A
: message 5

Protocol Run 2

{ }k

Charlie IS NOT stupid

Secrecy: for every messages m1 and m2, Protocol(m1) ≈ Protocol(m2). Spi-Calculus: with bisimulations [Abadi & Gordon 97]. Cryptographic λ-calculus: with logical relations [Sumii & Pierce 02]. Higher-order functions are taken into account.

What the hell did that guy encrypt in this message? Eh … looks like a … PROGRAM!

A
  • > B
: m essag m essage 2 S A : message 3 A
  • > Bssage 4
B
  • > A
: age 5 A
  • > B
:
slide-8
SLIDE 8

Cryptographic Logical Relations

7

Motivation

Sumii and Pierce’s logical relations are somehow ad-hoc. Is there a systematic way to construct these logical relations? And, to what extent can we rely on this method? If logical relations fail in proving the secrecy property, can we say that protocol is NOT secure?

We keep on using the λ-calculus approach.

slide-9
SLIDE 9

Cryptographic Logical Relations

8

Related work and our contribution

Side-effects Logical relations

2002, logical relations for encryption [Sumii & Pierce 02] 1993~94, operational logical relations for name creation [Pitts & Stark 93] 1992~93, categorical construction [Ma & Reynolds 92, Mitchell & Scedrov 93] 1980, invention of logical relations [Plotkin 80] 2002, logical relations for computational λ-calculus [Goubault-Larrecq, Lasota & Nowak 02] 1989, computational λ-calculus [Moggi 89, Moggi 90] 2005, completeness of monadic logical relations [Lasota, Nowak & Zhang 06] 2003, denotational logical relations for key generation [Zhang & Nowak 03] 2004, lax cryptographic logical relations [Goubault-larrecq, Lasota, Nowak & Zhang 04]

slide-10
SLIDE 10

Cryptographic Logical Relations

9

Outline

 The cryptographic metalanguage  Denotational semantics  Cryptographic logical relations  Contextual equivalence

slide-11
SLIDE 11

Cryptographic Logical Relations

Cryptographic Logical Relations

 Introduction  The cryptographic metalanguage  Denotational semantics  Cryptographic logical relations  Contextual equivalence  Conclusion

slide-12
SLIDE 12

Cryptographic Logical Relations

11

Syntax (i) — Types

  • A computation may generate fresh keys.

Type for computations, from Moggi’s language

Based on Moggi’s computational λ-calculus — a nice framework for reasoning about side-effects, including key generation.

slide-13
SLIDE 13

Cryptographic Logical Relations

12

Syntax (ii) — Terms

generation of fresh key, from Stark’s metalanguage trivial computation and sequential computation, from Moggi’s language trivial computation and sequential computation, from Moggi’s language

slide-14
SLIDE 14

Cryptographic Logical Relations

13

Syntax (ii) — Typing rules

slide-15
SLIDE 15

Cryptographic Logical Relations

14

Public key cryptography can be modeled using functions [Sumii & Pierce 02]:

  • If k is a private key, then the public key is:
  • Encrypt a message with a public key:

Modeling asymmetric cryptography

slide-16
SLIDE 16

Cryptographic Logical Relations

15

Encoding of protocols

  • Principals as functions.
  • Interactions as function applications.
  • The protocol is a tuple of functions:

P(secret) = <fAlice, fBob, …>

  • An attack is a function F:

F(P(secret)) = secret

slide-17
SLIDE 17

Cryptographic Logical Relations

Cryptographic Logical Relations

 Introduction  The cryptographic metalanguage  Denotational semantics  Cryptographic logical relations  Contextual equivalence  Conclusion

slide-18
SLIDE 18

Cryptographic Logical Relations

17

An encrypted message is written as .

Modeling cryptography

— a set of keys.

plain-text key function symbol

slide-19
SLIDE 19

Cryptographic Logical Relations

18

Computations as monads

  • According to Moggi, side-effects can be modeled by

monads [Moggi 89].

– Concrete monads: exceptions, non-determinism, ...

  • Fresh key generation is seen as a side-effect.
  • Key generation monad: computations might generate

fresh keys.

– Stark uses this monad to interpret his language for name creation [Stark 94].

slide-20
SLIDE 20

Cryptographic Logical Relations

19

Stark’s model

A functor category with a monad T:

  • — category of finite sets and injections.

– A set represents a computation stage.

  • Denotations are defined over a set of keys.
  • Computations are interpreted as

We use Stark’s model to interpret our metalanguage.

fresh keys generated during the computation result of the computation

slide-21
SLIDE 21

Cryptographic Logical Relations

Cryptographic Logical Relations

 Introduction  The cryptographic metalanguage  Denotational semantics  Cryptographic logical relations  Contextual equivalence  Conclusion

slide-22
SLIDE 22

Cryptographic Logical Relations

21

What is a logical relation?

  • A logical relation is a family of relations, each indexed by a type.
  • Two functions f1 and f2 are related iff
  • Basic Lemma

– If the denotation of each constant is related to itself, denotations of every term in related environments are related. – Basic Lemma helps us to prove contextual equivalence.

What is a cryptographic logical relation?

  • The sprit of Sumii and Pierce’s logical relations: A cryptographic logical relation

must relate encryption with itself, and relate decryption with itself.

slide-23
SLIDE 23

Cryptographic Logical Relations

22

Relations for base types

  • Only keys that are accessible to attackers are related [Sumii & Pierce

02, Abadi & Gordon 97]: — the set of disclosed keys.

  • Encrypted messages are then divided into two parts

ϕ — parameter of the logical relation, fixing the relation between secret messages [Sumii & Pierce 02].

  • r

U

built by induction on message structure fixed by the parameter ϕ

slide-24
SLIDE 24

Cryptographic Logical Relations

23

Logical relations for monadic types

  • Categorical construction of logical relation for monadic types

[Goubault-Larrecq et al. 02].

But what is the category for constructing logical relations?

  • Logical relations derived over are too weak with naïve relations

for keys: How to represent the parameter ?

  • A logical relation constructed over :

– Kripke logical relation — logical relations defined over functor categories [Mitchell & Moggi 91]. – is called a “world”, representing a computation stage. – Two functions are related iff they take related arguments at any larger world to related results.

slide-25
SLIDE 25

Cryptographic Logical Relations

24

The “frame” category

Formalize the parameter in the category [ZN 03]:

  • bjects are tuples ;
  • morphisms are pairs of injections such that the following

diagram commutes:

disclosed keys disclosed keys all keys that have been created all keys that have been created

Becomes :

slide-26
SLIDE 26

Cryptographic Logical Relations

25

Logical relations over

(using the general construction of [GLLN02]).

  • Basic Lemma holds, but only for a very limited set of ϕ .
  • This logical relation fails in relating equivalent programs:

k ∈ w’ k ∉ w Secret keys get known by attackers at a larger “world”.

disclosed keys disclosed keys

slide-27
SLIDE 27

Cryptographic Logical Relations

26

  • Category :

the subcategory of where every is a pull-back.

The “frame” category (revised)

  • In our model, secret keys must NOT be exposed at any larger

“world”.

– A “world” represents a stage based on keys, not on time. k ∉ w’ k ∉ w

  • disclosed keys

disclosed keys

slide-28
SLIDE 28

Cryptographic Logical Relations

27

Cryptographic logical relations

  • Cryptographic logical relations derived over :

– Cipher function ϕ — a group of “world”-indexed functions, each determining the relation between secret cipher-texts at the “world”. – Basic Lemma holds for a non-trivial set of cipher functions. – Recognize Pitts and Stark’s operational logical relations for name creation.

slide-29
SLIDE 29

Cryptographic Logical Relations

Cryptographic Logical Relations

 Introduction  The cryptographic metalanguage  Denotational semantics  Cryptographic logical relations  Contextual equivalence  Conclusion

slide-30
SLIDE 30

Cryptographic Logical Relations

29

Contexts for cryptographic protocols

  • Contexts represent exactly the knowledge of attackers:

Contexts have access to disclosed keys.

{m}k

Contexts have access to secret cipher-texts, although they cannot decrypt them.

  • In the computational lambda-calculus, contexts are allowed

to do computations:

slide-31
SLIDE 31

Cryptographic Logical Relations

30

Cryptographic contextual equivalence

defined using category :

  • holds;
  • — context knowledge, sets of secret cipher-texts that

contexts can access;

  • honest environment, mapping every message variable to a cipher-

text in .

slide-32
SLIDE 32

Cryptographic Logical Relations

31

Verifying the secrecy property

  • Secrecy property:

∀ msg1, msg2, Protocol(msg1) ≈ Protocol(msg2)

  • Theorem:

Cryptographic logical relations are sound:

  • Proposition:

This technique shows that Lowe’s fixed version of the Needham- Shroeder protocol satisfies the secrecy property (for multi- sessions) .

slide-33
SLIDE 33

Cryptographic Logical Relations

32

Completeness

  • A logical relation is complete if .
  • Completeness for monadic logical relations is hard to achieve,

even for first-order types.

Our results:

  • The cryptographic logical relations are complete for types:
  • A lax logical relation that is complete for all types.
slide-34
SLIDE 34

Cryptographic Logical Relations

33

Decidability

  • In general, contextual equivalence in the cryptographic

metalanguage is undecidable.

  • Cryptographic logical relations are decidable for types:
  • Contextual equivalence is decidable for types:
slide-35
SLIDE 35

Cryptographic Logical Relations

Cryptographic Logical Relations

 Introduction  The cryptographic metalanguage  Denotational semantics  Cryptographic logical relations  Contextual equivalence  Conclusion

slide-36
SLIDE 36

Cryptographic Logical Relations

35

Main results

  • The category for deriving cryptographic logical

relations.

  • A proper notion of contextual equivalence for

cryptographic protocols.

  • Cryptographic logical relations:

– sound (can deduce contextual equivalence); – complete for types:

  • A complete lax logical relation.
  • Decidability for contextual equivalence for types:
slide-37
SLIDE 37

Cryptographic Logical Relations

36

Future work

  • On programming languages:

– Extend the model for dealing with recursion. – Freshness: nominal techniques based on FM-sets (name- swapping) [Pitts et al.].

  • On security:

– Protocols aiming at other security properties, e.g., anonymity. – The computational model:

  • Lambda-calculi might be a better language for expressing games,
  • racle calls, etc.
  • Typing systems enforcing complexity constraints [Hofmann 1997,

Mitchell et al. 1998]

  • Logical relations might help!