Kerberos Authentication: Introduction

Kerberos is a network authentication protocol designed at MIT to provide strong authentication for client/server applications using secret-key cryptography. It allows entities communicating over potentially insecure networks to prove their identities to each other securely.

Think of it like getting a temporary, verifiable ID badge (a ticket ) from a trusted central authority (the KDC ) that you can then show to various secured services (like file servers, web applications, or even a firewall's admin interface) to gain access, often without needing to present your main password repeatedly.

Why Use Kerberos?

It's the default authentication protocol used in Microsoft Windows Active Directory domains.

Kerberos: Core Concepts and Components

Understanding Kerberos requires familiarity with its key terminology and components:

These components interact through a series of secure exchanges involving encrypted tickets and authenticators.

Authentication Flow: Step 1 - AS Exchange (Getting the TGT)

The first phase involves the client authenticating itself to the Authentication Server (AS) part of the KDC to obtain a Ticket Granting Ticket (TGT).

  1. Client Request (AS-REQ):
    • The client sends a request (AS-REQ) to the AS.
    • This request typically contains the client's principal name ( user@REALM ), the principal name of the TGS (usually krbtgt/REALM@REALM ), and often a timestamp or nonce.
    • Crucially, the client's password is NOT sent in plaintext.
  2. AS Processing:
    • The AS receives the AS-REQ and looks up the client's principal in its database.
    • It retrieves the client's long-term secret key (derived from the user's password).
    • The AS generates a strong, random Client-KDC Session Key .
    • It creates the TGT , which includes:
      • The Client-KDC Session Key.
      • The client's principal name.
      • The TGT's validity period (start and end times).
      • Other flags and information.
    • The AS encrypts the entire TGT using the TGS's secret key (which only the TGS can decrypt).
  3. AS Reply (AS-REP):
    • The AS sends a reply (AS-REP) back to the client.
    • This reply contains two main parts:
      1. The encrypted TGT (opaque to the client).
      2. The Client-KDC Session Key , encrypted using the client's long-term secret key (derived from the password the user provided or cached).
  4. Client Processing:
    • The client receives the AS-REP.
    • It uses its own secret key (derived from the entered password) to decrypt part (b) of the reply, obtaining the Client-KDC Session Key .
    • If the password was incorrect, decryption fails, and authentication stops here.
    • The client stores the encrypted TGT and the decrypted Client-KDC Session Key in its credential cache for future use during the TGT's lifetime.

At the end of this phase, the client has successfully authenticated to the KDC and possesses a TGT and the associated Client-KDC session key, allowing it to proceed to the next step without re-entering its password.

Authentication Flow: Step 2 - TGS Exchange (Getting a Service Ticket)

Once the client has a valid TGT and the corresponding Client-KDC Session Key, it can request tickets for specific services from the Ticket Granting Server (TGS).

  1. Client Request (TGS-REQ):
    • When the client needs to access a specific service (e.g., HTTP/server.example.com@EXAMPLE.COM ), it constructs a request (TGS-REQ) for the TGS.
    • This request includes:
      1. The Service Principal Name (SPN) of the target service.
      2. The encrypted TGT obtained from the AS.
      3. An Authenticator : This contains the client's principal name and a current timestamp, encrypted using the Client-KDC Session Key (obtained in the AS exchange).
  2. TGS Processing:
    • The TGS receives the TGS-REQ.
    • It uses its own TGS secret key to decrypt the TGT (part b of the request). This decryption validates the TGT itself and extracts the Client-KDC Session Key , client principal name, and TGT validity period.
    • The TGS uses the extracted Client-KDC Session Key to decrypt the Authenticator (part c of the request).
    • It verifies the client principal name inside the Authenticator matches the one in the TGT.
    • It checks the timestamp in the Authenticator against its own clock (within acceptable skew) to prevent replay attacks. It may also check against a replay cache.
    • If all checks pass, the TGS generates a new, random Client-Service Session Key .
    • It creates the Service Ticket (ST) , which includes:
      • The Client-Service Session Key.
      • The client's principal name.
      • The ST's validity period.
      • Other flags.
    • The TGS encrypts the entire ST using the target Service Server's secret key (retrieved from the KDC database based on the requested SPN).
  3. TGS Reply (TGS-REP):
    • The TGS sends a reply (TGS-REP) back to the client.
    • This reply contains two main parts:
      1. The encrypted Service Ticket (opaque to the client).
      2. The Client-Service Session Key , encrypted using the Client-KDC Session Key (the one shared between the client and TGS).
  4. Client Processing:
    • The client receives the TGS-REP.
    • It uses its stored Client-KDC Session Key to decrypt part (b) of the reply, obtaining the Client-Service Session Key .
    • The client stores the encrypted Service Ticket and the decrypted Client-Service Session Key in its credential cache, ready for use with the target service.

Now the client possesses a ticket specifically for the target service and a unique session key to communicate securely with that service.

Authentication Flow: Step 3 - Client-Server Exchange (Accessing the Service)

With the Service Ticket (ST) and the Client-Service Session Key obtained, the client can now authenticate itself to the target Service Server (SS).

  1. Client Request (AP-REQ):
    • The client constructs an Application Request (AP-REQ) to send to the Service Server.
    • This request includes:
      1. The encrypted Service Ticket (ST) obtained from the TGS.
      2. A new Authenticator : This contains the client's principal name and a current timestamp, encrypted using the Client-Service Session Key (obtained in the TGS exchange).
    • The client sends the AP-REQ to the target Service Server.
  2. Service Server Processing:
    • The Service Server receives the AP-REQ.
    • It uses its own long-term secret key (retrieved from its keytab file , associated with its SPN) to decrypt the Service Ticket (part a of the request).
    • Decryption yields the Client-Service Session Key , the client's principal name, the ticket's validity period, and other flags.
    • If decryption fails (wrong key), the ticket is invalid, and authentication fails.
    • The Service Server uses the extracted Client-Service Session Key to decrypt the Authenticator (part b of the request).
    • It verifies that the client principal name inside the Authenticator matches the one extracted from the Service Ticket.
    • It checks the timestamp in the Authenticator against its own clock (within acceptable skew) and potentially against a replay cache. This is why time synchronization is critical!
    • If all checks pass, the Service Server is confident that the client possesses the correct Client-Service Session Key and therefore trusts the client's identity as presented in the Service Ticket.
  3. Service Access Granted:
    • The Service Server grants the client access to the requested resource based on the authenticated identity and local authorization policies.
  4. (Optional) Mutual Authentication (AP-REP):
    • To prove its own identity to the client, the Service Server can optionally send back an Application Reply (AP-REP).
    • This reply might contain the timestamp from the client's Authenticator, encrypted using the Client-Service Session Key .
    • The client decrypts this reply using its stored Client-Service Session Key. If the timestamp matches what it sent, it confirms the server also possesses the correct key and is legitimate.

After this exchange, the client is authenticated to the service for the duration allowed by the service or until the Service Ticket expires.

Kerberos Security Aspects and Keytabs

How Kerberos Provides Security

The biggest operational security requirement for Kerberos is accurate time synchronization across all clients, KDCs, and service servers. Significant clock skew (> 5 minutes by default in many implementations like AD) will cause authentication failures due to timestamp validation.

Keytab Files

A keytab (key table) file is essential for services (like web servers, applications, or the firewall itself when acting as a service) to participate in Kerberos authentication.

Realms and Trust

Kerberos operates within administrative boundaries called Realms . For a client in one realm to access a service in a *different* realm, a trust relationship must be established between the KDCs of the two realms.

Kerberos Diagrams

Component Interaction Graph

High-level view of components and primary interactions in Kerberos.

High-level view of components and primary interactions in Kerberos.


Authentication Sequence Diagram (Detailed)

Detailed sequence of messages exchanged during Kerberos authentication.

Detailed sequence of messages exchanged during Kerberos authentication.


Simplified Authentication Flowchart

Decision flow for a client obtaining tickets and accessing a service.

Decision flow for a client obtaining tickets and accessing a service.


Client Authentication State Diagram

State transitions for a Kerberos client during the authentication process.

State transitions for a Kerberos client during the authentication process.

Kerberos Quiz

Test your understanding of the Kerberos authentication protocol.

1. What is the primary role of the Key Distribution Center (KDC) in Kerberos?

2. Which component of the KDC is responsible for issuing the initial Ticket Granting Ticket (TGT)?

3. What does a client need to present to the Ticket Granting Server (TGS) to request a Service Ticket (ST)?

4. What is the Service Ticket (ST) encrypted with?

5. What is the primary purpose of the Authenticator in Kerberos messages (like TGS-REQ and AP-REQ)?

6. A user successfully logs into their Windows domain workstation. They then open a browser to access an internal web server configured for Kerberos SSO. What ticket does the browser likely use first to request access from the KDC?

7. What information is primarily stored within a keytab file on a Service Server?

8. What is a critical operational requirement for Kerberos to function correctly across clients, KDCs, and Service Servers?

9. What does "Mutual Authentication" in Kerberos typically refer to?

10. In Active Directory, the KDC service runs on which type of server?

11. What is a Service Principal Name (SPN)?

12. During the AS Exchange, the Client-KDC Session Key is sent to the client encrypted with what?

13. What is the primary content of the Ticket Granting Ticket (TGT)?

14. How does the Service Server verify that a Service Ticket presented by a client is legitimate?

15. What mechanism allows a user in REALM_A to authenticate to a service in REALM_B using Kerberos?

16. Which step in the Kerberos flow is most vulnerable if the client's password is weak?

17. What is a common reason for a "Clock skew too great" error during Kerberos authentication?

18. Which Kerberos ticket allows a client to request multiple Service Tickets without re-entering their password?

19. What is the primary security benefit of using Kerberos over older protocols like NTLMv1?

20. In the Client-Server Exchange (AP-REQ), the Authenticator is encrypted using which key?