Protocol Design Jens Hermans & Roel Peeters, KU Leuven/COSIC - - PowerPoint PPT Presentation

protocol design
SMART_READER_LITE
LIVE PREVIEW

Protocol Design Jens Hermans & Roel Peeters, KU Leuven/COSIC - - PowerPoint PPT Presentation

Protocol Design Jens Hermans & Roel Peeters, KU Leuven/COSIC The ideal protocol serves exactly the applications needs comes at a low cost is simple (elegant) is efficiently implementable is provably


slide-1
SLIDE 1

Protocol Design

Jens Hermans & Roel Peeters, KU Leuven/COSIC

slide-2
SLIDE 2

The ideal protocol

 … serves exactly the application’s needs  … comes at a low cost  … is simple (elegant)  … is efficiently implementable  … is provably secure  … does not exist

slide-3
SLIDE 3

Before you start, know this

Protocol design is hard !!!

 Roughly half of the protocol papers start with “Attack on …” or “On the (claimed) security of …”  You need someone that constantly challenges you  Iterate, iterate, iterate > 1,5 years many many iterations

slide-4
SLIDE 4

Overview

 Understand Your Application  Common Goals  Common Design Choices  Building Blocks  Basic Protocols  Proofs  Common Pitfalls

slide-5
SLIDE 5

Understand Your Application

This is the most important thing whether selecting an existing protocol or designing your own

slide-6
SLIDE 6

Constraints

Examples:  Battery operated  Limited storage  Entire protocol < 400 ms (passive RFID tags)  Needs to work (also) offline But also what is already available? E.g. AES instruction in processor, ECC-coprocessor already on chip

slide-7
SLIDE 7

Goals

 Security

 Authentication (Entity / Data)  Data Confidentiality  Privacy  …

 Efficiency (i.e. low cost)  Simplicity  Verifiability

slide-8
SLIDE 8

Attacker capabilities

 Who is your attacker?

slide-9
SLIDE 9

Example: Unlock front door

slide-10
SLIDE 10

Example: Public Transportation

slide-11
SLIDE 11

Example: Smartmeter

slide-12
SLIDE 12

Example: Container Tracking

slide-13
SLIDE 13

Example: Medicine tracking

slide-14
SLIDE 14

Costs

Different types of cost:  Chip area  Power  Energy  Speed  Communication rounds  Cost at the backend  …

slide-15
SLIDE 15

Common Goals

slide-16
SLIDE 16

Data Authentication

Alice Bob Eve

slide-17
SLIDE 17

Entity Authentication

Eve

Hello, I am Alice

Bob

slide-18
SLIDE 18

Non-repudiation

Alice Bob

slide-19
SLIDE 19

Data Confidentiality

Alice Bob Eve

slide-20
SLIDE 20

Privacy

? ? Eve

slide-21
SLIDE 21

Prevent Denial of Service

Bob Eve

slide-22
SLIDE 22

Protect against key leakage

(forward/backward secrecy) Eve

slide-23
SLIDE 23

Common Design Choices

slide-24
SLIDE 24

Backend Processing

Alice: €100 … Auth Alice €100

Trust?

slide-25
SLIDE 25

Symmetric/Asymmetric Key

Symmetric

Scale: O(N2) keys, central authority, or share keys (=risk) Efficient

Asymmetric

O(N) keys

slide-26
SLIDE 26

Key Management

 Use key only for one function: e.g., either MAC or ENC (or AE)  Protect your keys

 HW security  Key encapsulation (brute-force risk)  Secret sharing  …

 When to trust a key?

slide-27
SLIDE 27

Key Updates

2006 2016

 Swap keys (different algorithm?)  Other parties:

 Central Authority?  Individual notification? Linking?

slide-28
SLIDE 28

Key Updates

 RFID Scene: change key every time (“improves” privacy)  Problems

 Power to overwrite key in mem? 2x mem required  Desynchronisation  Inherent issues of symmetric key

slide-29
SLIDE 29

Mutual Authentication

 Devices only respond to authorised queries

 Enhanced privacy, side-channel resistance

 Optional data transfer  Prevent DoS attacks when using coupons

First reader authentication, then tag authentication

slide-30
SLIDE 30

Secure Hardware

slide-31
SLIDE 31

Building Blocks

slide-32
SLIDE 32

Key Derivation Function

slide-33
SLIDE 33

Key Derivation Function

Extract-then-Expand

[Krawczyk]

slide-34
SLIDE 34

Hash chains

data hash(...) data hash(...) data hash(...)

slide-35
SLIDE 35

Merkle Tree

r d1 d2 d3

slide-36
SLIDE 36

One Time MAC

 Information-theoretic security  Can only use key for one MAC  Cheap! (but: where does the key come from?)  Examples: pairwise-independent universal hash, Poly1305..

slide-37
SLIDE 37

Authenticated Encryption

 Protect confidentiality & integrity  CAESAR competition  More on Wednesday!

slide-38
SLIDE 38

Diffie-Hellman revisited

 x  y generate x compute  x generate y compute  y compute k=( y) x compute k=( x)y

  • How does Alice know that she shares this

secret key k with Bob?

  • Answer: Alice has no idea at all about who

the other person is! The same holds for Bob

slide-39
SLIDE 39

MITM attack on DH

 Eve shares a key k1 with Alice and a key k2 with Bob  Requires active attack (Eve modifies messages)

 x1  y1

k1 =( y1) x1 =( x1)y1

 x2  y2

k2 =( y2) x2 =( x2)y2

slide-40
SLIDE 40

Pairings (bilinear maps)*

 G1 x G2  GT  ê(aP, bQ) = ê(bP, aQ) = ê(abP, Q) = ê(P, abQ) = ab ∙ ê(P, Q)  Pairings for Cryptographers by S.D. Galbraith and K.G. Paterson and N.P. Smart [eprint 2006/165]  Do not use pairings over F2n !

slide-41
SLIDE 41

Commitments

 Allow to commit to a choice without revealing it  Binding: cannot be opened to any other value  Hiding: cannot be determined to which value was been committed  Both can be perfect/computational, however commitments can never be both perfectly binding and perfectly hiding

slide-42
SLIDE 42

Bit Commitment

 Alice wants to commit a bit but does not want to reveal it till some time in future  Bob wants to make sure Alice cannot change her committed choice  Why not simply encrypt something and give the key later?

  • may find another key (it’s only a bit)

 Using symmetric key: Bob sends R, Alice commits EK{R,b} to Bob, gives up K later

slide-43
SLIDE 43

Feldman Commitment

gx mod p  Perfect binding  Computationally hiding

slide-44
SLIDE 44

Pedersen Commitment

gx hy mod p where a is unknown w.r.t. g = ha mod p  Computationally binding  Perfect hiding

slide-45
SLIDE 45

Zero Knowledge

How to explain zero-knowledge protocols to your children [Quisquater et al. 89]

slide-46
SLIDE 46

Schnorr Authentication

R = rP e s = ex + r X = e-1(sP-R) ? X x, X=xP

slide-47
SLIDE 47

Schnorr Authentication

Zero Knowledge: knowning only X one can come up with <R,e,s> such that X = e-1(sP-R):  Choose e and s at random  Fix R = sP – eX  History: EC-DSA vs. Schnorr

slide-48
SLIDE 48

Schnorr Signature

M e=H(R,M), s = ex + r R’ = sP – eX e = H(R’,M)? X x, X=xP R = rP For a message M to be signed:

slide-49
SLIDE 49

Blind Signatures*

M’= M ∙ re mod N s' = M’d mod N (e, N) (d, N) For a message M to be signed: r at random s = s’ ∙ r-1 mod N

slide-50
SLIDE 50

Homomorphic Encryption

Enc is homomorphic for an operation □ on message space M iff Enc(m1 □ m2) = Enc(m1) ◊ Enc(m2) with ◊ operation on ciphertext space C  If □ = +, then Enc is additively homomorphic  If □ = x, then Enc is multiplicatively homomorphic

slide-51
SLIDE 51

Multiplicative Homomorphic

 Textbook RSA ENC(m1)∙ENC(m2) = m1

e ∙ m2 e mod N = (m1 ∙ m2)e mod N

= ENC(m1 ∙ m2)  ElGamal ENC(m1)∙ENC(m2) = (gr1 , m1 ∙ yr1 ) ∙ (gr2 , m2 ∙ yr2 ) = (gr1 + r2 , (m1 ∙ m2) ∙ yr1 + r2 ) = ENC(m1 ∙ m2)

slide-52
SLIDE 52

Additive Homomorphic

 Exponential ElGamal  Paillier ENC(m1)∙ENC(m2) = (gm1 ∙ r1

n) ∙ (gm2 ∙ r2 n)

= gm1 + m2 ∙ (r1 ∙ r2)n = ENC(m1 + m2 mod n2)

slide-53
SLIDE 53

Secret Sharing

# shares: n = 5 threshold: t+1 = 3 secret: x share i: xi Lagrange multipliers λi x = ∑ xi⋅λi

slide-54
SLIDE 54

Verifiable Secret Sharing

 The dealer also commits to polynomial, allowing each recipient to verify that their share is on the same polynomial

f(z) = a0 + a1z + ... + atzt with a0 = s sj= f(j) ci = gai gsj = ∏i ci ji

slide-55
SLIDE 55

Distributed Key Generation

 no single party knows the secret  Each party acts as dealer  Share = sum subshares  Secret = sum subsecrets  Public key needs to be extracted

slide-56
SLIDE 56

Resharing

 A similar mechanism can be used to reshare a shared secret  To recover from parts that have been compromised  This is done by each dealer setting its current share as the secret in a new DKG protocol

slide-57
SLIDE 57

Threshold Cryptography

Combine homomorphic encryption with secret sharing:  Each party can do partial decryptions using its part of the key  Partial decryptions (> t+1) can be combined into the decryption  A similar thing can be done for signature schemes (usually more involved because of distributed generation of randomness while signing)

slide-58
SLIDE 58

Oblivious Transfer*

m0, m1 k random, b d, N, e (RSA) x0, x1 random N, e, x0, x1 v v = xb + ke mod N m0’ = (v-x0)d mod N + m0 m1’ = (v-x1)d mod N + m1 m0’,m1’ mb = mb’ - k

slide-59
SLIDE 59

PUFs*

 Process variations during manufacturing make chips unique ~ fingerprint  Instead of programming keys into devices, you just take the fingerprint  Measuring circuit + error correction (due to noise and bias)  Low entropy  Physical attacks to the chip (e.g. to extract keys) will result in destroying the PUF

slide-60
SLIDE 60

Basic Protocols

slide-61
SLIDE 61

Symmetric Authentication

 ISO/IEC 9798-2 or ISO/IEC 9798-4

slide-62
SLIDE 62

Asymmetric Authentication

 ZK-proof  Signatures (ISO/IEC 9798-3)  (H)MQV-type key establishment

slide-63
SLIDE 63

Schnorr Authentication

R = rP e s = ex + r X = e-1(sP-R) ? X x, X=xP

slide-64
SLIDE 64

SIGMA

slide-65
SLIDE 65

Proofs

By trying to prove your protocol, you often identify mistakes Show that you thought about your proposed protocol

slide-66
SLIDE 66

Information theoretic/ computational

vs

slide-67
SLIDE 67

Reductions

 Assume: attacker A on protocol  Use attacker A to build attacker B on hard problem  Since B can not exist, hence A can not

slide-68
SLIDE 68

Random Oracle Model

 Replace hash by random oracle Input Output I1 R1 I2 R2

slide-69
SLIDE 69

Generic Group Model

 Similar to RO, but for groups  Perform group operations through oracle Dlog Handle

1 P 123 Q

124 R

slide-70
SLIDE 70

Game Based Proofs

slide-71
SLIDE 71

Simulator Based Proofs

slide-72
SLIDE 72

Forking Lemma (Rewinding)

slide-73
SLIDE 73

CDH/DDH

 CDH: given ga and gb , it is hard to compute gab  DDH: given ga, gb and gc, it is hard to determine if gc = gab

slide-74
SLIDE 74

ODH/StrongDH

 OracleDH

 DDH with restricted CDH oracle. Uses H(gab).

 StrongDH

 CDH with restricted DDH oracle  Oracle is useful to generate replies in protocols

slide-75
SLIDE 75

Common Pitfalls

slide-76
SLIDE 76

Attack Listing

slide-77
SLIDE 77

Non-general Model

 EMV protocol & tracing  Key extraction & tracing (red-dot test)  Circular definitions

slide-78
SLIDE 78

Non-realistic Assumptions

 Physical attacks: reveal everything but…  The ‘wise’ adversary [Ng et al. ESORICS2008] “An adversary A who is ‘wise’ on oracle access will not make any oracle access that is redundant, or in other words, brings no advantage to him in attacking privacy of the protocol. Simply speaking, A will not waste any oracle access.”

slide-79
SLIDE 79

Correctness !!!

Efficient, secure, private authentication  Efficient: no computation, no communication  Secure: no one that is not allowed to go in, can possibly go in  Private: no communication

slide-80
SLIDE 80

Way too complex

 Keep It Simple Stupid

slide-81
SLIDE 81

Inappropriate PUF Usage

 PUFs are noisy and biased, this should be taken into account  If secure storage is needed, why a PUF in the first place?

slide-82
SLIDE 82

Shooting Practice

slide-83
SLIDE 83

BADH-1

slide-84
SLIDE 84

BADH-2

slide-85
SLIDE 85

BADH-2

slide-86
SLIDE 86

Liao and Hsiao’s Secure ECC-based RFID Authentication Scheme integrated with ID-Verifier Transfer Protocol

slide-87
SLIDE 87

Yoking protocols