Kerberos Book Chapter
Supplementary notes from the book chapter on user authentication: one-way email authentication, Kerberos V4 and V5, realms, and public-key remote authentication.
One-way authenticationSearch on YouTube
Email needs one-way authentication. The recipient is not always online at the same time as the sender. Thus the sender cannot wait for a reply that carries a session key.
The KDC scheme can work for encrypted email. Remove steps 4 and 5 of the interactive scheme. For a message , the sequence is:
- :
- :
- :
Only the intended recipient can read the message. B also gets some proof that A is the sender.
This protocol does not protect against replays. A timestamp in the message gives some protection. But email delays limit the value of timestamps.
Kerberos overviewSearch on YouTube
Kerberos is an authentication service from Project Athena at MIT. It gives a centralized authentication server. This server authenticates users to servers and servers to users.
Three threatsSearch on YouTube
Users at workstations want to use services on servers across the network. Servers must restrict access to authorized users. A workstation cannot be trusted to identify its users correctly. Three threats exist:
- A user gets access to a workstation and pretends to be another user of that workstation.
- A user changes the network address of a workstation. Then the requests appear to come from the impersonated workstation.
- A user eavesdrops on exchanges and uses a replay attack to get into a server or to disrupt operations.
Kerberos uses only symmetric encryption. It does not use public-key encryption.
VersionsSearch on YouTube
- Versions 1 to 3 were internal development versions.
- Version 4 is the "original" Kerberos. Some version 4 implementations still exist.
- Version 5 corrects some security deficiencies of version 4. It is a proposed Internet Standard (RFC 4120 and RFC 4121).
MotivationSearch on YouTube
Most systems today use dedicated user workstations (clients) and distributed or centralized servers. Three approaches to security are possible:
- Each client workstation makes sure of the identity of its users. Each server enforces a policy based on the user ID.
- Client systems authenticate themselves to servers. Servers trust the client system for the identity of its user.
- The user proves its identity for each service. Servers also prove their identity to clients.
A small, closed environment can use approach 1 or 2. An open environment needs approach 3. Kerberos supports approach 3.
RequirementsSearch on YouTube
The first published report on Kerberos lists four requirements:
| Requirement | Meaning |
|---|---|
| Secure | An eavesdropper cannot get the information to impersonate a user. Kerberos must not be the weak link. |
| Reliable | When Kerberos is not available, the services that use it are not available. Thus use distributed servers that back up each other. |
| Transparent | The user does not see the authentication, apart from entering a password. |
| Scalable | The system supports large numbers of clients and servers. This needs a modular, distributed architecture. |
Kerberos is a trusted third-party authentication service. Its protocol is based on the Needham-Schroeder protocol. Clients and servers trust Kerberos to mediate their mutual authentication.
Kerberos version 4Search on YouTube
Version 4 uses DES. The chapter builds the full protocol in steps. Each new dialogue removes a weakness of the previous dialogue.
Simple dialogueSearch on YouTube
An opponent can pretend to be another client. Thus servers must confirm the identity of clients. If each server does this work, the load on each server is large.
An authentication server (AS) does this work. The AS knows the passwords of all users. It shares a unique secret key with each server.
- :
- :
- :
| Symbol | Meaning |
|---|---|
| Client | |
| Authentication server | |
| Server | |
| Identifier of the user on C | |
| Identifier of V | |
| Password of the user on C | |
| Network address of C | |
| Secret key shared by AS and V |
The AS checks the password and the access right of the user. Then it creates the ticket. V decrypts the ticket. V checks that the user ID in the ticket is the same as the user ID in the message.
Each part of message 3 has a purpose:
- The ticket is encrypted. Thus C or an opponent cannot change or forge it.
- in the ticket lets V confirm that it decrypted the ticket correctly.
- in the ticket shows that the AS issued the ticket for C.
- stops a replay from another workstation. Without it, an opponent can capture the ticket and send message 3 from a different workstation.
Adding the TGSSearch on YouTube
Two problems remain:
- Each new service needs a new ticket. Thus the user must enter the password again for each service.
- Message 1 sends the password in plaintext. An eavesdropper can capture it.
The solution is a ticket-granting server (TGS) and no plaintext password.
Once per user logon session:
- :
- :
Once per type of service:
- :
- :
Once per service session:
- :
The steps:
- The client asks the AS for a ticket-granting ticket. It sends the user ID and the TGS ID.
- The AS encrypts the ticket with , a key from the user's password. The client asks for the password and decrypts the reply.
- The client sends the user ID, the service ID and to the TGS.
- The TGS decrypts the ticket with . It checks its own ID, the lifetime, the user ID and the address. Then it issues .
- The client sends the user ID and to the server.
Only the correct user knows the password. Thus only that user can recover . The ticket has a timestamp and a lifetime, for example eight hours. This limits the replay of a captured ticket.
Full V4 dialogueSearch on YouTube
Two more problems remain:
- Ticket lifetime. A short lifetime makes the user enter the password many times. A long lifetime gives an opponent more time to replay a captured ticket. A service must prove that the person who uses a ticket is the person who received it.
- Server authentication. Servers must also authenticate themselves to users. If not, a false server can capture user data and deny the true service.
The solution is a session key and an authenticator.
(a) Authentication service exchange:
- :
- :
(b) Ticket-granting service exchange:
- :
- :
(c) Client/server authentication exchange:
- :
- : , for mutual authentication
Here the authenticator is .
Ticket and authenticatorSearch on YouTube
| Ticket | Authenticator | |
|---|---|---|
| Use | Reusable until it expires | Use only once |
| Lifetime | Long, for example hours | Very short |
| Encrypted with | Key of the TGS or the server | Session key |
| Purpose | Distributes keys securely | Proves the identity of the client |
How the parts work:
- The timestamp in message 1 tells the AS that the message is timely.
- Message 2 gives C a readable copy of some ticket fields. Thus C can confirm that the ticket is for the TGS. C also learns the expiry time.
- is in message 2 (encrypted with ) and in the ticket (encrypted with ). Thus C and the TGS both get it securely.
- The ticket says: "Anyone who uses must be C." The authenticator says: "At time , I use ."
- The TGS gets from the ticket and decrypts the authenticator. It compares the name and address with the ticket and with the source of the message.
- Message 4 has the same form as message 2. It gives C the session key for server V.
- In message 6, V returns encrypted with . Only V can make this message. The plus-one shows that it is not a replay of an old reply.
At the end, the client and the server share a secret key. They can use it to encrypt messages or to exchange a new session key.
Ticket: reusable, delivers keys, long life. Authenticator: one use, proves identity, short life, contains .
Kerberos realmsSearch on YouTube
Realm and principalSearch on YouTube
A full-service Kerberos environment has these requirements:
- The Kerberos server has the user IDs and hashed passwords of all users. All users are registered with it.
- The Kerberos server shares a secret key with each server. All servers are registered with it.
Such an environment is a Kerberos realm:
- A realm is a set of managed nodes that share the same Kerberos database.
- The database is on the Kerberos master system. Keep this system in a physically secure room.
- Other Kerberos systems can have read-only copies. Make all changes on the master system.
- A change to the database needs the Kerberos master password.
- A principal is a user or service that Kerberos knows. A principal name has three parts: user or service name, instance name and realm name.
Different administrative organizations usually make different realms.
Interrealm authenticationSearch on YouTube
Interrealm authentication adds a third requirement. The Kerberos server in each realm shares a secret key with the server in the other realm. Each realm trusts the other realm to authenticate its users.
- :
- :
- :
- :
- :
- :
- :
The ticket for the remote server shows the realm where the user was first authenticated. The remote server decides if it accepts the request.
This scheme does not scale well. N realms need secure key exchanges.
Kerberos version 5Search on YouTube
Version 5 is in RFC 4120. It corrects environmental shortcomings and technical deficiencies of version 4.
Environmental shortcomingsSearch on YouTube
| Area | V4 problem | V5 solution |
|---|---|---|
| Encryption system | Needs DES, with export limits and doubts about strength | Ciphertext has an encryption-type identifier. Keys have a type and a length. |
| Internet protocol | Needs IP addresses | Addresses have a type and a length, so any address type works |
| Byte ordering | The sender selects its own byte order | ASN.1 and Basic Encoding Rules give one clear byte order |
| Ticket lifetime | 8-bit value in units of 5 minutes: at most minutes, about 21 hours | Explicit start time and end time, so any lifetime is possible |
| Authentication forwarding | Credentials cannot go to another host | Forwarding is possible, for example a print server gets a file for the client |
| Interrealm authentication | About Kerberos-to-Kerberos relationships | A method with fewer relationships |
Technical deficienciesSearch on YouTube
- Double encryption. V4 encrypts tickets twice: with the server key, then with the client key. The second encryption is not necessary and wastes computation.
- PCBC encryption. V4 uses propagating cipher block chaining, a nonstandard DES mode. An attack that swaps ciphertext blocks works against it. V5 attaches a checksum or hash, then uses standard CBC.
- Session keys. A ticket can be used many times with the same session key. An opponent can replay messages from an old session. V5 lets client and server agree a subsession key for one connection only.
- Password attacks. In both versions, the AS reply is encrypted with a key from the password. An opponent can try many passwords on it. V5 preauthentication makes this harder, but it does not prevent it.
V5 dialogueSearch on YouTube
(a) Authentication service exchange:
- :
- :
(b) Ticket-granting service exchange:
- :
- :
(c) Client/server authentication exchange:
- :
- :
Here the authenticator is .
New fields in message 1:
- Realm: the realm of the user.
- Options: requests flags in the returned ticket.
- Times: from (start time), till (expiry time) and rtime (renew-till time).
- Nonce: a random value. Message 2 repeats it, to show that the reply is fresh.
New fields in the authenticator of message 5:
- Subkey: the key that the client selects for this application session. If it is absent, the session key is used.
- Sequence number: an optional start number for the messages from the server. Sequence numbers help to detect replays.
Message 6 returns the timestamp without the plus-one. An opponent cannot create message 6 without the keys. A subkey in message 6 overrides the subkey in message 5.
Ticket flagsSearch on YouTube
| Flag | Meaning |
|---|---|
| INITIAL | The AS issued the ticket, not the TGS. |
| PRE-AUTHENT | The KDC authenticated the client before it issued a ticket. |
| HW-AUTHENT | Initial authentication used hardware that only the client has. |
| RENEWABLE | The TGS can issue a replacement ticket that expires later. |
| MAY-POSTDATE | The TGS can issue a postdated ticket from this ticket-granting ticket. |
| POSTDATED | The ticket is postdated. The server can check the authtime field. |
| INVALID | The KDC must validate the ticket before use. |
| PROXIABLE | The TGS can issue a service ticket with a different network address. |
| PROXY | The ticket is a proxy. |
| FORWARDABLE | The TGS can issue a ticket-granting ticket with a different network address. |
| FORWARDED | The ticket was forwarded, or comes from a forwarded ticket-granting ticket. |
Uses of the flags:
- INITIAL: a password-changing server can know that the client recently gave its password.
- PRE-AUTHENT: the MIT implementation sends a block with a random confounder, a version number and a timestamp. The client encrypts the block with its password key. The AS refuses if the timestamp is outside the allowed time skew.
- HW-AUTHENT: shows that a smart card or a similar device was used.
- RENEWABLE: the ticket has two expiry times. The TGS can renew it up to the latest time. The TGS can refuse to renew a stolen ticket.
- MAY-POSTDATE: helps a long batch job. The client gets many tickets at once. All tickets after the first are INVALID until the client has them validated.
- PROXIABLE: lets a server act as a proxy for the client. The new ticket has the PROXY flag.
- FORWARDABLE: the forwarded ticket can go to a remote TGS. Realms can be a hierarchy. A client goes up the tree to a common node, then down to the target realm. Thus each Kerberos server does not need a key with every other realm.
Public-key remote authenticationSearch on YouTube
The chapter ends with remote user authentication that uses asymmetric encryption.
Timestamp protocolSearch on YouTube
This protocol is from Denning [DENN81]:
- :
- :
- :
The AS gives only public-key certificates. A selects and encrypts the session key, so the AS cannot expose it. Timestamps protect against replays. The protocol is compact, but it needs synchronized clocks.
Woo-Lam protocolSearch on YouTube
Woo and Lam use nonces in place of timestamps:
- :
- :
- :
- :
- :
Quick self-testSearch on YouTube
Why does one-way email authentication remove steps 4 and 5 of the KDC scheme?
The recipient is not always online. Thus A cannot wait for a reply. A sends with the message, and B recovers later.
Give the three threats that Kerberos addresses and its four requirements.
Threats: a false user on a workstation, a changed workstation address, and eavesdropping with replay. Requirements: secure, reliable, transparent and scalable.
Why does the ticket contain ?
stops the use of a captured ticket from another workstation. The ticket is valid only from the workstation that requested it.
What is the difference between the ticket and the authenticator in V4?
The ticket is reusable and distributes the session key securely. The authenticator is encrypted with the session key, is used once and has a very short lifetime. It proves the identity of the client.
How does message 6 of V4 give mutual authentication?
V returns encrypted with . Only V can make this message. The plus-one shows that it is not a replay.
What is a Kerberos realm, and what is the V4 cost of interrealm authentication?
A realm is a set of managed nodes that share one Kerberos database. N realms need secure key exchanges.
Give the four technical deficiencies of V4 and the V5 solution for each.
Double encryption: removed. PCBC: replaced by CBC with a checksum. Reused session keys: replaced by subsession keys. Password attacks: made harder by preauthentication.
What does the nonce in V5 message 1 do?
Message 2 repeats the nonce. This shows that the reply is fresh and that an opponent did not replay it.
In the Woo-Lam protocol, what does B send to the KDC in step 4?
. The nonce is encrypted with the public key of the KDC.
- One-way email authentication uses a KDC in three steps, but it has no replay protection.
- Kerberos is a trusted third-party service that uses only symmetric encryption. It is secure, reliable, transparent and scalable.
- V4: the AS gives a ticket-granting ticket. The TGS gives service tickets. Authenticators prove identity. Message 6 returns .
- A realm shares one Kerberos database. V4 interrealm authentication needs key exchanges.
- V5 adds type tags, ASN.1, any lifetime, forwarding, CBC with checksums, subsession keys, nonces, preauthentication and ticket flags.
- Public-key remote authentication uses timestamps (Denning) or nonces (Woo-Lam).
Taming Kerberos - Computerphile
Kerberos Explained (Animated)