Key Management Notes
Supplementary notes on public-key distribution, X.509 certificates and public-key distribution of secret keys.
OverviewSearch on YouTube
Two aspectsSearch on YouTube
The notes give two distinct aspects of the use of public-key encryption for key management:
| Aspect | Question |
|---|---|
| Distribution of public keys | How does get an authentic copy of the public key of ? |
| Use of public-key encryption to distribute secret keys | How do and get a session key for conventional encryption? |
Four schemesSearch on YouTube
Virtually all proposals for the distribution of public keys fit into four general schemes:
| Scheme | Trusted party | Weakness |
|---|---|---|
| A) Public announcement | None | Anyone can forge an announcement |
| B) Publicly available directory | A trusted entity keeps the directory | Compromise of the private key of the authority, or tampering with its records |
| C) Public-key authority | A central authority, with a public key that all participants know | The authority is a bottleneck, and the directory is vulnerable to tampering |
| D) Public-key certificates | A certificate authority (CA) | Participants must trust the CA |
Distribution of public keysSearch on YouTube
Public announcementSearch on YouTube
The public key is public. Thus, with a broadly accepted algorithm such as RSA, any participant can send its public key to another participant. It can also broadcast the key to the community at large (Figure 1, "Uncontrolled Public Key").
The approach is convenient, but it has a major weakness. Anyone can forge such a public announcement.
Publicly available directorySearch on YouTube
A publicly available, dynamic directory of public keys gives more security. A trusted entity or organisation must maintain and distribute the directory (Figure 2). The scheme has these elements:
- The authority keeps a directory with a entry for each participant.
- Each participant registers a public key with the directory authority. The registration is in person or by secure authenticated communication.
- A participant can replace its key with a new key at any time. One reason is that the key was used for a large amount of data. Another reason is that the private key was compromised.
- Periodically, the authority publishes the full directory or updates to it. For example, it can publish a hard-copy book like a telephone book, or list updates in a newspaper.
- Participants can also access the directory electronically. This needs secure, authenticated communication from the authority to the participant.
This scheme is more secure than individual announcements, but it still has vulnerabilities:
- An opponent can get or compute the private key of the directory authority. Then the opponent can give out counterfeit public keys, impersonate any participant and eavesdrop on messages to any participant.
- An opponent can also tamper with the records that the authority keeps.
Public-key authoritySearch on YouTube
A public-key authority gives stronger security with tighter control over the distribution of public keys from the directory.
- A central authority keeps a dynamic directory of the public keys of all participants.
- Each participant reliably knows a public key of the authority. Only the authority knows the matching private key.
This scheme is not perfect. The authority can be a bottleneck, because a user must ask it for the public key of each user that it wants to contact. Also, the directory of names and public keys is vulnerable to tampering.
Public-key certificatesSearch on YouTube
With certificates, participants exchange keys without contact with a public-key authority.
- A certificate authority creates each certificate. The certificate contains a public key and other information.
- The CA gives the certificate to the participant that has the matching private key.
- A participant sends its key information to another participant in its certificate.
- Other participants can verify that the authority created the certificate.
The scheme has four requirements:
- Any participant can read a certificate to find the name and public key of the owner.
- Any participant can verify that the certificate comes from the CA and is not counterfeit.
- Only the CA can create and update certificates.
- Any participant can verify the currency of the certificate.
is the certificate of , and is the private key of the CA. is a timestamp, is the identifier of , and is the public key of . Any participant verifies it with the public key of the CA:
The PDF writes the inner term as . This is a typing error. The CA encrypts with its private key , so can recover the contents.
X.509 authentication serviceSearch on YouTube
Purpose and historySearch on YouTube
- The ITU-T recommendation X.509 is part of the X.500 series of recommendations. X.500 defines a directory service.
- X.509 defines a framework for authentication services by the X.500 directory to its users.
- The directory can be a repository of public-key certificates.
- Each certificate contains the public key of a user. The private key of a trusted CA signs it.
- X.509 uses public-key cryptography and digital signatures, for example RSA and hash functions such as MD5.
| Version | Year |
|---|---|
| First issue | 1988 |
| Revised recommendation, for security concerns | 1993 |
| Third version | 1995, revised in 2000 |
User certificates from a CA have these characteristics:
- Any user with the public key of the CA can recover the certified public key of the user.
- No party other than the CA can modify the certificate. Thus certificates can be kept in the directory without special protection.
Certificate fieldsSearch on YouTube
Figure 3 shows the X.509 certificate format:
| Field | Content |
|---|---|
| Version | Identifies the certificate format. The default is version 1. If an issuer or subject unique identifier is present, it must be version 2. If one or more extensions are present, it must be version 3. |
| Serial number | An integer, unique within the issuing CA, for this certificate |
| Signature (algorithm identifier) | The algorithm used to sign the certificate, with its parameters. It has little use, because the final signature field repeats this information. |
| Issuer name | X.500 name of the CA that created and signed the certificate |
| Period of validity | Two dates: the first and the last date on which the certificate is valid |
| Subject name | Name of the user to whom the certificate refers |
| Subject's public-key information | The public key of the subject, the algorithm identifier and its parameters |
| Issuer unique identifier | Optional bit string. It identifies the CA if its X.500 name was reused for different entities. |
| Subject unique identifier | Optional bit string. It identifies the subject if its X.500 name was reused for different entities. |
| Extensions | One or more extension fields, added in version 3 |
| Signature | Covers all other fields. It is the hash code of the other fields, encrypted with the private key of the CA, with the signature algorithm identifier. |
Version 1 fields end at the subject public-key information. Version 2 adds the two unique identifiers. Version 3 adds extensions. The signature is in all versions.
Distribution of secret keysSearch on YouTube
Why use public keysSearch on YouTube
After public keys are distributed, secure communication against eavesdropping and tampering is possible. But few users want to use only public-key encryption, because its data rates are relatively slow. Thus, public-key encryption is a vehicle to distribute secret keys for conventional encryption.
Merkle's simple schemeSearch on YouTube
Ralph Merkle put forward an extremely simple scheme (Figure 4). If wants to communicate with :
- generates a key pair . sends and its identifier to .
- generates a secret key and sends it to , encrypted with .
- computes to recover . Only can decrypt the message, so only and know .
- discards and . discards .
and then communicate securely with . At the end of the exchange, both discard .
No keys exist before the communication starts, and none exist after it ends. Thus the risk of key compromise is minimal, and the communication is secure from eavesdropping.
Active attackSearch on YouTube
The protocol is vulnerable to an active attack. An opponent who controls the channel can do this without detection:
- generates and sends and to .
- intercepts the message. makes its own key pair and sends to .
- generates and sends .
- intercepts the message and gets with .
- sends to .
and both know , but they do not know that also knows it. then only eavesdrops and decrypts all messages.
The simple protocol is useful only when the only threat is eavesdropping.
Confidentiality and authenticationSearch on YouTube
The scheme in Figure 5 protects against active and passive attacks. It assumes that and already exchanged public keys with one of the four schemes.
- : . The nonce identifies this transaction.
- : . Only could decrypt message 1. Thus in message 2 tells that the correspondent is .
- : . This tells that the correspondent is .
- selects a secret key and sends to .
- computes to recover .
In message 4, the encryption with makes sure that only can read the message. The encryption with makes sure that only could send it. Thus the scheme gives confidentiality and authentication.
Hybrid schemeSearch on YouTube
IBM mainframes use a hybrid approach:
- A key distribution centre (KDC) shares a secret master key with each user.
- The KDC distributes secret session keys encrypted with the master key.
- A public-key scheme distributes the master keys.
The notes give this rationale for the three-level approach:
| Reason | Explanation |
|---|---|
| Performance | In many applications, especially transaction-oriented ones, the session keys change frequently. Public-key distribution of each session key can decrease system performance. With three levels, public-key encryption only occasionally updates the master key between a user and the KDC. |
| Backward compatibility | The hybrid scheme is easily put on top of an existing KDC scheme, with minimal disruption or software changes. |
The public-key layer gives a secure, efficient means to distribute master keys. This is an advantage when one KDC serves a widely distributed set of users.
Quick self-testSearch on YouTube
Give the four schemes for public-key distribution and one weakness of each.
Public announcement: anyone can forge it. Publicly available directory: an opponent can get the private key of the authority or tamper with its records. Public-key authority: it is a bottleneck, and its directory is vulnerable to tampering. Certificates: participants must trust the CA.
Why is a public announcement of keys not reliable?
An announcement has no proof of identity. Anyone can announce a key with the name of another participant.
Give the four requirements of a certificate scheme.
Any participant can read a certificate. Any participant can verify that it comes from the CA and is not counterfeit. Only the CA can create and update certificates. Any participant can verify the currency of the certificate.
Write the certificate of A and how a participant verifies it.
. A participant computes .
When must the X.509 version field be 2 or 3?
Version 2 when an issuer or subject unique identifier is present. Version 3 when one or more extensions are present.
Give the Merkle scheme and its weakness.
sends and . returns . decrypts with , then both discard the temporary keys. An active opponent replaces with and learns without detection.
In the scheme with confidentiality and authentication, how does A know that the correspondent is B?
Message 1 is encrypted with , so only can read . When comes back in message 2, knows that sent it.
Why does the hybrid scheme use public-key encryption only for master keys?
Session keys change frequently, and public-key encryption has a high computational load. The master key changes only occasionally. The scheme also fits on top of an existing KDC.
- Public keys are distributed by announcement, directory, authority or certificates. Each scheme removes a weakness of the scheme before it.
- A certificate lets participants exchange keys without contact with the authority.
- X.509 defines the certificate format. The CA signs a hash of all the fields.
- Merkle's simple scheme is safe only against eavesdropping. The scheme with two nonces and gives confidentiality and authentication.
- The hybrid scheme keeps a KDC and uses public keys only for master keys, for performance and backward compatibility.
MicroNugget: How to Deliver Public Keys with X.509 Digital Certificates
What is an X.509 Certificate?