public key infrastructurehomes.sice.indiana.edu/yh33/teaching/i433-2016/lec21-pki.pdfalice’s...

35
Public Key Infrastructure Yan Huang Credit: David Evans (UVA)

Upload: others

Post on 17-Mar-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

Public Key Infrastructure

Yan Huang

Credit: David Evans (UVA)

Page 2: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

2

Using RSA to Encrypt• Use 2048-bit modulus (recommended) • Encrypt 1MB file

– 4096 2048-bit messages – Each Me requires log2 (e) 1024-bit number modular

multiplications (unless e is fixed to some small numbers)

• Why does not one use RSA like this? – About 100-1000 times slower than DES – Need to be careful not to encrypt particular Ms – Can speed up encryption by choosing e that is an easy

number to multiply by (e.g., 3 or 216 + 1) – But, decryption must use non-easy d (~2048 bits)

Page 3: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

3

Hybrid Encryption• Use RSA to establish a shared secret

key for symmetric cipher (e.g., AES) – Encrypt the secret key with OAEP padding

• Sign (encrypt with private key) a hash of the message – A short block that is associated with the

message

Page 4: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

4

RSA Paper

“The need for a courier between every pair of users has thus been replaced by the requirement for a single secure meeting between each user and the public file manager when the user joins the system.”

Page 5: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

5

Key Management

Public keys only useful if you know: 1. The public key matches the entity

you think it does (and no one else).

2. The entity is trustworthy.

Page 6: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

6

Approach 1: Public Announcement

• Publish public keys in a public forum – USENET groups – Append to email messages – New York Time classifieds

• Easy for rogue to pretend to be someone else

Page 7: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

7

Approach 2: Public Directory• Trusted authority maintains directory

mapping names to public keys • Entities register public keys with authority

in some secure way • Authority publishes directory

– Print using watermarked paper, special fonts, etc.

– Allow secure electronic access

Page 8: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

8

Can we avoid needing an on-line directory?

Page 9: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

9

Certificates Loren Kohnfelder, MIT 4th year thesis project,

1978: Towards a Practical Public-key Cryptosystem

“Public-key communication works best when the encryption functions can reliably be shared among the communicants (by direct contact if possible). Yet when such a reliable exchange of functions is impossible the next best thing is to trust a third party. Diffie and Hellman introduce a central authority known as the Public File… Each individual has a name in the system by which he is referenced in the Public File. Once two communicants have gotten each other’s keys from the Public File then can securely communicate. The Public File digitally signs all of its transmission so that enemy impersonation of the Public File is precluded.”

Page 10: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

10

Certificates

TrustMe.com

Alice Bob

{ [email protected], KUA }

CA = EKRTrustMe[“[email protected]”, KUA]

{ [email protected], KUB}

CB = EKRTrustMe[“[email protected]”, KUB]

CB

CA

KU — Public Key KR — Private Key

Page 11: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

Data encrypted using secret key exchanged using some public key associated with some certificate.

Page 12: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

12

Page 13: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

13

SSL (Secure Sockets Layer)Simplified TLS Handshake Protocol

Client ServerHello

KRCA[Server Identity, KUS]

Check Certificate using KUCA

Pick random K KUS[K]Find K using KRS

Secure channel using K

Page 14: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

How does TrustMe.com decide whether to provide Certificate?

Certificates

VarySign

Alice Bob

{ [email protected], KUA }

CA = EKRTrustMe[“[email protected]”, KUA]

{ [email protected], KUB}

CB = EKRTrustMe[“[email protected]”, KUB]

CB

CA

Page 15: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

CS588 Spring 2005 15

VarySign

Alice Bob

{ [email protected], KUA }

CA = EKRTrustMe[“[email protected]”, KUA]

{ [email protected], KUB}

CB = EKRTrustMe[“[email protected]”, KUB]

CB

CA

Verifying Identities$$$$

Page 16: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

CS588 Spring 2005 16

With over half a million businesses authenticated, VeriSign follows a rigorous and independently audited authentication process. All involved VeriSign employees pass stringent background checks, and each authentication is split between multiple individuals. We maintain physically secure facilities, including biometric screening on entry.

Page 17: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

17

VeriSign’s Certificate Classes

• “Secure Site” SSL Certificate – Supports 40-bit session key – Proves: you are communicating with

someone willing to pay VeriSign $598 (or with ~$1000 to break a 40-bit key)

– Except they have a free 14-day trial (but it uses a different Trial CA key)

Page 18: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

18

Page 19: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

19

“Secure Site Pro” Certificate • $995 per year • “true 128-bit key”

“128-bit encryption offers 288 times as many possible combinations as 40-bit encryption. That’s over a trillion times a trillion times stronger.”

trillion = 1012 trillion * trillion = 1024 Verisign’s marketing claim could be: “trillion times a trillion times a trillion times a trillion times a

trillion times a trillion times a trillion times ten thousand (in Britain it is a trillions time a trillion times a trillion times a trillion times a billion times a thousand) times stronger”

(but that would sound even sillier!)

• Businesses authentication: “out-of-band” communication, records

Page 20: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

20

Page 21: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

VarySign.com

Alice Bob

{ [email protected], KUA }

CA = EKRTrustMe[“[email protected]”, cert id, expiration time, KUA]

CA

Limiting The Damage

Checks expiration time > now

Page 22: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

22

Page 23: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

23

Revoking Certificates

VarySign.com

Alice Bob

{ [email protected], KUA }

CA

CA

Send me the CRL

<certid, Date Revoked> <certid, Date Revoked> <certid, Date Revoked> …

EKRTrustMe[CRL]

Page 24: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

24

Certificate Questions

• How do participants acquire the authority’s public key?

• If authority’s private key is compromised, everything is vulnerable! – Keep the key locked up well

Page 25: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

25

Problems with Certificates• Depends on a certificate authority

– Needs to be a big, trusted entity – Needs to make money (or be publicly funded)

• Need to acquire a certificate – Makes anonymity difficult – Requires handshaking

Page 26: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

26

PGP (Pretty Good Privacy)• Keyring: list of public keys, signed by owner’s

private key Alice’s keyring: EKRAlice (<“[email protected]”, KUBob>, <“[email protected]”, KUCathy>) • Exchanging Keyrings (Web of Trust)

– Complete Trust: I trust Alice’s keyring (add the public key pairings to my own keyring)

– Partial Trust: I sort of trust Alice, but require confirmation from someone else too (I need to get EKRCathy (<“[email protected]”, KUBob>) before trusting KUBob

Page 27: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

27

Charge• Look at the certificate chains when you

browse the web – Find a certificate with a trust chain more than

two levels deep • Update your browser CRLs: when were

they last updated?

Page 28: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

28

Avoiding Certificates• What if your identity (e.g., your email

address) is your public key?

• Is it possible to do this with RSA?Do you want your email address to be a 200-digit “random” number?

Page 29: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

29

Identity Based Encryption• [Shamir 1984], [Boneh & Franklin 2003]

public-key = identity private-key = F(master-key, identity)

The owner of the master-key is the new authority. Must be careful who it gives private keys to.

Page 30: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

30

Key-Generating Service• Holds master-key • Participants request private keys from KGS

• Sends s to KGS, requests corresponding private key • KGS authenticates requestor • If valid, computes F(master-key, s) and sends over

secure channel

• How does the trust given to the KGS compare to that given to CA in SSL?

KGS can decrypt all messages! With certificates, certificate owner still has her own private key.

But, CA can impersonate anyone by generating a certificate with a choosen public-key.

Page 31: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

31

Shamir’s IBE Signature Scheme

• Setup: done by KGS – Select p, q large primes – N = pq – Choose e relatively prime to ϕ (N) = (p-1)(q-1) – Choose d satisfying ed ≡ 1 mod ϕ (N) – Choose h a cryptographic hash function

• Publish N, e and h to all participants • Keep d secret master-key

Page 32: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

32

Shamir’s Signatures• Generating a private key

privatekey(ID) = IDd mod N – Can only be done by KGS (d is master secret)

• Signing a message M with identity ID – Obtain g = privatekey(ID) from KGS – Choose random r less than N – Compute signature (s, t):

t = re mod N s = g rh (t || M) mod N

Warning: book typesetting is off and wrong range for h!

Page 33: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

33

Verifying a Signature• KGS produced g = IDd mod N • Recipient knows ID and M, system

parameters e and N t = re mod N s = g rh(t || M) mod N

• Verify (ID, s, t, M) se = ID th(t || M) mod N

(IDd rh(t || M))e mod N ≡ IDderh(t || M)e mod N ≡ ID reh(t || M) mod N ≡ ID th(t || M) mod N

What does non-forgibility of a Shamir IBE signature rely on?

Page 34: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

34

Identity-Based Encryption• Shamir’s scheme – signatures only, not

encryption • Boneh & Franklin, 2001

– First practical, provably secure IBE scheme – Builds on elliptic curves

Page 35: Public Key Infrastructurehomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec21-pki.pdfAlice’s keyring: E KR Alice (,

35

Issues in IBE• Complete trust in KGS

– With Boneh & Franklin’s system can use secret sharing techniques to divide this trust among multiple entities

– Could you do this with Shamir’s IBE signatures?

• Revocation – Can include expiration times in identities – But no way to revoke granted private keys