12
ALMA MATER STUDIORUM – UNIVERSITA’ DI BOLOGNA Certificates, Certification Authorities and Public-Key Infrastuctures Prof. Ozalp Babaoglu Sicurezza © Babaoglu 2004 2 Certificati digitali ! Problema: ! la chiave pubblica con la quale stiamo cifrando deve appartenere realmente al destinatario del messaggio ! Si pone il problema dello scambio delle chiavi (man-in- the-middle attack) ! I certificati digitali vengono usati per evitare che qualcuno tenti di “spacciarsi” per un’altra persona sostituendone la chiave pubblica Sicurezza © Babaoglu 2004 3 PKI – Certificates ! A certificate simplifies the task of establishing whether a public key belongs to the purported owner ! The form in which a PKI communicates public key information ! Binding between a public key and identity information about the user ! Signed by a certificate issuer ! Functions much like a physical certificate ! Avoids man-in-the-middle attacks Sicurezza © Babaoglu 2004 4 Physical Certificates Fotograph + Personal data Seals = I certify that the photo corresponds to the personal data

Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Embed Size (px)

Citation preview

Page 1: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

ALMA MATER STUDIORUM – UNIVERSITA’ DI BOLOGNA

!

Certificates, Certification Authorities and

Public-Key Infrastuctures

Prof. Ozalp Babaoglu

Sicurezza © Babaoglu 2004

2

Certificati digitali

! Problema:

! la chiave pubblica con la quale stiamo cifrando deve appartenere realmente al destinatario del messaggio

! Si pone il problema dello scambio delle chiavi (man-in-the-middle attack)

! I certificati digitali vengono usati per evitare che qualcuno tenti di “spacciarsi” per un’altra persona sostituendone la chiave pubblica

Sicurezza © Babaoglu 2004

3

PKI – Certificates

! A certificate simplifies the task of establishing whether a public key belongs to the purported owner

! The form in which a PKI communicates public key information

! Binding between a public key and identity information about the user

! Signed by a certificate issuer

! Functions much like a physical certificate

! Avoids man-in-the-middle attacks

Sicurezza © Babaoglu 2004

4

Physical Certificates

Fotograph+

Personal data

Seals=

I certify thatthe photo

corresponds to the personal

data

Page 2: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Sicurezza © Babaoglu 2004

5

Distribuzione dei certificati

! Manuale o di persona. Quasi mai realizzabile in pratica! (passaporto: distribuzione manuale)

! Generati, custoditi e distribuiti da entità fidate" Certificate servers

" Public Key Infrastructures (PKI)

Sicurezza © Babaoglu 2004

6

Certificate servers

! Database disponibili su rete

! Permettono agli utenti di " richiedere l’inserimento del proprio certificato nel database

" richiedere il certificato di qualcuno

Sicurezza © Babaoglu 2004

7

Public Key Infrastructure

! Public-key infrastructure (PKI)" Registration Authority (RA) usually a physical person

" Certification Authority (CA) usually software

! PKI is a collection of services and protocols for" Issuing,

" Storing,

" Validating,

" Revoking certificates

Sicurezza © Babaoglu 2004

8

Public Key Infrastructure

! Is there an “Internet PKI”?" Several proposal for an Internet PKI exist: PGP, PEM, PKIX,

Secure DNS, SPKI and SDSI

" No single one has gained widespread use

! In the future:" Several PKI operating and inter-operating in the Internet

Page 3: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Sicurezza © Babaoglu 2004

9

Public Key Infrastructure

! There are two basic operations common to all PKIs:" Certification: process of binding a public-key value to an

individual, organization or other entity

" Validation: process of verifying that a certification is still valid

! How are these operations implemented?" Depends on the type of PKI used

Sicurezza © Babaoglu 2004

10

PKI – X.509 Certificates

X.509 Certificate Information

Subject: Distinguished Name, Public Key

Issuer: Distinguished Name, Signature

Validity: Not Before Date, Not After Date

Administrative Info: Version, Serial Number

Extended Info: …

Sicurezza © Babaoglu 2004

11

Distinguished Name Information

Defined by X.509 Standard

Common Name CN=Calisto Tanzi

Organization or Company O=Parmalat

Organizational Unit OU=Management

City/Locality L=Parma

State/Province ST=Emilia Romagna

Country (ISO Code) C=IT

Sicurezza © Babaoglu 2004

12

Certificate Encodings

! Binary format defined by ASN.1

! Binary encoding defined using “Distinguished Encoding Rules” (DER) and “Basic Encoding Rules” (BER)

! For transmissions that cannot handle binary form, certificates may be encoded as “Privacy Enhanced Mail” (PEM) using Base64

Page 4: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Sicurezza © Babaoglu 2004

13

! The certification process is based on trust" The certificate user trusts the issuing authority to issue “valid”

certificates (that correctly associate subjects to their PK)

! The certificate issuer is commonly called a certificate authority (CA)

! Why certificates and certificate authorities?

PKI – Certificates

A

B

C

D

E

PKBPKCPKD

PKE

A

B

C

D

E

PKB

PKCPKDPKE

CA

PKCA

PKA

Sicurezza © Babaoglu 2004

14

PKI – Certificate Authorities

! Only a CA for the entire world?" Impractical

! Instead:" most PKI enable CA to certificate other CA’s

" in practice: one CA is telling its users that they can trust what a second CA says in its certificates

! Different certificates:" End-user certificates

" CA certificates

Sicurezza © Babaoglu 2004

15

PKI – Certificate Chains

DN of BOB

PK Bob

Sig CA Z

DN of CA Y

PK CA Y

Sig CA X

DN of CA Z

PK CA Z

Sig CA Y

PK CA X

Sicurezza © Babaoglu 2004

16

PKI – CA Hierarchies

! CAs can be organized " as a rooted tree (X.509)

" as a general graph (PGP)

CA

CA CACA

CA

CA CA

Page 5: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

ALMA MATER STUDIORUM – UNIVERSITA’ DI BOLOGNA

!

PGPPretty Good Privacy

Prof. Ozalp Babaoglu

Sicurezza © Babaoglu 2004

18

PGP

! È un programma freeware (nella sua versione base)

! È basato su tecniche crittografiche sia di tipo simmetrico che asimmetrico (ibrido)

! Viene utilizzato principalmente per proteggere da occhi indiscreti le informazioni digitali (sia messaggi di posta elettronica che file residenti sul proprio PC)

! Permette la firma digitale

Sicurezza © Babaoglu 2004

19

Un po’ di storia

! Nel 1991 al Senato americano approda un disegno di legge anticrimine che prevede l’obbligo per i produttori di strumenti crittografici di inserire “trap doors” nei loro prodotti

! Prima che la legge venga approvata, Philip R. Zimmermann scrive e distribuisce PGP

Sicurezza © Babaoglu 2004

20

Un po’ di storia

! Zimmermann viene accusato di aver violato le leggi sui brevetti in quanto in PGP viene utilizzato RSA

! Inoltre il governo americano lo accusa di violare l’ITAR (International Traffic in Arms Regulations) che prevede il divieto di esportazione per le tecnologie crittografiche e quindi anche dei programmi software che le implementano

! Viene istituito un fondo per far fronte alle spese legali

! Le accuse vengono ritirate

Page 6: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Sicurezza © Babaoglu 2004

21

PGP

! Creazione delle chiavi

! Cifratura/decifratura e firma/verifica di documenti digitali (es. e-mail)

! Gestione delle chiavi

! Creazioni di self-decrypting archives (SDAs)

! Cancellazione permanente di file, directory e spazio su disco

! Creazione di VPN (Virtual Private Network)

Sicurezza © Babaoglu 2004

22

Chiavi

! PGP utilizza sia protocolli a chiave segreta che protocolli a chiave pubblica

! Approssimativamente: " chiavi segrete 80 bit equivalenti chiavi pubbliche 1024 bit

" chiavi segrete 128 bit equivalenti chiavi pubbliche 3000 bit

! Chiavi segrete a 56 bit non sicure

! Chiavi segrete a 128 bit sicure, ma non con calcolatori quantistici...che non esistono (e probabilmente non esisteranno mai)

! Chiavi segrete a 256 bit sicure comunque !!!

! Anche se ...

Sicurezza © Babaoglu 2004

23

Passphrase

Passphrase “L’erba del vicino è sempre più verde”

PGP

Utente

Passphrase: serve all’utente quando si rende necessario l’uso della chiave privata. Più facile da ricordare. Da non dimenticare !!!

Chiave privata“certyunemcpo3456n3g6kg3636g6ng6”

Chiave pubblica“7ecngnkwgmiml5g\h7kk7kikfkhlghk”

Memorizzata in modo sicuro

Sicurezza © Babaoglu 2004

24

Algoritmi usati in PGP

! Chiave privata (simmetrici):" CAST

" Triple-DES

" IDEA

" Two Fish (AES)

! Chiave pubblica (asimmetrici):" DSS (digital Signature Standard)

" RSA

! Hash:" SHA1 (Secure Hash Algorithm)

Page 7: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Sicurezza © Babaoglu 2004

25

Codifica

Mittente:

1. comprime il documento da spedire2. genera una chiave Ks segreta che viene detta chiave di sessione3. codifica il documento compresso utilizzando Ks 4. si procura la chiave pubblica del destinatario Kp 5. codifica Ks usando Kp6. spedisce documento codificato con Ks e la chiave segreta codificata con Kp

Sicurezza © Babaoglu 2004

26

Decodifica

Destinatario:

1. usando la propria chiave privata accede alla chiave segreta di sessione2. usando la chiave segreta di sessione decodifica il messaggio3. decomprime il messaggio

Compressione e decompressione rafforzano il protocollo!

Sicurezza © Babaoglu 2004

27

Compressione

! Vantaggi:-No attacchi statistici-Minori dimensioni

Ciao, sono

un

file non

compresso e

sto per

essere

codificato

74c4cch

Kc98xac

S785Jc

44DBN

Compressione e perdita di struttura!

codifica

codifica

Sicurezza © Babaoglu 2004

28

PKI – PGP Certificates

! Numero di versione PGP

! Chiave pubblica di U, caratteristiche della chiave (lunghezza, algoritmo con cui è stata creata, data di creazione, durata della chiave, …)

! Informazioni sull’identità di U: nome, cognome, luogo e data di nascita, foto, …

! Self-signature: chiave pubblica di U firmata con la chiave privata di U

! Indicazione dell’algoritmo simmetrico di codifica preferito (Es: CAST, IDEA, Triple-DES)

! Altre firme …

Page 8: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Sicurezza © Babaoglu 2004

29

Formato dei certificati

! PGP riconosce due formati di certificato:" Certificati in formato PGP

" Certificati in formato X.509 (standard internazionale: tutte le applicazioni in linea teorica dovrebbero riconoscerlo e supportarlo anche se in pratica esistono molte varianti dello standard X.509 che lo rendono … non standard)

Sicurezza © Babaoglu 2004

30

PGP vs X.509

PGP X.509

No Registration Authority Registration Authority

Certificato auto firmato Certificato firmato da un CA

Identità multipla Identità singola

Firme multiple per attestare

la validità del certificato

Firma singola per attestare

la validità del certificato

Sicurezza © Babaoglu 2004

31

PGP Certificates

! May contain multiple key/identify pairs, each signed multiple times

Ozalp

OzalpBabaoglu

O. Babaoglu

Prof. Babaoglu

Ozalp

Sicurezza © Babaoglu 2004

32

Certificates in Practice: Netscape

Page 9: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Sicurezza © Babaoglu 2004

33

Certificates in Practice: Netscape

Sicurezza © Babaoglu 2004

34

Certificates in Practice: Netscape

Sicurezza © Babaoglu 2004

35

Certificates in Practice: Thawte

Sicurezza © Babaoglu 2004

36

PKI – Validation

! Validation" The information in a certificate can change over time

" Need to be sure that the information in the certificate is current and that the certificate is authentic

! Two basic methods of certificate validation:" Off-line validation

The CA can include a validity period in the certificate — a range during which the information in the certificate can be considered valid

" On-line validationThe user can ask the CA directly about a certificate’s validity every time it is used

Page 10: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Sicurezza © Babaoglu 2004

37

PKI – Revocation

! Revocation" the process of informing users when the information in a

certificate becomes unexpectedly invalid# subject’s private key becomes compromised

# user information changes (e.g., domain name of a server)

! Off-line" Within the validity periods, certificate revocation method is critical

! On-line" revocation problem becomes trivial

Sicurezza © Babaoglu 2004

38

PKI – Revocation

! Certificate Revocation List (CRL)" a list of revoked certificates that is signed and periodically issued

by a CA

" user must check the latest CRL during validation to make sure that a certificate has not been revoked

! CRL Problems" CRL time-granularity problem

# how often CRLs must be issued?

" CRL size# incremental CRL

Sicurezza © Babaoglu 2004

39

PKI – Registration Authority

! Subject requesting a certificate must be authenticated

! In-band certification:" performed using the PKI, whether on-line or off-line

! Out-of-band certification:" performed using more traditional methods, such as mail, fax,

over the telephone or physically meeting someone

Sicurezza © Babaoglu 2004

40

Trust

! Unless you receive a certificate directly from its owner you have to go by someone else’s word that it is authentic

! You trust people, authenticate certificates

! Trust models" Direct trust

" Hierarchical trust

" Web of trust

Page 11: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Sicurezza © Babaoglu 2004

41

Trust in X.509

! Based on chains of trust among entities that are reputed to be CAs (hierarchical trust)

! The (blind) trust we place on root-level CAs must be acquired through reputation, experience, operational competence and other non-technical aspects

! Anyone claiming to be a CA must be a trusted entity and we must believe that it is secure and correct

Sicurezza © Babaoglu 2004

42

Trust in PGP

! Any user can act as a CA and sign the the key of another user (becomes an “introducer” of that key)

! You consider a certificate valid only if you trust sufficiently one or more of the introducers of the key

! “Web of trust”

Sicurezza © Babaoglu 2004

43

Trust in PGP

! Mi fido di me stesso (sono un soggetto Trusted)!

! Assegno alle chiavi che ho potuto controllare direttamente di persona il giudizio Valid

! Assegno un valore di fiducia (trust) alle chiave pubbliche:" Complete trust

" Marginal trust

" No trust (untrusted)

Sicurezza © Babaoglu 2004

44

Trust in PGP

! PGP assegna ad un certificato un valore di validità: " Valid

" Marginally valid

" Invalid

in base ai giudizi espressi da altri utenti su quel certificato e al valore di trust che io ho assegnato a quegli utenti

! Non transitivo!!!

Page 12: Certificates, Certification Authorities and Public-Key ...babaoglu/courses/security04-05/lucidi/PKI.pdf · Secure DNS, SPKI and SDSI" No single one has gained widespread use! In the

Sicurezza © Babaoglu 2004

45

Trust in PGP

! If you assign “Complete trust” to some one’s key, this makes them a CA

! To consider a key valid it must have" One “completely trusted” signature, or

" Two “marginally trusted” signatures