Top Banner
1 1 Hugo Krawczyk IBM Research [email protected] An Introduction to the Design and Analysis of Authenticated Key Exchange Protocols (TCE Summer School 2012) Terminology Remark I use “key exchange” (KE) as synonym of (or shorthand for) “authenticated key exchange” (AKE) Also a synonym of “key agreement” (some use key agreement to differentiate it from “key transport”) 3
49

An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

Aug 22, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

1

1

Hugo Krawczyk

IBM Research

[email protected]

An Introduction to the Design and Analysis of

Authenticated Key Exchange Protocols

(TCE Summer School 2012)

Terminology Remark

� I use “key exchange” (KE) as synonym of (or shorthand

for) “authenticated key exchange” (AKE)

� Also a synonym of “key agreement” (some use key

agreement to differentiate it from “key transport”)

3

Page 2: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

2

What is a Key Exchange Protocol

� Many answers.

� From naïve intuition to a rigorous formal theory

� Our presentation touches on both but is mostly informal

� The fundamental role of KE:

� Bootstrap a secure channel between two communicating parties via the negotiation of shared keys and cryptographic services

� Enabler and heart of secure communications

� The link between long-term keys and fresh session keys

� Link between public-key and symmetric cryptography

� The only form of cryptographic protocol in wide use

� Can teach us a lot about design and analysis of more complex protocols

4

What is this class about

� Focus on design principles and lessons about prudent design/engineering of crypto protocols (KE and beyond)

� Learning from wrong designs… Ban homegrown cryptography!

� Examples are from real world, standardized key exchange protocols but at a very high level

� I defer to the experts in the audience for the details behind these standards…

� I’ll cover some basics of cryptographic analysis of KE prot’sbut also high-level and as non-technically as possible

� KE design and analysis offers a window into the development of more complex protocols

5

Page 3: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

3

Assumed Technical Background

� Heterogeneous audience (I guess): From cryptography experts to hands-on experience

� The intention is to provide a non-technical as possible intro to a subject that is very technical

� I do assume familiarity with basic cryptography notions (which I will review briefly)

� Hopefully, everyone will be able to learn something new or get non-trivial insights on the subject

� Let me know if you are too bored or too clueless (the class comes with a money back guarantee… ☺)

� Either way, feedback is important!

6

Part I� Introduction to the Introduction

� What is a Key Exchange Protocol

� Formalization and Design Challenges

� Main examples: Authenticated Diffie-Hellman

� Common pitfalls and sound design principles

� Learning by examples and counter-examples

� Formalizing and proving key exchange protocols

� Modular design and analysis: Authenticators

� Protocols

� ISO and SKEME

� STS and Photuris

� SIGMA Protocol and identity privacy

� IPsec’s Internet Key Exchange (IKE)

� TLS Handshake

7

Page 4: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

4

Part II

� Secure channels: securing the bits in the line

� Encryption and authentication

� Lessons from TLS failures

� Advanced KE protocols (when simplicity complicates life)

� Implicitly authenticated protocols: Arazi and HMQV

� efficiency vs proof complexity

9

Part III

Key Exchange Protocols (very informal)

� A protocol between two parties to establish a shared key

(“session key”) such that:

1. Authenticity: they both know who the other party is

2. Secrecy: only they know the resultant shared key

Also crucial (yet easy to overlook):

3. Consistency: if two honest parties establish a common session key

then both have a consistent view of who the peers to the session

are

12

A: (B,K) and B: (x,K) � x=A

Page 5: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

5

Key Exchange Protocols

� More generally:

� n parties; any two may exchange a key

� Sessions: multiple simultaneous executions

� Adversary:

� Monitors/controls/modifies traffic (man-in-the-middle)

� May corrupt parties: learns long-term secrets

� May learn session-specific information: state/keys

� Security goal: preserve authenticity, secrecy and consistency of uncorrupted sessions

� Confine damage from exposure to a minimum

13

Formalizing Key Exchange

� An intuitive notion but hard to formalize

� Wish list for formal definitions/model:

� Intuitive (beware!)

� Reject “bad” protocols (capture full capabilities of realisticattackers)

� Accept “good”, natural protocols (avoid overkill requirements)

� Ensure security of KE applications: “secure channels” as the quintessential application + composition

� Usability: easy to analyze (stand alone � composable) + a design tool

14

Page 6: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

6

Designing and Analyzing KE Protocols…

� …is non-trivial

� Yet the end protocol need not be complex

� And: to be practical the protocol MUST BE SIMPLE

� Best advice: learn from past experience (good and bad)

� Formal analysis as an indispensable tool

� But remember: there is no ULTIMATE security model or

absolute proofs of security

� only relative to the model (and cryptographic assumptions)

15

Detour: Cryptographic Primitives

� A brief reminder (I assume familiarity with these

concepts)

� Establish terminology

� Highlight notions used in the sequel (especially

computational indistinguishability)

16

Page 7: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

7

Math Preliminaries

� Zn = {0,1,…,n-1} Zn* = {i ∈ Zn : gcd(i,n)=1} e.g. Z12

* ={1,5,7,11} |Zn

*|= φφφφ(n). If p is prime then Zp* = {1,…,p-1}

� Operations in Zn will be modulo n

� Group: (G, ××××), …, every element in G has an inverse

� Z, R with +, non-zero R with ××××, (Zn,+) (Zn*,××××) , Gq ⊆ Zp* q/p-1 of order q

� Order = |G|, Abelian=commutative

� Cyclic group = {g0,g1,…, gn-1}, g=generator. E.g. (Zn,+), (Zp*,××××) , Gq

� Ring(+,××××): + is Abelian, ×××× may not have inverse, distributive, eg Z, Zn

� Field: Ring where each non-zero element has a multiplicative inverse: e.g R, C, Zp for p prime

17

Elliptic Curves

� Special type of groups

� Curves defined by equations of the form y2=x3+ax+ b over a field

� The points of the curve can be used to define a (additive) group

� Crypto applications use a prime-order subgroup

Page 8: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

8

PRG’s� Random Number Generator (RNG): A source of random

numbers: physical, entropy source, etc. (non-repeatable)

� Pseudo-random generator (PRG): deterministic algorithm expands a short secret seed into a sequence of bits

� Security: output is pseudo-random, i.e., cannot be distinguished from random bits by efficient means

� Implies: efficient algorithms behave “identically” with bits output by PRG than with perfectly random bits

� E.g., can replace random pads in one-time pad encryption with PRG outputs (where shared key is the seed) � stream cipher

� Two objects are (computationally) “indistinguishable” if they cannot be set apart by efficient algorithms

20

PRF’s

� Pseudorandom function (PRF): Family of keyed functions with fixed output length that are indistinguishable from random functions (w/o the secret key):

� Given fk(x1),…,fk(xn) can’t distinguish fk(x) from random for new x

� E.g., fK(1), fk(2),… is a PRG with seed k

� Example: CBC-MAC, HMAC

� Pseudo-random permutation: A PRF where the functions are permutations (1-1 with equal domain and range)

� Example: Block Cipher (AES, DES)

21

Page 9: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

9

Symmetric Encryption

� Same key for encryption and decryption

� “nothing learned” on the plaintext other than its length

� Attack types:

� Encryption oracle: known or chosen plaintext attack (KPA, CPA)

� Must randomize to prevent identifying repeated plaintexts

� Decryption oracle: chosen-ciphertext attack (CCA)

� Captures active attackers that can modify ciphertexts on route

� Implementation: block ciphers (AES, DES) + modes of

operations (cbc, ofb,…); stream ciphers (RC4, any PRG) 22

Semantic Security of Encryption (IND-CPA)

(exemplifies definitions by “experiments” (or games) and indisting’ty)

� Experiment between attacker A and “challenger” with key k.

� CPA: At any time and repeatedly during the experiment A can choose a plaintext m and get Enck(m)

� Test: A chooses plaintexts m0, m1 of same length

� A random bit b is chosen and EncK(mb) is given to A.

� A outputs b’ (a guess for b).

� “semantic security”: A can’t guess b with probability better than ½

� actually ½ + “negligible” (where negligible = “indistinguishable from 0”)

� Equivalent: probability spaces of ciphertexts of m0, m1 are indistinguishable

23

Page 10: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

10

MAC and Hash

� MAC: Message Authentication Code (e.g. CBC-MAC, HMAC)

� S and R share key, S: (M, t=Mac(M)), R: (M’, t’), check t’=Mac(M’) (verification may be different than re-computing Mac)

� Implementation: CBC-MAC, HMAC

� Security: unforegeability under “chosen message attack”

� Exercises: prf→mac, encryption ↛ authentication (e.g. otp)

� Hash functions: Map any-length inputs to fixed-length strings (e.g. MD5, SHA-1, SHA2)

� Collision-resistance, “random oracle” (abstracted as random function)

� KDF (key derivation function): maps imperfect (=good entropy but

non-uniform) key material into close-to-uniform (=pseudorandom) keys

24

Public Key Primitives

� PKE: Encryption with asymmetric (enc/dec) keys

� Same security notions as symmetric encryption (semantic security); note that CPA/KPA does not require oracles, CCA does.

� Implementation: RSA, ElGamal

� Digital signatures: like MAC but with asymmetric keys

� “chosen message attack” security, sometimes non-repudiation is important too (but usually not needed for KE)

� Implementation: RSA, DSA, ECDSA

� Digital certificates: A signed pair (identity, key)

� Attests to the identity-key binding

25

Page 11: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

11

RSA

� Secret key: primes p, q, private exponent d

� PK: n=p⋅q, public exponent e

� Relation e, d: e⋅d = 1 (mod φφφφ(n))

Encryption:

� Message space: Zn*, Enc(M)= Me mod n, Dec(C)=Cd mod n

� More precisely, msgs of certain length encoded into a value in Zn*

(later: example of encoding)

Signature:

� Signature on M: (Hash(M))d mod n, Verification on (M,sig): Check sige mod n =Hash(M)

� Note message recovery (e.g., from (Hash(M))d to (Hash(M))d’ )

26

Factoring and Discrete Logarithm

� Factoring: Given n=p⋅q find p, q

� Assumed hard for large enough primes (1024, 2048, …)

� Basis for RSA security (if factoring easy then RSA insecure,

inverse implication unknown)

� Discrete logarithm: Given cyclic group G={g0,g1,…, gn-1} with

generator g and a value h=gx for random x, find x. Examples:

� Zp* for |p|=1024, 2048,… (strength of 80, 112, … bits)

� Gq ⊆ Zp* (prime order q<<p): dlog hard as in Zp (except for

sqrt(q) attack) but allows for short exponents:|p|=1024,|q|=160

� EC groups: Assumed ideal strength 2n/2 for a group of size 2n

� Basis for Diffie-Hellman: if dlog easy then DH easy, inverse not true

27

Page 12: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

12

Diffie-Hellmanand

Key Exchange Protocols

28

Diffie-Hellman Exchange [DH’76]g = generator of a cyclic group G (e.g. Zp

*, EC group)

A B

29

• Both parties compute the secret key K=gxy=(gx)y=(gy)x

1. CDH Assumption: K hard to compute without x or y

2. DDH Assumption: K indistinguishable from random element in G

• Decisional DH assumption: (gx,gy,gxy) ≈c (gx,gy,grandom)

• From gxy to a k-bit key: KDF: gxy � {0,1}k (pseudorandom)

gy

gxrandom x

random y

Page 13: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

13

Diffie-Hellman KE and PFS

� Perfect Forward Secrecy (PFS)

� Once the session keys are destroyed there is no way to

recover them, not even by the owners

� Distinguishes D-H from other protocols

� compare SSL: What if your bank’s private encryption key ever compromised? ALL past traffic exposed!

� With PFS long-term keys used only for authentication30

(not even at gunpoint)

A B

B, gy

A, gx

Diffie-Hellman Exchange [DH’76]

A B

31

• beautiful, strong, but…

• secure only against eavesdroppers

• open to active attacker (man-in-the-middle)

B, gy

A, gx

Page 14: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

14

(Wo)Man-in-the-Middle

32

B, gy’

A BE

B, gy

A, gx A, gx’

KAB=gxy’ KBA=gx’y

Eve knows both keys!

The Long Journey TowardsAuthenticated DH Protocols

� UN-authenticated DH has survived without change for

36 years!

� In the same period, hundreds of papers published on

authenticated DH protocols, many (most?) of them broken!

� Why is it so hard?

33

Page 15: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

15

The Long Journey TowardsAuthenticated DH Protocols

� Why is it so hard?

� What is authentication? Difficult notion, non-trivial to formalize.

Changes with trust and setup scenarios.

� How do we know when a protocol is secure?

When are we done debugging it? Poor track record…

� Took long time to be able to develop sound, general

security models

� And even more to prove protocols in these models

� And guess what… unproven protocols tend to be broken34

Guided Tour to

Authenticated DH Protocols

35

Page 16: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

16

Conventions (and disclaimers)

� A, B denote participants as well as their identities.

� Certificates: We assume parties have long-term public keys which other parties can learn and verify

� Either by out-of-band verification or via certificates sent in the protocol (in the latter case A, B stand for identities plus certificates)

� We omit many essential operations such as explicit verification operations (of signatures and certificates)

� DH group: We use “universal parameters” (e.g. p, g) – these can be wired into the protocol, negotiated during execution, etc.

� Note: No protocol can be secure without careful treatment of these “details” (remember: in crypto, the devil is in the details)

� Here the focus is on basic structure and general principles

36

First Attempt at Authenticated DH

A B

37

B, gy, SIGB(gy)

• what if attacker ever finds a triple (x,gx,SIGA(gx))?

•E.g., file of precomputed (x,gx) pairs

• Violates basic principle: Ephemeral leakage should not allow for long-term impersonation (beyond the leaked session)

A, gx, SIGA(gx)

Page 17: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

17

Basic Authenticated DH (“BADH”)

Each party signs its own DH value to prevent m-i-t-m attack

and the peer’s DH value as a freshness guarantee against replay

A: “Shared K=gxy with B” (K�B) B: “Shared K=gxy with A” (K�A)

38

B, gy

SIGA(gy,gx)

A, gxA B

, SIGB(gx,gy)

Looks fine, but…

Identity-Misbinding Attack [DVW’92](a.k.a. Unknown Key-Share attack = UKS)

� Any damage? Wrong identity binding!

A: “Shared K=gxy with B” (K�B) B: “Shared K=gxy with E” (K�E)

E doesn’t know K=gxy but B considers anything sent by A as coming from E

39

B, gy, SIGB(gx,gy)

A, gx E, gx

B, gy, SIGB(gx,gy)

SIGA(gy,gx) SIGE(gy,gx)

A BE

Ξ

Page 18: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

18

A: “Shared K=gxy with B” (K����B)

B: “Shared K=gxy with E” (K����E)

� B = Bank A,E = customers

� A B: {“deposit $1000 in my account”}K

� B deposits the money in “K” ’s account, i.e. E’s!

� Should the bank protocol include explicit identities? Maybe,

but KE should not make assumptions on higher-layer mechanisms

� What is the expectation of higher layer protocols? That a key is

uniquely bound to its owners (“speaks for its owners”)

� SSL renegotiation’s bug: wrong binding of sessions (attack succeeded without the attacker ever learning the key)

40

post this page in my website

websiteposts the page

Yet another example

41

Page 19: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

19

Yet another example:

A: “Shared K=gxy with B” (K����B)

B: “Shared K=gxy with E” (K����E)

� A= F-16 B= Central Command E= drone

� B E: {“destroy yourself”}K

� E passes command {“destroy yourself”}K to A.

� Result: F-16 destroys itself!

42

Notes

� Attack discovered by Diffie-van Oorschot-Wiener

[DVW’92]

� the “differential cryptanalysis” of KE protocols

� a reminder of the crucial consistency property

� Note: The terminology Identity Misbinding Attack is mine

The attack is more commonly referred to as the

Unknown Key-Share (UKS) attack.

43

A: (B,K) and B: (x,K) � x=A

Page 20: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

20

A Possible Solution (ISO-9796)

44

A, gx

B, gy, SIGB(gx,gy,A)

SIGA(gy,gx,B)

B

Thwarts the identity-misbinding attack by including the identity of the peer under the signature

A

The ISO defense

A: aha! B is talking to E not to me!

Note that E cannot produce SIGB(gx,gy,A)

� The ISO protocol thus avoids the previous mentioned

attacks; but is it secure??

45

B, gy, SIGB(gx,gy,E)

A, gx E , gxA BE

B, gy, SIGB(gx,gy,E)

Page 21: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

21

The ISO Protocol is Secure

� We’ll sketch the proof in the SK-security model of key

exchange (known as the Canetti-Krawczyk model [CK’01] )

� Note: the actual ISO-9796 protocol is more complicated:

adds a MAC on the peers id -- which adds nothing to the

security of the protocol

� An important consequence of well-analyzed protocols:

avoiding “safety margins”

� PROOF-DRIVEN DESIGN®

Let’s then talk about KE models and proofs...

46

On KE Analysis Work

� Two main methodologies

� Complexity based: security against computationally bounded

attackers, proofs of security, reduction to underlying

cryptography, probabilistic in nature

� Logic-based analysis: abstracts crypto as ideal functions,

protocols as state machines, good protocol debuggers

� Recent bridging work towards “the best of two worlds”

� Here we focus on the first approach

47

Page 22: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

22

Remember a “definition desiderata”

� Intuitive (session notion, attacker capabilities, secrecy)

� Reject “bad” protocols (capture full capabilities of realistic attackers)

� Accept “good”, natural protocols (avoid overkill reqt’s)

� Ensure security of KE applications: “secure channels” as the quintessential application + composition

� Usability: easy to analyze (stand alone � composable) + a design tool

� One more confidence source: Equivalence of different definitions

48

SK Security [CK’01]

� Geared towards allowing protocol composition [BCK’98]

especially with generic “secure channels protocol”

� Follows indistinguishability approach [BR’93]

� Defines a set of possible adversarial interventions/corruptions

� Requires that such an attacker cannot distinguish the shared session key from random (as long as the parties to the session and the session itself are not corrupted)

� Secure channels as the must “test application”

� Requires a formalization of secure channels (e.g., a transport protocol such as IPSec, SSL, SSH) – more later

52

Page 23: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

23

SK-Security: KE protocol

� A two-party protocol in a multi-party setting

� Multiple protocol executions may run concurrently at the same or different parties

� Each run of the protocol at a party is called a session(a local object)

� Sessions have a unique local name: e.g. (A,sA) and an incoming name (B,sB) where B is the intended peer. The session id is the concatenation: (A,sA,B,sB)

� Sessions with corresponding names, i.e., (A,sA,B,sB) and (B,sB,A,sA) are called matching.

� Upon completion a session erases its state and outputs a triple: (session-id, peer-id, session-key)

53

SK-Security: Attacker

� Adversary model (Unauthenticated links Model - UM)

� Full control of communication links: monitors/controls/modifiestraffic (m-i-t-m)

� Schedules KE sessions at will (interleaving)

� May corrupt parties (total control): learns long-term secrets (e.g. signature key), all its state and session keys

� May issue a “learning query” for short-term information:

� session state query (e.g., the exponent x of a gx value)

� session key query (of a complete, present or past, session)

� Exposed session: if session owner is corrupted, or attacker issued a query against the session, or the matching session is exposed

� Clearly cannot protect a session if the matching is exposed54

Page 24: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

24

SK-Security: Attacker

� Adversary model: unAuthenticated links Model (UM)

� Full control of communication links: monitors/controls/modifies traffic (m-i-t-m)

� Schedules KE sessions at will (interleaving)

� May corrupt parties (total control): learns long-term secrets (e.g. signature key), all its state and session keys

� May issue a “learning query” for short-term information:

� session state query (e.g., the exponent x of a gx value)

� session key query (of a complete, present or past, session)

� Exposed session: if session owner is corrupted, or attacker issued a query against the session, or the matching session is exposed

� Clearly cannot protect a session if the matching is exposed55

AM X

XX

X passive attacker

A KE Protocol is called SK secure if

1. Completed matching sessions output same session key

(functional, non-triviality clause)

2. Attacker learns nothing about unexposed sessions

� Captured via “test session”; chosen by attacker among

completed unexposed sessions

� Attacker is given either the session key or an independent

random key; it needs to guess which one is the case

� Require that the probability that the attacker guesses right

is not significantly better than a random guess (i.e. ½ + small ε)

56

Page 25: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

25

A compact but strong definition

� Captures many attacks that were enumerated in the past as separate requirements (or wish lists). For example:

� Impersonation: if E can impersonate Bob without corrupting him then E knows a key of an unexposed session, contradicting the definition

� Secrecy: If E learns anything about the session key then it can distinguish it from random. (Note: Why indistinguishability? The OTP example.)

� Known-key attacks: An important class of attacks studied separately in the past: Can E break one session given the key of another session? Captured via session key query

� Identity misbinding: if E forces two sessions w/outputs (A, B, K) and (B, E, K), then E can choose one as test and expose the other to learn K (it is allowed to do so since sessions are not matching)

� The definition can be further extended to cover other threats and security properties: e.g. PFS (via key expiration)

57

Informal Summary

� Summary of security guarantees for honest A,B:

1. If A outputs session key (A, B, K) and B is honest then no one except B may know anything about K (not even a single bit)

� Does the protocol guarantee that B outputs the key??

� “key confirmation” possible but “common knowledge” is not

2. Session keys are “computationally independendent” of e/other

� Also, session keys cannot be used during the key exchange itselfWe’ll say more about this in the TLS chapter.

� Note: Sharing a key with a corrupted party:

� No guarantee for a key shared with a corrupted party.

� But there is a guarantee that interacting with the attacker does not compromise any session between honest parties

58

Page 26: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

26

About public keys

� Parties have long-term secrets

� private signature/decryption keys, or shared keys w/other parties

� In the PK case: public keys of honest parties are assumed to

be communicated to other parties correctly.

� Public keys of corrupted parties are chosen by the attacker

arbitrarily (e.g., may be equal to a public key of another

honest party).

� Think of a CA that checks identity but no other properties of the

keys being registered (does not assume/require proof of

possession, checking structure of a key, etc.)

59

SK-security results (secure channels)

� SK-security � Secure Channels

� Any key exchanged with an SK-secure KE protocol and used to “encrypt-then-authenticate” data realizes a secure channel [CK01]

� Secure channel realization:

� K = output of KE (may require a KDF step, e.g. if K=gxy ; can be combined with prf step below)

� Keys (Kenc, Kmac) = prfK(context) where context may include session/protocol/algorithm identifiers, parties identities, etc.

� Having directional keys (A�B and B�A) is a good idea

� Apply to data: c=EncKenc(data), t=MacKmac(c); transmit (c,t)

� Other combinations, e.g. EncKenc(data || MacKmac(data)) may not be secure (more later on TLS)

60

Page 27: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

27

SK-security results (protocols)

� A variety of protocols have been proven SK-secure

(both DH and key-transport)

� e.g., ISO, IKE (SKEME, SIGMA), HMQV, preshared and more

� Two SK-secure flavors: with and w/o PFS

� PFS modeled through session-expiration (models erasure); expired sessions are NOT exposed even if attacker corrupts the session’s owner.

61

SK-Security and Composition

� SK-Security preserved under authenticators

� Authenticator: A “compiler” from (ideal) AM-secure protocols to

(realistic) UM-secure protocols (a design and analysis tool!)

� More in following slides (incl. the proof of the ISO protocol)

� CK02: SK-Security is “universally composable” (UC)

� remains secure under composition with any application –

not just secure channels

� Well, almost: true for protocols with the ACK property

� True always if UC security weakened via “non-information oracles”

(see CK02 eprint/2002/059)

62

Page 28: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

28

Authenticators [BCK98]� Recall:

� UM (Unauthenticated-links Model): a realistic attack model as described before

� AM (ideally Authenticated-links Model): like UM but attacker is passive; cannot change or inject msgs on links (but it may prevent delivery)

� Authenticator : a “compiler” from AM-secure protocols to UM-secure

� Reduces the problem of designing (and analyzing) protocols from the complex UM to the simple AM

� For example: Proving plain DH in the AM is immediate (under DDH assumption)

63

Authenticators (sketch of idea)

� Message sending protocol (can be interactive)

� Parties send and receive messages and register their actions

(“sent msg m to B”, “received msg m from A”)

� An authenticator is a message sending protocol such

that:

� whenever A registers “received m from B”, it also holds that B

registered “sent m to B”

� Note: To capture replay attacks: messages are assumed unique

(e.g., concatenated with msg id or nonce)

64

Page 29: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

29

Authenticators Theorem

� Theorem: Let A be an authenticator

� If P is a protocol secure in the AM model

� and P’ is the result of applying A to each message in P

Then, P’ is secure in the UM model.

65

A signature-based authenticator (applied to message msg)

66

A, msg

B, nonce

A, SIGA(nonce,msg,B)

Compiler from AM to UM: apply the above authenticator . to each protocol’s message

A B

Page 30: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

30

Proving ISO Using an Authenticator

� First prove basic DH is SK-secure in AM

(equivalent to DDH assumption)

A B

67

B, gy

A, gx

� Next apply the sig-based authenticator to this protocol� a proof of the ISO protocol!!

Applying the Sig-Authenticator to AM-DH

68

A, SIGA(gy,gx,B)

A, gx

Authenticator applied to gy is a slightly different variant: first A sends nonce (gx), then B sends message (gy) with signature

Conclusion: the ISO protocol is SK-secure (QED: with a simple and intuitive proof)

B, gy, SIGB(gx,gy,A)B, gy

msg=gx

nonce=gymsg=gy

nonce=gx

signature authenticator

We have: ISO = AM-DH plus Signature-based authenticator

Page 31: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

31

Other Authenticators

(and the SKEME Protocol)

69

Encryption-based authenticator

Single message authenticator: A B:

70

A, msg

B, ENCA(k)

A, msg, MACk(msg,B)

Compiler from AM to UM: apply the above authenticator . to each protocol’s message

A B

msg

Page 32: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

32

Applying the Enc-Authenticator to AM-DH

71

A, gx, MACk2(gx,B)

A, ENCB(k1)

� the SKEME protocol [K’96,IKEv1]

Variants: •Key transport (no pfs) . • Pre-shared key (with a MAC-based authenticator)

B, gy, MACk1(gy,A), ENCA(k2)

msg=gx

msg=gy

Authenticators are not always…

� Possible

� Either the design is not decomposable into a basic AM-secure protocol and an authenticator applied to it

� Or desirable

� The decomposition is artificial and adds more technicalities than understanding

� Yet, when they “work” it usually results in a more intuitive and easier-to-analyze protocol

� And designing KE with authenticators in mind reduces the chances of hidden flaws

73

Page 33: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

33

More on the Design of Key Exchange Protocols

� Privacy Issues: Identity Protection, deniability

� The design of the IKE Protocols: SKEME, SIGMA

� “IPsec’s Key Exchange” (IKEv1, IKEv2)

74

On Identity-Protecting KE Protocols

� Identity protection

� hiding identities from passive and/or active attackers

� Logical identities (e.g. cert’s) vs. physical addresses

� A privacy concern in many scenarios

� Probing attacks in the Internet: who are you?

� Location anonymity of roaming users

� The “intelligent passport” application

� IPSec/IKE: design highly influenced by such privacy concerns (� SKEME, SIGMA)

75

Page 34: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

34

Identity Protection

� Passive vs. active attacker

� Both id’s protected against passive attacks but only one against

active attacks

� Whose identity should get active defense?

� Initiator: roaming user (e.g. hide location)

� Responder: avoid probing attacks: who are you? (e.g. passport)

� Presents some design challenges: conflict between

anonymity and authentication

76

Identity Protection in SKEME

77

A, gx, MACKb(gx,B)

A, ENCB( Ka)

Issue: Id protection requires A to know B’s pk (before run)

Next: SIGMA (signature based, solves this issue, IKEv2)

B, gy, MACKa(gy,A), ENCA( Kb) X B,

X A,

Page 35: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

35

Why not ISO?

� B needs to know A’s identity

before he can authenticate to A;

same for A

� Protection against active attackers is not possible

� Another privacy concern: leaving a signed proof of

communication (signing the peer’s identity)

� Letting each party sign its own identity rather than the peer’s

solves the privacy issues but makes the protocol insecure

(the identity-misbinding attack again)

78

A, gx

B, gy, SIGB(gx,gy,A)

SIGA(gy,gx,B)

BAA, gx

B, gy, SIGB(gx,gy,A)

SIGA(gy,gx,B)

BA

Unsuited for identity protection

Alternative Solution: STS [DVW’92]

� Idea: to prevent the Id-M attack against BADH,

A and B “prove knowledge” of K=gxy to each other

� Reminder Id-M attack (note that E doesn’t know gxy)

79

Page 36: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

36

Alternative Solution: STS [DVW’92]

� Idea: each peer proves knowledge of K=gxy

(prevents the Id-M attack since in BADH E doesn’t know gxy)

� As a “Proof of Knowledge” the STS protocol uses encryption under K=gxy

80

B, gy, {SIGB(gx,gy)}K

{SIGA(gy,gx )}K

A, gxA B

B, gy, {SIGB(gx,gy)}K

{SIGA(gy,gx )}K

A B

(encryption denoted by {…}K)

STS Pro’s and Con’s

☺ Pro: STS can protect identities

� Peer’s id not needed for your own authentication

� Can extend encryption to cover identities (or cert’s)

81

gxA B

gy, {B, SIGB(gx,gy)}K

A B

{A, SIGA(gy,gx )}K

Page 37: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

37

STS Pro’s and Con’s

�� Con: Protocol is insecure! (encryption is not the right

function to prove knowledge of a key)

� E.g.: if Eve can register A’s public-key under her name she can

mount the I-M attack (w/o even knowing gxy!)

82

gxA B

gy, B, {SIGB(gx,gy)}K

A B

A, {SIGA(gy,gx )}K

E

E/

Identity-Misbinding on STS

� Eve registers A’s PK as her own PK

� Applicable when CA checks for identity of registrant but not

for “possession” (PoP) of private key

� The attack is trivial if cert’s not encrypted and trivial

too if encrypted with a stream cipher

� First issue is debatable but enough to show that “proof

of knowledge of gxy” via encryption is not enough.

83

MOREOVER…

Page 38: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

38

STS with MAC (instead of encryption) [DVW]

� MACK better suited to provide Proof of Knowledge of K

� Yet: same attack as w/ encryption is possible!

� Can be mounted even if priv-key PoP is required! [BM99]Even if id put under sig (“on-line registration attack”)

84

gxA B

gy, B, SIGB(gx,gy), MACK(SIGB)

A B

A, SIGA(gy,gx ), MACK(SIGA)E/

E/

What is going on?

� The point is that “proof of knowledge” of K=gxy is not the issue

� What is required is:

binding the key K with the peer identities

� Which brings us to the SIGMA design

� SIGn and MAc-your-own-identity!!

� And what about Photuris?

� Yet another STS variant: Sign K=gxy as “proof of knowledge”; also insecure (see the SIGMA paper)

� But first another don’t-do-it lesson: Photuris

86

Page 39: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

39

But first another don’t-do-it lesson: Photuris

87

Photuris Protocol (early version)

88

A, gx

B, gy, SIGB(gxy)

SIGA(gxy)

BSign gxy as direct authentication of gxy and proof of knowledge of gxy

A

- Id-Misb attack: Eve replaces SIGA(gxy) with SIGE(gxy) , possible with RSA (no need for E to register A’s PK as her own)

- SIG leaks information about gxy e.g. H(gxy) with RSA. Theoretical only ? No. Keys derived as HMAC(key=gxy, data) which is computable given gxy

- Small subgroup attack: next

Page 40: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

40

Photuris Protocol (early version)

89

A, gx

B, gy, SIGB(gxy)

SIGA(gxy)

BA

SMALL SUBGROUP ATTACK:

• Assume g in Zp and p-1 has a small divisor s (i.e. p=s⋅t+1, e.g. s=3)

• Attacker replaces gx with (gx)t and gy with (gy)t

• A and B compute same key K=gxyt

• But K now has order s, hence it only has s possible values! (gt, g2t,…, gst)

Note: Adding gx, gy under sig solves the small group attack but not the others

The SIGMA Protocols

90

Page 41: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

41

SIGMA: Basic Version

92

A, SIGA(gy,gx)

BA

gy, B, SIGB (gx,gy)

gx

*Km (and session key) derived from gxy via a prg/prf

SIG and MAC: complementary roles (mitm and binding, resp)

Does not require knowing the peer’s id for own . authentication � Great for id protection (& deniable)

, MACKm(B)

, MACKm(A)

SIGMA-I:active protection of Initiator’s id

93

gx

gy, {B, SIGB (gx,gy), MACKm(B) }Ke

{A, SIGA(gy,gx), MACKm (A) }Ke

BA

*Ke and Km derived from gxy via pseudorandom function

Responder (B) identifies first

� Initiator’s (A) id protected

Page 42: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

42

SIGMA-R:active protection of Responder’s id

94

BA

{ B, SIGB (gx,gy), MACKm’(B) }Ke’

gx

gy

{ A, SIGA (gy,gx), MACKm (A) }Ke

Note: Km, Km’ and Ke, Ke’ (against reflection attack)

IKEv1 Variant: MAC under SIG

Equivalent security (just save MAC space):

95

gy, B, SIGB (MACKm (B, gx,gy))

A, SIGA (MACKm (A, gy,gx))

gxA B

� this is IKE’s “aggressive mode” (no id protect’n)

Note: MAC(SIG(id,…)) is not secure!! (STS-MAC)

Page 43: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

43

IKE Main Mode

96

BA gx

gy

{ A, SIGA (MACKm (A, gy,gx)) }Ke

{ B, SIGB (MACKm’ (B, gx,gy)) }Ke’

IKE v2: a slight variant – only MAC(id) under SIG

SIGMA Summary

� SIGMA suitable for most applications requiring a

Diffie-Hellman key exchange:

� Simple and efficient (minimizes msgs and comput’n)

� No over-design (nor under-design)

� With or without ID Protection

� Standardized: core key-exchange protocol for both IKEv1 and

IKEv2

� The “off-the-record communication” [Goldberg-Borisov]

(use of deniability – proven in [DGK])

97

Page 44: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

44

But is SIGMA Secure?!

� Secure! (rigorous analysis): Canetti-K Crypto’02

� Formal proof: each element is essential

� e.g., SIG(MAC(id,…)) vs. (SIG(id,…), MAC(SIG(id,…)))

� Guarantees secure channels

� Secure composition with arbitrary applications (UC)

� From theory to practice

� Specification, implementation, DETAILS (see “full fledge” appendix in paper -- web version)

� DoS defenses: selective (IKEv2), integral (JFK-R)

� ID Prot’n: Encryption secure against active attackers (RCCA)

� Certificates, …98

Design Principles (informal)

not a recipe for secure design but good to keep in mind as sanity checks

100

Page 45: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

45

Basic Principles

� Authentication: fresh binding between session key,

session-id and peers identities

� Importance of consistent view by the peers.

� Some basic measures:

� authenticate it all (under signature, mac, prf, etc.)

� include identities under authentication

� include non-repeating nonces for freshness (prevent replay)

� unique session-id's (prevent interleaving attacks)

� ... and do not forget: encryption ↛↛↛↛ authentication!!!101

Basic Principles

� Secrecy: No information to be leaked on session key regardless of attacker actions (in current and other KE sessions)

� “Key virginity”: Never use the output session-key (and direct derivatives) during the KE protocol (e.g., STS/TLS vs IKE)

� Session-key freshness & independence: e.g., known-key attacks

� Key refreshment: support frequent refresh mechanisms

� short-lived vs. long-lived keys; limit key usage; exposure and cryptanalysis

102

Page 46: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

46

Basic Principles

� Algorithm independence (“algorithm agility”):

� functional specification vs. implementation choices

� replaceable algorithms (cryptanalysis, better algorithms)

� negotiation (even if basic/simple)

� allows for generic analysis

� Key derivation and separation:

� No key used for two different purposes

� All derived keys must be cryptographically independent (e.g. exposure of a MAC key does not compromise the Enc key)

� Session key as seed to further key derivation (eg. prfk(session id, alg-identifier, usage params,…)

103

Features/Properties

� Perfect forward secrecy:

� disclosure of long-term secret keying material does not compromise the secrecy of exchanged keys from earlier runs (eg. Diffie-Hellman)

� Privacy and anonymity:

� hiding peer identities from eavesdroppers and active attackers, eg. mobile users; digital signatures and “proofs of communication”

� Resistance to denial-of-service:

� reduce opportunities for denial of service attacks; conflict with cryptographic authentication (especially via PK);

� Simplicity as a security feature: Keep it simple! (but not simpler)

104

Page 47: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

47

Protocol Analysis

How can we know a protocol is secure?

� no assessment of security by “simulation”: it runs ↛ it is secure

� mathematical modeling and analysis as essential tools

� universal statements: there exist NO attacker such that... (cf. a better compression algorithm)

� complexity approach: transform an attack strategy against the pro-tocol into an algorithm to break the underlying crypto primitives

� logic approach: state machine of possible attacker actions, test reachability of “bad” states (excellent debugging tool)

� In recent years: integration with the computational approach

105

Proving security of protocols

� develop a formal model of communication and attack, and a strict definition of the goal of the protocol:

� what do we allow the attacker, what we want to prevent him from

� within the defined model develop proofs of security conditioned on the security of the underlying generic cryptographic functions:

� constructively show how to transform an attack strategy that subverts the goals of the protocol into an algorithm to break the cryptographic primitives (encryption, signatures, MAC, etc.)

� Thus, as long as the attacker is not able to break the underlying crypto functions then it cannot break the protocol)

106

Page 48: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

48

The quantified approach

� Attacker's resources and success are quantified

� “investing time t can break with probability ℇ"

� provides a quantified proof of security(not a yes-secure/not-secure statement).

� “if AES is (t, ℇ)-secure (as block cipher/PRP) then protocol P when instantiated with AES is (t', ℇ')-secure (as key-exchange)”

� Contrast above with an analysis that enumerates attacks; here the scope of attacks are determined by the attack model.

� Still, a sanity test for an attack model is to check that it covers known attacks (such as M-in-M, interleave, known-key, replay, reflection, etc.), and that it ensures the security of functionalities it needs to support (e.g., secure channels in the case of key exchange)

� Keep in mind: Proofs are worth not more than the model they build upon (and the assumptions on underlying crypto primitives)

107

PROOF-DRIVEN DESIGN®

� Proof-driven design: Formal analysis as main design tool

� Guides us to choose secure mechanisms, compose them

right, discern between the essential, desirable and

dispensable

� Result is efficiency, simplicity, rationale, even impl’n

guidance!

108

Page 49: An Introduction to the Design and Analysis of Authenticated Key Exchange Protocolstce.webee.eedev.technion.ac.il/wp-content/uploads/sites/... · 2018. 3. 27. · Advanced KE protocols

49

Final Remark

� The KE area has matured to the point in which there is no reason to use unproven protocols

� Addressing practicality does not require (or justify) giving up on rigorous analysis

� Proofs not an absolute guarantee (relative to the security model), but the best available assurance

� It is easy to design simple and secure key-exchange protocols, but it is easier to get them wrong…

109

110

©2012 by Hugo Krawczyk. Permission to make digital or hard copies of part or all of this material is currently granted without fee provided that copies are made only for personal or classroom use, are not distributed for profit or commercial advantage, and that new copies bear this notice and the full citation.