Kerberos

Work in progress. This note is still being written and incomplete.

Kerberos is a distributed authentication and access control system giving a User single sign-on access to multiple Services in a Realm after 1 initial login.

It solves 2 problems the 2-party authentication protocols don’t:

  • A small number of shared client workstations serve a much larger number of Users, so there is no secure local place to store long-term secrets. A compromised workstation must not break security for everyone.
  • A distributed system has many independent Services (file, print, mail, proxy), and a User should not have to authenticate separately to each one.

Realm

An administrative domain. Has a shared identity database and a set of Services. A trust boundary. Everything inside shares 1 identity database and 1 set of keys.

Example: uom.lk.

A Realm has exactly 1 AS and 1 TGS, both hosted by its KDC. The KDC may be replicated across machines for availability, but all replicas act as the same AS and TGS over 1 database.

Principal

The uniquely identifiable name of the client (User) or a Service within a Realm. Denoted as CC. A Service’s Principal is denoted as VV.

Example: user.name@uom.lk.

Ticket

A credential that a Principal presents to prove it was authenticated. Encrypted under a key the client does not have access to. Cannot be read or forged by the clients.

Authentication Server

Also known as AS. Verifies the User’s password and issues a ticket proving the login. The only component that checks the User’s password. Issues a ticket after successful authentication.

AS derives a key KCK_C from the password, and encrypts its reply under it, so only someone who knows the password can read the reply. The reply includes the TGT and some other metadata.

Ticket Granting Ticket

Also known as TGT. The ticket issued by the AS, proving that CC has authenticated to the AS.

Encrypted under KTK_T, the long-term key shared by the AS and TGS.

Ticket Granting Server

Also known as TGS. Issues a ticket for a specific Service when presented with the ticket from the login.

Its Principal is denoted as TT, conventionally krbtgt/REALM@REALM.

Each Realm has 1 TGS, so TT is fixed per Realm. A TGS of a different Realm is reached through cross-realm authentication. The client’s own TGS issues a TGT for the remote TGS (krbtgt/REMOTE@LOCAL), which requires the 2 Realms to share a key.

The TGS lets a User reach many Services without retyping the password. The client repeats the request for every Service, reusing the login ticket until it expires.

Without the TGS, the client would need the password-derived key for every Service. It would either re-prompt the User or keep the password or key in memory, which breaks the goal of having no secure place for long-term secrets on a shared workstation.

Service Granting Ticket

The ticket issued by the TGS, proving that CC has authenticated to the TGS for VV. aka. SGT.

Encrypted under KVK_V, the long-term key shared by the TGS and VV. The client or other Services cannot tamper with it.

IP List

An optional list of IP addresses the client sends to the Authentication Server as acceptable request origins. Denoted as IP-list\text{IP-list}.

Only the client knows which addresses it will send its later requests from. The AS keeps no per-User record of this, since workstations change address.

It may be modified or ignored entirely by the AS which is (IP-listmodified\text{IP-list}_\text{modified}). The TGS and VV can use it to reject a ticket arriving from an address the AS did not expect.

The list protects against a stolen ticket replayed from another address. Does not protect against someone who knows the password, since they declare their own address. Spoofed source IPs and NAT weaken it further, so it is often left empty.

A server-maintained restriction on where a User may log in from is a separate policy and not part of the protocol messages.

Key Distribution Centre

Hosts the AS and the TGS, and holds the long-term secret key of every Principal in the Realm. aka. KDC.

The KDC looks up which long-term key belongs to which Principal.

KCK_C

Long-term key shared between CC and the AS, computed as Hash(pwd ∥ salt)\text{Hash}(\text{pwd} \,\|\, \text{salt}) from the User’s password and a stored salt. Never stored, only computed on demand and discarded. Does not change across logins as long as the password remains the same.

The AS encrypts the session-key part of the AS_REP\text{AS\_REP} under it, so only someone who knows the password can recover KC,TK_{C,T}.

KTK_T

Long-term key shared between the AS and the TGS.

The AS encrypts the TGT under it and the TGS decrypts the TGT with it. The TGS trusts a TGT without contacting the AS.

KVK_V

Long-term key shared between the TGS and VV.

The TGS encrypts the SGT under it and VV decrypts the SGT with it. VV trusts an SGT without contacting the TGS.

KC,TK_{C,T}

Session key for CC and the TGS, chosen fresh by the AS for this login.

The AS delivers it twice, inside the TGT (under KTK_T) and inside the AS_REP\text{AS\_REP} (under KCK_C). CC encrypts Authenticator1\text{Authenticator}_1 under it, and the TGS encrypts the session-key part of the TGS_REP\text{TGS\_REP} under it.

KC,VK_{C,V}

Session key for CC and VV, chosen fresh by the TGS for this request.

The TGS delivers it twice, inside the SGT (under KVK_V) and inside the TGS_REP\text{TGS\_REP} (under KC,TK_{C,T}). CC encrypts Authenticator2\text{Authenticator}_2 under it, so VV knows the sender holds the session key.

CC shares exactly 1 long-term secret with the AS (KCK_C) and 0 with the TGS or any Service, since KC,TK_{C,T} and KC,VK_{C,V} are freshly generated per session. The AS and TGS share 1 long-term key (KTK_T), and the TGS and VV share 1 (KVK_V). AS shares 0 keys with VV.

As KCK_C never changes across logins, an attacker who captures 1 AS_REP\text{AS\_REP} can mount an offline dictionary attack against pwd\text{pwd} at leisure, without further interaction with the AS. This is the main weakness of password-based Kerberos.

Protocol Flow

REALM · uom.lk KEY DISTRIBUTION CENTRE KT shared long-term key Authentication Server checks the User's password replies under the key KC Ticket Granting Server trusts a TGT on sight never sees the password issues 1 SGT per Service KV Client C shared workstation credential cache TGT KC,T SGT KC,V Service V file, print, mail decrypts the SGT checks the Authenticator TGT SGT TGT SGT 1 AS_REQ C, T, IP-list 2 AS_REP TGT, Enc[KC](KC,T) 3 TGS_REQ V, TGT, Auth1 4 TGS_REP SGT, Enc[KC,T](KC,V) 5 AP_REQ SGT, Auth2 Steps 1 to 2: once per login Steps 3 to 5: repeat per Service
Kerberos architecture. The client holds no long-term key for the TGS or any Service, only tickets and fresh session keys.

1. Authentication Server Request

CC sends an unencrypted request to the AS for a TGT.

AS_REQ=[C,T,IP-list,lifetimerequested]\text{AS\_REQ} = [C, T, \text{IP-list}, \text{lifetime}_{\text{requested}}]

AS_REQ\text{AS\_REQ} carries the TGS’s Principal (TT) so the system (as a whole) knows which key to use to encrypt the TGT.

2. Authentication Server Reply

The AS validates CC and TT with the KDC database, then generates a fresh KC,TK_{C,T} and embeds it in a TGT.

TGT=EncKT(C,IP-listmodified,timestampAS,lifetimegranted,KC,T)TGT = \text{Enc}_{K_T}(C, \text{IP-list}_{\text{modified}}, \text{timestamp}_{AS}, \text{lifetime}_{\text{granted}}, K_{C,T}) AS_REP=[EncKC(T,timestampAS,lifetimegranted,KC,T),TGT]\text{AS\_REP} = [\text{Enc}_{K_C}(T, \text{timestamp}_{AS}, \text{lifetime}_{\text{granted}}, K_{C,T}), TGT]

The client prompts the User for pwd\text{pwd}, computes KCK_C, and decrypts the reply to recover KC,TK_{C,T}. It stores KC,TK_{C,T} and the TGT in the User’s credential cache.

3. Ticket Granting Server Request

To reach VV, CC requests an SGT from the TGS, presenting the TGT with a freshly built Authenticator, abbreviated as Auth\text{Auth}. Auth1\text{Auth}_1 and Auth2\text{Auth}_2 are the Authenticators of step 3 and step 5, written as Authenticator1\text{Authenticator}_1 and Authenticator2\text{Authenticator}_2 in full.

Authenticator1=EncKC,T(C,timestampC)\text{Authenticator}_1 = \text{Enc}_{K_{C,T}}(C, \text{timestamp}_C) TGS_REQ=[V,lifetimerequested,Authenticator1,TGT]\text{TGS\_REQ} = [V, \text{lifetime}_{\text{requested}}, \text{Authenticator}_1, TGT]

4. Ticket Granting Server Reply

The TGS checks VV exists in the KDC database, decrypts the TGT with KTK_T to recover KC,TK_{C,T}, then decrypts Authenticator1\text{Authenticator}_1 with KC,TK_{C,T}.

Before issuing an SGT, the TGS checks:

  • The TGT has not expired.
  • Authenticator1\text{Authenticator}_1 has not expired.
  • The CC in Authenticator1\text{Authenticator}_1 matches the CC in the TGT.
  • Authenticator1\text{Authenticator}_1 is not present in the replay cache.
  • If IP-listmodified\text{IP-list}_{\text{modified}} is non-empty, the source IP of the TGS_REQ\text{TGS\_REQ} matches an entry in it.

If all checks pass, the TGS generates a fresh KC,VK_{C,V} and embeds it in an SGT.

SGT=EncKV(C,IP-listmodified,timestampTGS,lifetimegranted,KC,V)SGT = \text{Enc}_{K_V}(C, \text{IP-list}_{\text{modified}}, \text{timestamp}_{TGS}, \text{lifetime}_{\text{granted}}, K_{C,V}) TGS_REP=[EncKC,T(V,timestampTGS,lifetimegranted,KC,V),SGT]\text{TGS\_REP} = [\text{Enc}_{K_{C,T}}(V, \text{timestamp}_{TGS}, \text{lifetime}_{\text{granted}}, K_{C,V}), SGT]

5. Application Request

CC uses the SGT as its credential to reach VV, building a second Authenticator secured under KC,VK_{C,V}.

Authenticator2=EncKC,V(C,timestampC)\text{Authenticator}_2 = \text{Enc}_{K_{C,V}}(C, \text{timestamp}_C) AP_REQ=[Authenticator2,SGT]\text{AP\_REQ} = [\text{Authenticator}_2, SGT]

VV decrypts the SGT with KVK_V to recover KC,VK_{C,V}, then decrypts Authenticator2\text{Authenticator}_2 and runs the same 5 checks the TGS ran in step 4, substituting the SGT for the TGT. A pass grants CC access to the Service.

Steps 3 to 5 repeat for every Service CC wants to reach, each time presenting a fresh Authenticator but reusing the TGT until it expires. Only steps 1 to 2 need the User’s password.

Only AS_REQ\text{AS\_REQ} travels fully in the clear. Confidentiality is per-field, not per-channel: each field is encrypted under whichever key its sender shares with the intended reader, e.g. the TGT under KTK_T, an Authenticator under that step’s session key, and the SGT under KVK_V.

1 AS_REQ C to AS 2 AS_REP AS to C 3 TGS_REQ C to TGS 4 TGS_REP TGS to C 5 AP_REQ C to V Enc C AS TGS V TGT Enc C AS TGS V Auth1 Enc C AS TGS V Enc C AS TGS V SGT Enc C AS TGS V Auth2 Enc C AS TGS V C T IP-list lifetimerequested KC T timestampAS lifetimegranted KC,T KT C IP-listmodified timestampAS lifetimegranted KC,T V lifetimerequested KC,T C timestampC TGT KC,T V timestampTGS lifetimegranted KC,V KV C IP-listmodified timestampTGS lifetimegranted KC,V KC,V C timestampC SGT TGT and KC,T SGT and KC,V every other field derived from the password, never forwarded Who can read the encrypted fields C AS TGS V Hover or tap one to blank out what it cannot read
Where each value comes from and where the next step reuses it. Hover or tap a value to follow it. Tap it again, or tap empty space, to clear. The badges on each box show who can decrypt it.

Origins

Kerberos was developed at MIT in the 1980s, because passwords travelled in plaintext over open networks. It adapts the Needham-Schroeder protocol of 1978 into a practical system.

Clock Synchronisation

Every Authenticator carries a timestamp, and the receiver rejects it outside an allowed time skew.

  • A captured ticket and Authenticator cannot be replayed once they fall outside the allowed window, which is a few minutes.
  • A client clock that drifts beyond the skew, such as 10 minutes ahead of the KDC, has its requests rejected.
  • The KDC does not adjust the client’s clock. Clocks are synchronised separately, e.g. by NTP.

Timestamps prevent replay. They do not synchronise clocks.

Requirements

  • The client needs software libraries for symmetric encryption such as AES. It needs no public-key support or certificates.
  • Standard Kerberos traffic between the client and the KDC uses both UDP and TCP, on port 88.
Written by October 17, 2026 8 min read
Was this helpful?