27
Public key crypto (quick intro) Provable cryptography Slides from Bart Preneel and Phil Rogaway 1

Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Public key crypto (quick intro)Provable cryptography

Slides from Bart Preneel and Phil Rogaway

1

Page 2: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Comp527 status

• Hack-a-Vote phase 2 complete– Scott will make everything public– See what you missed / what others found

• Phase 3 now assigned– Use cryptyc to model a better crypto protocol– Scott’s tutorial from Monday online later today

2

Page 3: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Public key primitives

• Diffie-Hellman– Hard problem: Discrete logarithms

• RSA– Hard problem: Factoring composite numbers

• Field: integers modulo a large prime number (numbers wrap around)

3

Page 4: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

A public-key distribution protocol: Diffie-Hellman

• Before: Alice and Bob have never met and share no secrets; they know a public system parameter α

α x

α ygenerate x

compute α xgenerate y

compute α y

compute k=(α x) ycompute k=(α y)x

4

• After: Alice and Bob share a short term key k – Eve cannot compute k : in several mathematical

structures it is hard to derive x from α x

(this is known as the discrete logarithm problem)

Page 5: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Diffie-Hellman (continued)

α x

α ygenerate x

compute α xgenerate y

compute α y

compute k=(α y)x compute k=(α x)y

• BUT: 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.

5

Page 6: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Station to Station protocol (STS)• The problem can be fixed by adding digital

signatures• Many variations on this theme used in practice

k=(αy)x

αx

αyk=(αx)y

SigA(αx,αy)

√ SigBSigB(αy,αx)

√ SigA

choose ychoose x

6

Page 7: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Footnote: if you can define multiplication…

• “Elliptic curve” crypto looks the same as Diffie-Hellman

• Instead of integers mod N– y2 = x3 + Ax2 + B (mod p) – A, B, p are “carefully chosen”– Integers (x,y) on the curve form a group– Addition, multiplication, exponentiation can be defined

• Claim: DLog is harder for elliptic curves than modular integer arithmetic– Therefore we can use smaller numbers faster computation

7

Page 8: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

RSA (‘78)• Choose 2 “large” prime numbers p and q • modulus n = p.q• compute λ(n) = lcm(p-1,q-1)• choose e relatively prime w.r.t. λ(n)• compute d = e-1 mod λ(n)

• public key = (e,n)• private key = (d,p,q)

• encryption: c = me mod n• decryption: m = cd mod n

The security of RSA is based on the “fact” that it is easy to generate two large primes, but that it is hard to factor their product

try to factor 24198

Page 9: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

#digits

log(effort)Factorisation records

90

20

40

60

80

100

120

140

160

1801 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37

#dig

its

64 70 74 83 89 94 96 99

Page 10: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

10

What about quantum computers?• exponential parallelism

• Shor 1994: perfect for factoring• But: can a quantum computer

be built?

n coupled quantum bits

2n degrees of freedom !

Page 11: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

State of the art in coherent qubit control

11

# ga

tes

and

gate

net

wor

k

* unpublished# qubits1 2 3 4 5 6 7

Stanford/IBMNMR, main playersOther NMRnon-NMR

98

99

99

98

99 NEC

01 NEC02 Sacley*

99 Oxford

98 Oxford00

00

95 NIST

00,01

99,00,01 MIT98 MIT

98 Cambridge

98 LANL

99,0100

00 NIST

00

01 LANL

01 Frankfurt

99 Cambridge

01

00 LANL

95 Caltech

Grover search280 2-bit gates Order

findingShor

15=3x5

“Cooling”spinsLiquid

crystals

Errordetection

Deutsch-Jozsa

Errorcorrection

7-spincoherence

Page 12: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Advantages of public-key cryptology

12

• Reduce protection of information to protection of authenticity of public keys

• Confidentiality without establishing secret keys– extremely useful in an open environment

• Data authentication without shared secret keys: digital signature– sender and receiver have different capability– third party can resolve dispute between sender

and receiver

Page 13: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Disadvantages of public-key cryptology• Calculations in software or hardware two to

three orders of magnitude slower than symmetric algorithms

• Longer keys: 1024 bits rather than 56…128 bits

• What if factoring is easy?

13

Page 14: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Practical Cryptography:Provable Security as a Tool for Protocol Design

Phillip RogawayUC Davis & Chiang Mai Univ

[email protected]://www.cs.ucdavis.edu/~rogaway

Summer School on Foundations of Internet Security17-19 June 2002

Duszniki Zdroj, Poland(three two-hour lectures)

Slides modified and tweaked by Dan Wallach, with permission

14

Page 15: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

15

0. Opening comments1. What is "provably security"?2. Blocks ciphers

2.1 Syntax2.2 Notions of security (prp, prf, kr)

3. Symmetric Encryption3.1 Syntax3.2 Notions of security (sem, ind, ind$, all under CPA)

4. Relating the notions (ind$, ind, 01)5. Sample block-cipher-using encryption schemes 6. Security of modes

6.1 CTR-rand6.2 CBC-rand

7. MACs and authenticated encryption7.1 Notion of authenticated encryption7.2 Notion of MACs7.3 Ways to MAC (CBC, XCBC, CW (w/ poly-based universal hash, UMAC) 7.4 Ways to achieve auth enc (generic composition, IAPM/OCB)

Concluding comments

Outline from the paper board

Page 16: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Recognize Problem

Protocol

Bug

New Protocol

“ClassicalApproach”

Bug

New Protocol

Publish

ImplementShip

Bug 16

Page 17: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

“Provable-SecurityApproach”

Recognize Problem

DefinitionDefinition begins with [GM82]

17

Protocol

Proof: reduction

Publish

Instantiate

Implement

Ship

Done

Protocol πΠ

Page 18: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Protocol Π

Primitive π

Sym enc schemeMACOWF

Block CipherAKE

Asym enc scheme

Block CipherBlock CipherBlock Cipher

OWFSym enc scheme + MAC

RSA primitive

If primitive π is secure then protocol Π is secureIf ∃ a good adv for attacking π then ∃ no good adv for attacking ΠIf ∃ a good adv for attacking Π then ∃ a good adv for attacking π//

//

18

Page 19: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Block-Cipher Syntax

E: K ×{0,1}n → {0,1}n

where each EK(⋅) = E(K, ⋅) is a permutation

Eg: EK(X)=XEK(X)=AES128K(X)

19

Page 20: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Notions of Block-Cipher Security

A

Key-recover (kr) under chosen-plaintext attack (CPA)

EK(.)X1

X2…

Xq

EK(X1) EK(X2)

…EK(Xq)

Adv kr (A) = Pr [ K←K: AE(K, ⋅ ) = K]E$

Adv kr (t,q) = max {Adv kr (A) }E EA

Runs in time ≤ tAsks ≤ q queries

20

Page 21: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

PRP-sense of a block cipher being good

21

.

.

.

..

.

.

..

. . ..

|K|

A

π(.)X1

X2…

Xq

π(X1) π(X2)

…π(Xq)

EK(.)X1

X2…

Xq

EK(X1) EK(X2)

…EK(Xq)

2n!

Page 22: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Adv prp (A) = Pr [ K←K: AE(K, ⋅ ) = 1] −E$

Pr [ π←Perm(n): Aπ( ⋅ ) = 1] $

Adv prp (t,q) = max {Adv prp (A) }E EA

Runs in time ≤ tAsks ≤ q queries

Attacker A responds:0: it’s a permutation1: it’s the cipher

22

Page 23: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Breaking EK(X)=X

A: Ask 0n, receiving Yif Y=0n return 1 (cipher returns the identity)

else return 0Advprp(A) = 1 – 2-n (permutation might also)

E

Advprp (t,q) ≤ t / 2128 Strong assumptionAES

Advprp (t,q) ≤ 2-40 if t<280, q<240 Weaker assumptionAES

23

Page 24: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Adv prf (A) = Pr [ K←K: AE(K, ⋅ ) = 1] −E$

Pr [ ρ←Rand(n): Aρ( ⋅ ) = 1] $

A

ρ(.)X1

X2…

Xq

ρ(X1) ρ(X2)

…ρ(Xq)

EK(.)X1

X2…

Xq

EK(X1) EK(X2)

…EK(Xq)

Adv prf (A) = 2Pr [ b ←{0,1};if b=1 then K ← K, f=EK else f ← Rand(n): A f(⋅) =b] − 1

E$

$$

24

Page 25: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

“Switching Lemma” If A asks σ queries

|Advprp(A) – Advprf (A) | ≤ σ2 / 2n+1EE

1

25

σ0

2n/2

Pr[Aπ(⋅) = 1] – Pr[Aρ(⋅) = 1] ≤ σ2 / n+1

Page 26: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

Def. A (sym, prob) enc scheme is a 3-tupleΠ = (K, E, D)

Finite set

E: K × M → {0,1}* is a prob. function

D: K × {0,1}* → M ∪ {*} (det funct)

M ⊆{0,1}*

If M ∈M and |M’|=|M|then M’∈ M

M ∈M, K ∈K, C ← EK(M) ⇒ DK(C) =M$

|C| = clen( |M| )26

Page 27: Public key crypto (quick intro) Provable cryptographydwallach/courses/comp527_f2005/week05-1...Provable cryptography Slides from Bart Preneel and Phil Rogaway 1. Comp527 status •

CPAsupport(M ) only has strings ofone length

A

ΕΚ(.)M1M2

…Mq

ΕΚ(X1) ΕΚ(X2)

…ΕΚ(Xq) Π = (K,E,D)

Advsem(A) = Pr [ K←K; ( f,M ) ← AE(K, ⋅) ( ); M← M; C ←EK(M):AE(K, ⋅) (C, f ) = f (M)] −

$$ $$Π

Pr [ K←K; ( f,M ) ← AE(K, ⋅) ( ); M,M’← M; C ←EK(M’):AE(K, ⋅) (C, f ) = f (M)]

$$ $$

sem

27