1. Home
  2. Explore
  3. Computer Science
  4. Kerberos Network Authentication

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Kerberos Network Authentication

Kerberos: Network Authentication

Purpose and setting

Kerberos is a cryptographic protocol for authenticating users, computers, and services to one another across a network. It was designed for distributed environments in which users work at client machines and connect to separate servers—for example, file, mail, and printer servers.

In such a system, the network cannot be assumed to be trustworthy. An attacker might observe, replay, or alter traffic, or impersonate a network participant. Kerberos aims to let clients and services establish identities and shared session keys without sending users’ passwords across the network.

Kerberos contrasts with approaches that authenticate users based on network addresses. An IP address does not reliably establish a user’s identity, so authentication must instead depend on cryptographic evidence.

The trust model

Kerberos introduces a trusted central service, commonly called the Key Distribution Center (KDC). The KDC stores long-term secret keys for users and services and helps them obtain temporary keys for communication.

The system still has important trust assumptions:

  • The KDC must be trusted. If an attacker controls it, the attacker can create tickets that impersonate users to services.

  • A user must trust the workstation used to log in. A compromised workstation can capture the user’s password or Kerberos credentials and act as the user.

  • Administrative processes that create accounts or reset keys are part of the trusted system. Someone who can alter the KDC’s database can potentially take control of an account or service.

  • Services do not necessarily need to trust one another. However, administrators must avoid adding unnecessary relationships—for example, giving one server access to another server’s data—because those relationships can create additional paths for abuse.

A public or shared workstation is therefore riskier than a personally controlled machine. The cryptography cannot protect credentials from a workstation that is itself capturing them.


The KDC and long-term keys

The KDC maintains a database that associates each principal—a user or service identity—with a long-term secret key.

For example:

  • A user has a key such as KCK_CKC​, known to the user’s Kerberos client and the KDC.

  • A service has a key such as KSK_SKS​, known to that service and the KDC.

These are symmetric keys: the parties that use them must keep them secret. A user’s Kerberos key is generally derived from the user’s password by a key-derivation process. The password itself does not need to be sent over the network during normal Kerberos authentication.

The KDC is commonly described as offering two logical services:

  • The Kerberos authentication service gives a client an initial ticket, typically for the Ticket-Granting Service.

  • The Ticket-Granting Service (TGS) accepts that ticket and issues tickets for other services.

These can be thought of as two interfaces to the KDC. Separating the initial login from later ticket requests lets a client use services without repeatedly entering or retaining its password.

Long-term keys and session keys

Kerberos distinguishes between long-term keys and temporary session keys:

  • A long-term key, such as KCK_CKC​ or KSK_SKS​, is used to establish or protect credentials associated with an account or service.

  • A session key, such as KCSK_{CS}KCS​, is generated for a particular client–service relationship and is used to protect their communication.

The client can discard its password-derived key after using it to obtain its initial credentials. It still needs the temporary session key associated with its Ticket-Granting Service ticket in order to request further tickets. This is safer than keeping the password-derived key available indefinitely: exposure of temporary credentials is limited by their ticket’s lifetime.


Principals, names, and authorization

A Kerberos identity is called a principal. A principal is represented by a name registered in the KDC’s database. A user’s principal might be a username; a service’s principal might identify a service on a particular host. Some principal formats also include an instance, which can distinguish different identities associated with the same user or service.

Kerberos provides a mapping between principal names and cryptographic keys. That mapping answers the authentication question: Who is the client or service? It does not, by itself, answer what that identity is allowed to do.

Authentication versus authorization

  • Authentication establishes the identity of a party. A service can use a Kerberos ticket to learn which principal is connecting.

  • Authorization determines what that principal is permitted to access. The service typically applies its own access-control rules, such as access-control lists or group membership.

For example, a file server can use Kerberos to establish that a connection belongs to a particular user. The file server then decides whether that user may read a particular file.

Service names and verifying the intended service

Service principals matter to clients as well as servers. A client should know which service identity it expects to contact. Otherwise, an attacker might impersonate a service and return false or misleading information.

A client that attempts to connect to a named host or service should expect the corresponding Kerberos principal. If the identity presented by the other end does not match, the client should not treat it as the intended server. This supports authentication of the server to the client as well as authentication of the client to the server.

Why principal names should not be casually reused

Kerberos names are also used in application-level authorization rules. A server’s access-control list might grant access to a particular principal name, independently of the current KDC entry for that name.

If an old principal is deleted and its name is later assigned to a different person, existing permissions may unintentionally apply to the new person. The new account may then inherit access intended for the former account. Similar identity confusion can arise if service names are reused for a different service. Names therefore require careful lifecycle management; deleting a KDC entry does not automatically remove every reference to that name elsewhere.


Tickets and authenticators

A ticket is a credential that a client presents to a service. It is generally encrypted with the service’s long-term key, so a client cannot forge or inspect it merely by knowing its own credentials.

A ticket typically contains:

  • The client principal and intended service principal.

  • The client’s network address in versions or configurations that use it.

  • A timestamp and a lifetime.

  • A session key shared by the client and the service.

The ticket gives the service the information it needs to recognize the client and learn which session key to use.

An authenticator is a separate, fresh piece of evidence generated by the client. It typically contains the client’s identity, address, and a timestamp, and is encrypted with the session key shared with the service. The ticket is relatively reusable during its lifetime; an authenticator is intended to show that a particular request is fresh.

Tickets and authenticators serve different purposes:

  • The ticket conveys a service-specific credential protected by the service’s long-term key.

  • The authenticator demonstrates that the client currently possesses the corresponding session key and helps detect replays.


Obtaining the initial ticket

When a user first logs in, the client contacts the KDC’s authentication service. The client identifies itself and requests an initial ticket, typically a ticket for the TGS.

The KDC returns two related pieces of information:

  1. A ticket for the TGS, encrypted with the TGS’s long-term key.

  2. A copy of the session key the client and TGS will share, encrypted with the client’s long-term key.

The ticket contains another copy of that session key, protected by the TGS’s key. The client cannot read the ticket itself, but can decrypt the separate response encrypted with its own key. The TGS can decrypt the ticket and recover its copy of the session key.

This lets the KDC securely give the same session key to both parties without sending the TGS’s long-term key to the client or requiring the KDC to contact the TGS separately.

Why the password is not sent

The client does not need to transmit its password to the KDC. Instead, it uses the password-derived key to decrypt the KDC’s response. The protocol therefore avoids sending the password as network traffic.

However, this design creates an important weakness in early Kerberos: an observer who obtains the response can try candidate passwords offline. For each guess, the attacker can derive a candidate key and test whether it decrypts the response into something plausible. Because symmetric decryption is fast, a weak password can be guessed through many trials without repeatedly contacting the KDC.

Possible protections include:

  • Salting, which makes precomputed password dictionaries less reusable, though it does not by itself prevent guessing.

  • Expensive password-based key derivation, which makes each password guess costlier.

  • Preauthentication or challenge-response, which requires evidence of the client’s key before the KDC returns a useful response. Requiring repeated online attempts also makes server-side rate limiting more effective.

  • Password-authenticated key exchange (PAKE) protocols, which are designed to establish a shared key using a password while resisting offline guessing from recorded exchanges.

A simple challenge-response improvement can require the client to produce a value derived from its key and a fresh timestamp. The KDC verifies the value before issuing the response. Such a measure improves resistance to offline guessing, but a complete design must also consider replay and network observation.


Requesting tickets through the TGS

After obtaining a TGS ticket, the client can request a ticket for another service without using its password-derived key again.

The client sends the TGS:

  • The name of the service it wants to contact.

  • Its ticket for the TGS.

  • A fresh authenticator encrypted with the client–TGS session key.

The TGS decrypts its ticket using the TGS long-term key, learns the client’s identity and session key, and uses the authenticator to check that the requester possesses that session key. It then returns:

  • A ticket for the requested service, encrypted with that service’s long-term key.

  • The client’s copy of a new session key shared with the requested service, encrypted with the existing client–TGS session key.

The client can decrypt the response using its client–TGS session key. The requested service can later decrypt the ticket using its own long-term key. This process allows the client to obtain tickets for services such as file or mail servers while relying on its initial Kerberos credentials rather than re-entering its password.

The TGS is itself treated as a service for this purpose. The initial ticket is therefore a ticket that lets the client use the TGS to obtain additional tickets.


Using a ticket with a service

To use a service, the client sends that service its ticket and an authenticator. The service decrypts the ticket using its own long-term key. From the ticket, it obtains the client identity and the session key for the client–service exchange. It then uses the session key to verify the authenticator and protect subsequent communication.

This arrangement means that a service does not need to have previously communicated with the user or know the user’s password. The service needs only its own long-term key and the ability to interpret Kerberos tickets.

Kerberos tickets have limited lifetimes. Their timestamps and expiration times bound how long a stolen ticket can remain useful. A client that loses a valid ticket and its associated session key may still be impersonated until the credential expires, but the exposure is bounded rather than lasting until the user changes the password.


Freshness, replay resistance, and clock requirements

A network attacker may record a valid message and send it again later. This is a replay attack. Kerberos uses authenticators and timestamps to make replayed requests detectable.

A service can maintain a short-lived cache of recently seen authenticators. If it receives the same authenticator again, it can reject the duplicate. It can also reject authenticators with timestamps outside an acceptable freshness interval.

This approach depends on reasonably synchronized clocks. A client whose clock is too far ahead or behind may have legitimate requests rejected. Ticket expiration also depends on the service evaluating timestamps consistently.

Authenticators must be tied to requests

A freshness check alone is not enough if the authenticator does not identify or authenticate the request it accompanies. An attacker might capture an authenticator from one operation and attach it to a different operation. In that case, the server could accept a fresh authenticator while processing a command the client did not intend to send.

A well-designed protocol binds the authenticator to the request—for example, by including relevant request data or a cryptographic digest of it. Later Kerberos versions address this class of weakness more carefully than the original design.


Important weaknesses in early Kerberos designs

Kerberos was an early, influential system for cryptographic network authentication. Some of its original design choices reflected assumptions that later security analysis showed to be unsafe.

Confusing encryption with integrity

Encryption protects confidentiality, but encryption alone does not necessarily prove that a message is authentic or unmodified. An attacker may be able to alter encrypted data in ways that cause it to decrypt into different content.

Early Kerberos designs sometimes treated successful decryption—or a plausible-looking decrypted result—as evidence that the message was correct. This is not a reliable substitute for cryptographic integrity protection. Modern designs authenticate messages separately, typically using a keyed integrity check or an authenticated-encryption construction.

The general lesson is that protocols must distinguish:

  • Confidentiality: unauthorized parties cannot read the data.

  • Integrity and authenticity: unauthorized parties cannot alter the data without detection, and the recipient can verify who created it.

Offline password guessing

If a KDC response is encrypted with a password-derived key but does not require a prior proof that the requester knows that key, an attacker can collect the response and test password guesses offline. The attacker does not need to keep contacting the KDC, so server-side request limits do not stop the guessing process.

Stronger key derivation slows guesses; preauthentication or a carefully designed password-authenticated exchange reduces the value of a captured response.

Weak fixed encryption choices

Kerberos version 4 incorporated DES as its encryption system. DES used a 565656-bit key, making exhaustive search practical with sufficiently specialized resources. A protocol should not permanently assume that one encryption algorithm will remain secure. Kerberos version 5 supports multiple encryption types, allowing stronger algorithms and later cryptographic choices to be used.

Overreliance on IP addresses

Early Kerberos designs included client IP addresses in tickets and used them to restrict ticket use to the address from which the client logged in. This was intended to make stolen tickets less useful.

IP addresses are not strong cryptographic proof of identity. They may change, be shared, or be manipulated, and relying on them can cause legitimate failures. Cryptographic credentials should provide the principal protection; address restrictions are at most an additional policy measure.


Protecting application traffic and avoiding reflection

A client and service use their shared session key to protect application messages. In an early design, the same key could be used for traffic in both directions. This can enable a reflection attack: an attacker captures a message sent by the service and replays it as though it were a client command.

For example, if a server response can be made to look like a valid client request when reflected back to the server, the server may perform an action the client never requested. The problem is that the message’s direction and role are not distinguished strongly enough.

A protocol can reduce this risk by making message direction unambiguous. One approach is to include authenticated direction or message-type fields. Another is to derive separate keys for client-to-server and server-to-client traffic. Kerberos version 5 uses separate directional keys in relevant contexts, helping prevent a message valid in one direction from being mistaken for a valid message in the other.


KDC availability, replication, and compromise

The KDC is essential for initial login and for obtaining new tickets, but it is usually not on the path of every application message. Once a client has a valid ticket for a service, the client and service can communicate directly. If the KDC becomes unavailable, existing ticketed connections may continue to work, while new logins and ticket requests may fail.

KDC replication can improve availability. A master KDC can hold the authoritative database while read-only replicas answer authentication and ticket requests. Replicas can continue serving requests when the master is unavailable, though database changes must ultimately be propagated appropriately.

Consequences of KDC compromise

Compromise of the KDC is extremely serious. An attacker who can control its database or issue tickets may impersonate users to services. The KDC should therefore have a minimal attack surface, carefully protected software and administration, and appropriate physical and operational safeguards.

Consequences of service-key compromise

A service’s long-term key is also critical. If an attacker learns a service key, the attacker may be able to:

  • Decrypt tickets intended for that service and recover session keys.

  • Read or manipulate traffic protected with those session keys, depending on the protocol protections.

  • Forge new tickets for that service, potentially claiming to represent arbitrary users.

Repairing a software vulnerability without changing the compromised service key may therefore be insufficient. The service key should be replaced in the KDC and installed on the repaired service through a trusted administrative process.

Changing a key requires reliable administration. If an attacker controls the compromised key or can alter the KDC entry, an out-of-band process—one independent of the compromised credentials—may be needed to restore the service’s identity safely.


Password entry on remote systems

A remote system may let a user type a password even if the user’s machine does not have a Kerberos client. In a simplistic arrangement, the remote machine asks the KDC for a response encrypted with the user’s key and checks whether the supplied password decrypts it correctly.

This can be unsafe if the remote machine does not authenticate that the response actually came from the KDC. An attacker may send a fabricated response designed to decrypt correctly under a password chosen by the attacker, causing the remote system to accept the login.

A protected system needs an additional way to verify the KDC’s role. For example, the remote host can have its own registered Kerberos principal and long-term key. After checking the user’s initial credentials, it can request a ticket for itself from the TGS and verify that ticket using its own key. Because the host can decrypt the ticket only if it is valid for that host, this adds evidence that the KDC participated correctly.

Not every workstation requires the same checks. A personal workstation on which the user already has administrative control has a different risk profile from a shared time-sharing machine that hosts multiple users’ processes and data. Shared systems need stronger protection against one user being falsely assigned another user’s identity.


Changing passwords and keys

Kerberos can provide a password-changing service. A client obtains a ticket for that service and sends the new password protected with the session key for the exchange. The KDC then updates the user’s key.

The password-changing service must distinguish credentials obtained directly through the initial authentication process from tickets obtained later through the TGS. Otherwise, someone who steals a user’s temporary ticket could use it to change the user’s password and take over the account.

Accordingly, the ticket can carry information indicating how it was obtained. The password-changing service can require a ticket that demonstrates recent use of the user’s password-derived key, rather than accepting any ticket issued through the TGS. This does not protect an account if an attacker actually knows the user’s current password-derived key; someone who knows the current credential can generally act as the user.

The old-password transcript problem

A password-change exchange must protect more than the immediate request. Suppose an attacker records the encrypted messages from a password change but cannot initially decrypt them. If the user later reveals the old password, the attacker may be able to decrypt the earlier exchange, recover key material, and then decrypt later password changes in sequence. The recorded messages can form a chain that exposes a newer password once an older one becomes known.

This is why merely encrypting each new password under a key derived from the current password can be insufficient. A secure exchange should establish fresh secret material that cannot be recovered later just by learning an old password.


Diffie–Hellman key exchange

Diffie–Hellman key exchange lets two parties establish a shared secret over a network even when an observer can see the exchanged values. In simplified form, the client chooses a private random value xxx, and the server chooses a private random value yyy. They exchange public values derived from a public parameter ggg:

  • The client sends gxg^xgx.

  • The server sends gyg^ygy.

  • The client computes (gy)x=gxy(g^y)^x = g^{xy}(gy)x=gxy.

  • The server computes (gx)y=gxy(g^x)^y = g^{xy}(gx)y=gxy.

Both sides obtain the same shared value, gxyg^{xy}gxy, without sending xxx, yyy, or gxyg^{xy}gxy directly. An observer who sees gxg^xgx and gyg^ygy is assumed to be unable to feasibly derive gxyg^{xy}gxy under the relevant mathematical hardness assumptions.

The parties can use the resulting secret to protect the new password and other messages. In real systems, the exchanged values must also be authenticated; otherwise, an attacker could establish separate secrets with each party and impersonate one side to the other. Kerberos version 5 incorporates improved mechanisms for this kind of password-change exchange.


Key takeaways

  • Kerberos authenticates principals through tickets and shared keys, rather than relying on network addresses or sending passwords as ordinary network messages.

  • The KDC maps principal names to long-term keys and issues tickets; services use their own keys to validate tickets.

  • Tickets support authentication, while service-specific access-control rules provide authorization.

  • Short ticket lifetimes limit the period in which stolen temporary credentials can be used, but compromise of a long-term key can be much more serious.

  • Secure protocols must authenticate messages as well as encrypt them, bind authenticators to the operations they authorize, distinguish communication directions, and use modern cryptographic algorithms.

  • The KDC, user workstations, service keys, account administrators, and credential-reset procedures are all important parts of the system’s security boundary.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent