33
03 December 2003 Public Key Infrastructure and Authentication Mark Norman DCOCE Oxford University Computing Services

Intro to PKI and authentication

  • Upload
    voquynh

  • View
    225

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Intro to PKI and authentication

03 December 2003

Public Key Infrastructureand Authentication

Mark NormanDCOCE

Oxford University Computing Services

Page 2: Intro to PKI and authentication

03 December 2003

DCOCE

Der-kot-chee

Digital Certificate Operation in a Complex Environment

Page 3: Intro to PKI and authentication

03 December 2003

Authentication

• The act of verifying that an electronic identity (username, login name etc.) is being employed by the person to whom it was issued– Strictly it should mean "establishing the validity of

something, such as an identity". (The procedure as indicated by the definition above is very difficult indeed.)

Page 4: Intro to PKI and authentication

03 December 2003

Authorisation

• Associating rights or capabilities with a subject• Authorisation usually comes after authentication

– i.e. once the service knows who it is (Authenticated), it then proceeds to decide what that person/subject can do (Authorisation)

Page 5: Intro to PKI and authentication

03 December 2003

The DCOCE project

• DCOCE is about authentication with digital certificates

• Digital certificates use Public Key Infrastructure (PKI)– PKI is very secure– but can be difficult to administer– and a lot of people don't understand it too well

Page 6: Intro to PKI and authentication

03 December 2003

The DCOCE project

• Digital certificates and PKI rely upon trust• Trust relies upon co-operation (or understanding)

between organisations• Oxford University is a Complex Environment

– DCOCE– If it can work here...

• But let's get back to PKI and how it works

Page 7: Intro to PKI and authentication

03 December 2003

PKI

• (Public Key Infrastructure)• A key is like a code sheet• A public key is an odd concept

– why would you reveal your secret code in public?

• We need to understand symmetric keys and asymmetric keys

Page 8: Intro to PKI and authentication

03 December 2003

Principles of encryption

• Substitution • Transposition

Symmetric encryption

etc. …

Page 9: Intro to PKI and authentication

03 December 2003

Principles of encryptionSymmetric encryption

Encryption

Decryption

Plai

ntex

t

Cip

herte

xt

Keyand encryption algorithm

Page 10: Intro to PKI and authentication

03 December 2003

• Example using the Data Encryption Standard (DES)

Principles of encryptionSymmetric encryption

$> des -e “Mary had a little lamb” output.desEnter key: oucskeyEnter key again: oucskey$>

• The result:$> cat output.des!¢ðuýåćßÞf 謶׀ עжТφẸỆ≈∞▪ري$>

Page 11: Intro to PKI and authentication

03 December 2003

• Example using the Data Encryption Standard (DES) continued…

Principles of encryptionSymmetric encryption

$> des -d output.des text.desEnter key: oucskeyEnter key again: oucskey$>cat text.desMary had a little lamb$>

• To decrypt:

Page 12: Intro to PKI and authentication

03 December 2003

• Example using the Data Encryption Standard (DES) continued…

Principles of encryptionSymmetric encryption

$> des -d output.des text.desEnter key: oucsquayEnter key again: oucsquay

Corrupted file or wrong key$>cat text.desuýåćß#¬`謶׀ φẸỆעжТ עжТ$>

• Trying to decrypt with the wrong key:

Page 13: Intro to PKI and authentication

03 December 2003

• So you have to have the same key as your correspondent– how do you send the key safely?

• You also have to tell your correspondent the algorithm!– (not necessarily a problem)

• How do you transmit these things in the first place?

Principles of encryptionSymmetric encryption

Page 14: Intro to PKI and authentication

03 December 2003

• How safe are encryption algorithms anyway?• Example using (DES) continued…

Principles of encryptionSymmetric encryption

• What about a ‘brute force’ attack?i.e. ‘guessing’ at the key “oucskey”

• DES algorithm has a 56-bit key. Therefore, there are 256 = 72,057,594,037,900,000different keys

• 834 days at a billion keys per second• But for a typed key, effectively 968 (83 days)

Page 15: Intro to PKI and authentication

03 December 2003

• How safe are encryption algorithms anyway?– A good algorithm is sound– Safety is dependent on key length

• Key distribution is problematic– but if you can, symmetric is fine!

Principles of encryptionSymmetric encryption

– except that you need a key for everyone you communicate with!!

Page 16: Intro to PKI and authentication

03 December 2003

Principles of encryption

• Then there was asymmetric encryption– Whitfield Diffie and Martin Hellman (1975)– Each party has two keys (public and private)– Anything encrypted with key1 can only be decrypted

with key2– Asymmetric!

Page 17: Intro to PKI and authentication

03 December 2003

Decryption

Asymmetric encryptionPl

aint

ext

Cip

herte

xt

Encryption

Key 1 andencryption algorithm

Page 18: Intro to PKI and authentication

03 December 2003

Plai

ntex

t

Cip

herte

xt

Encryption

Key 1 andencryption algorithm

If Key 1 = private, Key2 must be corresponding publicIf Key 1 = public, Key2 must be corresponding private

Key 2 andencryption algorithm

Decryption

Asymmetric encryption

Page 19: Intro to PKI and authentication

03 December 2003

Public and private keys

• Keys exist in pairs– Keep one private (very secret) and 'publish' one– Public keys can exist on certificates

• Encryption can be done by either key– If it is your key pair, you can use the private key– Anyone else can use the public key to encrypt

something

Page 20: Intro to PKI and authentication

03 December 2003

Private keys

• Extremely secret!• If you send something encrypted by a private key,

it can be read by everyone, but they know it came from you.– Authentication

Page 21: Intro to PKI and authentication

03 December 2003

Public keys

• Not at all secret!– Widely available, but must be trusted– May be supplied as part of a certificate

• If you send something using a public key, it can only be read by the entity to which it is addressed.– Secure communications

• (But secure communications (e.g. SSL) isn’t quite as simple as that!)

Page 22: Intro to PKI and authentication

03 December 2003

How can I trust a public key?

• Someone can use a public key to prove their identity to me– but only if I trust that public key– there's public keys out there that say they belong to

George Bush etc.• So if someone I trusted endorsed (signed) that

public key– hold that thought for a moment...

Page 23: Intro to PKI and authentication

03 December 2003

Signing things with keys

• Keys can be used to sign things– encrypt a bit of text with your private key (can be

attached 'securely' to the 'document')– people can de-crypt it with the public key and know that

it was signed by you

Page 24: Intro to PKI and authentication

03 December 2003

How can I trust a public key?

• Put that public key on a certificate• Get someone you trust to sign the certificate

– If the certificate is tampered with, the signature is broken

• Organisations who sign public keys/certificates are called Certification Authorities (CA)

Page 25: Intro to PKI and authentication

03 December 2003

Public Key Infrastructure

• You create a key pair• Put one key of the pair on a certificate• Send the certificate (request) to the CA• Present yourself or identify yourself to the

Registration Authority (RA)• The RA tells the CA that you are OK• The CA sends you the signed certificate

Page 26: Intro to PKI and authentication

03 December 2003

Public Key Infrastructure

• Now you have a signed certificate, people and services can trust that you are who you say you are

• Present your certificate to a service• Tell them something encrypted by your private

key• They like your certificate and know it is you

Page 27: Intro to PKI and authentication

03 December 2003

Public Key Infrastructure

• You keep your private key very secret– Obey the rules for this!

• Your public key is on the certificate• Services must trust the CA• Your certificate will have an expiry date

– after which you may have to re-visit the RA• Your certificate can be revoked at any time

Page 28: Intro to PKI and authentication

Authentication using certificates and public/private keys

Webserver

HelloMary had

a little lamb

End user

Mary hada little lamb

Mary hada little lamb

Mary hada little lamb

Client authentication

OK. The server is happy that the end user is Mr Bloggs himself!

Page 29: Intro to PKI and authentication

03 December 2003

Public Key Infrastructure

• Asymmetric encryption = public/private keys• Symmetric encryption is faster

– but how do you deliver the keys• Asymmetric encryption is used in SSL

– Secure Sockets Layer, very common• Also used in client authentication

(less common, at the moment)

Page 30: Intro to PKI and authentication

Authentication using certificates and public/private keys

Webserver

End user

Challenge Phrase(Random message)

Encryptionprotocols Encryption

protocols OK

Random connectionidentifier (server)

Public CA key

OK! Or client may not have CA public key(receives message that certificate is not known)

| Cancel | Always Trust | Trust this time |

Setting up the session and server authentication

Challenge Phrase(Random message)

Random connectionidentifier (server)

Server pub. key and cert.

Page 31: Intro to PKI and authentication

Authentication using certificates and public/private keys

Webserver

End user Public CA key

Setting up the session and server authentication

Challenge Phrase(Random message)

Random connectionidentifier (server)

Master session key

Symmetric keypairs

(Encrypted)

Server pub. key and cert.

Page 32: Intro to PKI and authentication

Authentication using certificates and public/private keys

Webserver

End user Public CA key

Setting up the session and server authentication

Challenge Phrase(Random message)

Random connectionidentifier (server)

Master session key

ReadWrite

Symmetric keypairs

Random connectionidentifier (server)

Symmetric keypairs

Read WriteRandom connectionidentifier (server)

Challenge Phrase(Random message)

Challenge Phrase(Random message)

Then client authentication begins!

(as we looked at before)

Server pub. key and cert.

Page 33: Intro to PKI and authentication

03 December 2003

Public Key Infrastructureand Authentication

Mark NormanDCOCE

Oxford University Computing Services