Key Management
Slide deck 17. Key hierarchy, key distribution with a KDC and with public keys, public key distribution, X.509 and PKIX.
Key Management in Cryptography | Symmetric Key Distribution | Needham Schroeder Protocol | KDCT V Nagaraju Technical · symmetric key distribution, KDC and Needham-Schroeder, 16 min
MicroNugget: How to Deliver Public Keys with X.509 Digital CertificatesCBT Nuggets · delivering public keys with X.509 certificates, 5 min
What is an X.509 Certificate?The Security Buddy · what an X.509 certificate holds, 3 minKey distribution basicsSearch on YouTube
Why key management is hardSearch on YouTube
Key management and key distribution are complex topics. They include three types of issues:
- Cryptographic issues.
- Protocol issues: which party sends which message, and in which order.
- Management issues: who stores, changes and revokes the keys.
The two scheme types have different needs:
| Scheme type | What the parties need | Concern |
|---|---|---|
| Symmetric schemes | Both parties share a common secret key | How to distribute that key securely |
| Public key schemes | Each party gets valid public keys | How to make sure that a key belongs to the claimed owner |
Frequent key changes can be desirable. They limit the data that an attacker gets from one broken key.
Secure systems often fail because of a break in the key distribution scheme, not because of a weak cipher.
Distribution alternativesSearch on YouTube
Two parties and need a shared symmetric key. The slides give four alternatives:
- selects the key and physically delivers it to .
- A third party selects the key and delivers it to and .
- If and communicated previously, they use the previous key to encrypt a new key.
- If and each have secure communications with a third party , then relays the key between and .
Four alternatives: Hand, Third, Old, Relay. hands the key over, a third party delivers it, an old key encrypts the new key, or relays it.
Key hierarchySearch on YouTube
Systems typically use a hierarchy of keys:
| Key | Role | Lifetime |
|---|---|---|
| Session key | A temporary key. It encrypts the data between users for one logical session. | Discarded after the session |
| Master key | Encrypts session keys. It is shared by a user and the Key Distribution Center (KDC). | Long-lived |
The slide figure shows three levels:
- Data gets cryptographic protection from session keys.
- Session keys get cryptographic protection from master keys.
- Master keys get non-cryptographic protection. They can be distributed in a non-cryptographic way, such as physical delivery.
Each level protects the level above it. Only the small set of master keys needs a slow, physical delivery. All other keys move over the network in encrypted form.
Symmetric keys with a KDCSearch on YouTube
Key distribution scenarioSearch on YouTube
Figure 14.3 shows how a KDC gives a session key to initiator and responder . shares master key with the KDC, and shares .
- KDC: . asks for a session key for and adds a nonce .
- KDC : .
- : . forwards the part for . now has and knows the peer is .
- : . sends a new nonce under the session key.
- : . applies a function to , for example "add 1", and sends the result back.
Steps 1 to 3 are the key distribution steps. Steps 3 to 5 are the authentication steps.
lets match the reply to her request, so an attacker cannot replay an old reply. Steps 4 and 5 show that holds and that step 3 is not a replay.
Key distribution issuesSearch on YouTube
- Large networks need hierarchies of KDCs, but the KDCs must trust each other.
- Session key lifetimes must be limited for greater security.
- Automatic key distribution on behalf of users is possible, but the users must trust the system.
- Decentralized key distribution is an alternative to one central KDC.
- Controlling key usage: the system can limit what each key is used for.
Symmetric keys with public keysSearch on YouTube
Why use public keysSearch on YouTube
Public-key cryptosystems are inefficient. Thus they almost never encrypt data directly. They encrypt secret keys for distribution. After the exchange, both sides use fast symmetric encryption for the data.
Merkle's simple schemeSearch on YouTube
Merkle proposed a very simple scheme. It allows secure communications, and no keys exist before or after the exchange.
- : . makes a new key pair and sends the public key and her identity.
- : . makes a session key and encrypts it with .
decrypts with to get . Then discards and , and discards .
Man-in-the-middle attackSearch on YouTube
This very simple scheme is vulnerable to an active man-in-the-middle attack. Figure 14.8 shows the attack by Darth:
- sends . Darth intercepts it.
- Darth makes his own key pair and sends to .
- sends . Darth intercepts it and computes .
- Darth sends to .
At the end, Alice, Bob and Darth all share . Alice and Bob do not know that Darth has the key.
Darth breaks no cipher. The scheme has no authentication of the public key, so an active attacker can replace it with his own key.
Confidentiality and authenticationSearch on YouTube
This scheme protects against the active attack. and already have each other's public keys.
- : . sends her identity and a nonce .
- : . returns and adds his nonce . Only can read message 1, so this proves the responder is .
- : . returns , so knows the initiator is .
- : . signs with her private key and then encrypts it with 's public key.
In step 4, the outer layer gives confidentiality: only can read . The inner layer gives authentication: only can make that signature.
Hybrid key distributionSearch on YouTube
A hybrid scheme keeps a private-key KDC:
- The KDC shares a secret master key with each user.
- The KDC distributes session keys with the master keys.
- Public-key encryption distributes the master keys. This is especially useful when the users are widely distributed.
The rationale:
- Performance: public-key encryption is slow, so the system uses it only for the rare master key updates.
- Backward compatibility: the existing KDC scheme stays in use with few changes.
Distribution of public keysSearch on YouTube
Four methodsSearch on YouTube
| Method | Mechanism | Weakness |
|---|---|---|
| Public announcement | Users send or broadcast their public keys | Anyone can forge a key |
| Publicly available directory | Users register keys with a trusted directory | Still vulnerable to tampering or forgery |
| Public-key authority | The authority gives out keys in signed replies | Real-time access to the authority is necessary |
| Public-key certificates | A CA signs a certificate for each key | A trusted CA is necessary |
Public announcementSearch on YouTube
Users distribute public keys to recipients or broadcast them to the community at large. For example, users append PGP keys to email messages, or post them to news groups or email lists.
The major weakness is forgery. Anyone can create a key, claim to be someone else, and broadcast it. Until the forgery is discovered, the attacker can masquerade as the claimed user.
Publicly available directorySearch on YouTube
Users get greater security when they register keys with a public directory. The directory must be trusted and must have these properties:
- It contains entries.
- Participants register securely with the directory.
- Participants can replace their key at any time.
- The directory is periodically published.
- The directory can be accessed electronically.
The directory is still vulnerable to tampering or forgery. For example, an attacker who gets the directory's private key can issue false keys.
Public-key authoritySearch on YouTube
The authority tightens control over the distribution of keys from the directory. It has the properties of the directory. Each user must know the public key of the authority, . Then users get any desired public key from the authority securely.
The slide figure shows seven messages:
- Authority: .
- Authority : .
- : .
- Authority: .
- Authority : .
- : .
- : .
The timestamps show that each reply from the authority is fresh. Messages 6 and 7 authenticate and to each other.
The method has two problems. It needs real-time access to the directory when keys are necessary. The directory may also be vulnerable to tampering.
Public-key certificatesSearch on YouTube
Certificates allow key exchange without real-time access to the public-key authority.
- A certificate binds an identity to a public key. It usually has other information, such as the period of validity and rights of use.
- A trusted public-key or Certificate Authority (CA) signs all the contents.
- Anyone who knows the public key of the authority can verify the certificate.
Each user sends its public key to the CA and gets a certificate back. Then sends to , and sends to .
X.509 certificatesSearch on YouTube
X.509 authentication serviceSearch on YouTube
- X.509 is part of the CCITT X.500 directory service standards. X.500 uses distributed servers that keep a database of user information.
- X.509 defines a framework for authentication services. The directory can store public-key certificates. Each certificate holds the public key of a user, signed by a certification authority.
- X.509 also defines authentication protocols.
- X.509 uses public-key cryptography and digital signatures. The algorithms are not standardised, but RSA is recommended.
- X.509 certificates are widely used. There are 3 versions.
The slide "X.509 Certificate Use" shows how the CA signs a certificate:
- The CA computes a hash code of the unsigned certificate (user ID and the user's public key).
- The CA signs the hash code with the CA's private key.
- The CA appends the signature to the certificate.
A recipient verifies the signature with the CA's public key.
Certificate formatSearch on YouTube
A Certification Authority (CA) issues each certificate. The certificate contains these fields:
| Field | Content |
|---|---|
| Version | 1, 2, or 3 |
| Serial number | Unique within the CA. It identifies the certificate. |
| Signature algorithm identifier | Algorithm and parameters |
| Issuer X.500 name | Name of the CA |
| Period of validity | Not before and not after dates |
| Subject X.500 name | Name of the owner |
| Subject public-key info | Algorithm, parameters and key |
| Issuer unique identifier | Version 2 and 3 |
| Subject unique identifier | Version 2 and 3 |
| Extension fields | Version 3 only |
| Signature | Algorithm, parameters and the encrypted hash of all the other fields |
The notation is the certificate of user signed by certification authority .
Obtaining a certificateSearch on YouTube
- Any user with access to the CA can get any certificate from it.
- Only the CA can modify a certificate.
- Certificates cannot be forged, so they can be placed in a public directory.
CA hierarchySearch on YouTube
- If two users share a common CA, they are assumed to know the public key of that CA.
- If not, the CAs must form a hierarchy.
- Certificates link the members of the hierarchy, so a user can validate other CAs.
- Each CA has certificates for its clients (forward) and for its parent (backward).
- Each client trusts the certificates of its parents.
- A user of any CA in the hierarchy can verify a certificate from any other CA in it.
In the "CA Hierarchy Use" figure, user has a certificate from CA , and user has one from CA . gets 's public key with this chain:
already trusts . Each certificate in the chain gives the public key that verifies the next certificate.
Certificate revocationSearch on YouTube
Each certificate has a period of validity. A CA may need to revoke a certificate before it expires, for example:
- The private key of the user is compromised.
- The user is no longer certified by this CA.
- The certificate of the CA is compromised.
Each CA keeps a list of revoked certificates, the Certificate Revocation List (CRL). Users must check certificates against the CRL of the CA.
The CRL contains the signature algorithm identifier, the issuer name, the "this update" date and the "next update" date. For each revoked certificate, it gives the user certificate serial number and the revocation date. The CA signs the full list.
Version 3 extensionsSearch on YouTube
Users need more information in a certificate, for example email or URL, policy details and usage constraints. Version 3 does not name new fields explicitly. It defines a general extension method. Each extension has:
- An extension identifier.
- A criticality indicator.
- An extension value.
There are three classes of certificate extensions:
| Extension class | Purpose |
|---|---|
| Key and policy information | Gives information about the subject and issuer keys, plus indicators of certificate policy |
| Certificate subject and issuer attributes | Supports alternative names, in alternative formats, for the subject and the issuer |
| Certificate path constraints | Lets a CA put constraints on the use of certificates by other CAs |
Public key infrastructureSearch on YouTube
PKIX modelSearch on YouTube
A Public Key Infrastructure (PKI) is the set of hardware, software, people, policies and procedures that create, manage, store, distribute and revoke certificates. PKIX is the PKI model based on X.509.
The slide figure shows these PKIX parts:
- End entity: the PKI user.
- Registration authority: an optional entity that does some administrative work for the CA.
- Certificate authority: issues certificates and CRLs.
- CRL issuer: an optional entity that publishes CRLs for the CA.
- Certificate/CRL repository: the store from which end entities retrieve certificates and CRLs.
PKIX management functionsSearch on YouTube
- Registration
- Initialization
- Certification
- Key pair recovery
- Key pair update
- Revocation request
- Cross certification
The end entity uses the first six functions with the RA or CA. Cross certification happens between two CAs.
Seven PKIX functions, in order: "Rich Investors Collect Keys, Keep Records, Cross-check". Registration, Initialization, Certification, Key pair recovery, Key pair update, Revocation request, Cross certification.
Quick self-testSearch on YouTube
What are the four key distribution alternatives for symmetric keys?
selects the key and physically delivers it to . A third party selects the key and delivers it to and . and use a previous key to encrypt a new key. A third party with secure links to both relays the key.
Compare session keys and master keys.
A session key is temporary. It encrypts data between users for one logical session and is then discarded. A master key encrypts session keys and is shared by a user and the KDC. Master keys get non-cryptographic protection, such as physical delivery.
Give the five messages of the KDC key distribution scenario.
(1) KDC: . (2) KDC : . (3) : . (4) : . (5) : .
How does Merkle's simple scheme work, and why is it vulnerable?
sends . returns . The public key is not authenticated. Darth replaces with , reads , and forwards to . Then all three share .
Give the four messages of secret key distribution with confidentiality and authentication.
(1) . (2) . (3) . (4) . The outer layer of message 4 gives confidentiality. The inner signature gives authentication.
What is hybrid key distribution and why use it?
A private-key KDC shares a master key with each user and distributes session keys with the master keys. Public-key encryption distributes the master keys. The rationale is performance and backward compatibility.
Compare the four methods of public key distribution.
Public announcement is open to forgery. A public directory is still open to tampering or forgery. A public-key authority needs real-time access. Certificates signed by a CA allow key exchange without real-time access to an authority.
List the fields of an X.509 certificate.
Version, serial number, signature algorithm identifier, issuer name, period of validity, subject name and subject public-key info. Then the issuer and subject unique identifiers (v2+), extensions (v3) and the signature.
When must a CA revoke a certificate, and how do users find out?
There are three cases. The private key of the user is compromised. The user is no longer certified by the CA. The certificate of the CA is compromised. The CA puts the certificate on its CRL. Users check the CRL.
Give the seven PKIX management functions.
Registration, initialization, certification, key pair recovery, key pair update, revocation request and cross certification.
- Symmetric schemes need secure distribution of a shared key. Public-key schemes need valid public keys.
- Session keys protect data, master keys protect session keys, and master keys get physical delivery.
- A KDC gives to and in five messages. Nonces and give freshness and authentication.
- Merkle's scheme is open to a man-in-the-middle attack. The four-message scheme with nonces and a signature gives confidentiality and authentication.
- Public keys are distributed by announcement, directory, authority or certificates.
- X.509 certificates are signed by a CA. CA hierarchies, CRLs and version 3 extensions extend the scheme. PKIX has seven management functions.