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.

Key Components

  • Realm
    Administrative domain operating a shared identity database and a set of Services, e.g. uom.lk.
  • CC
    Principal, the uniquely identifiable name of the client (User) within a Realm, e.g. user.name@uom.lk.
  • VV
    Principal of the target Service.
  • TT
    Principal of the Ticket Granting Server, conventionally krbtgt/REALM@REALM.
  • IP-listIP\text{-}list
    Optional list of IP addresses the client sends to the Authentication Server as acceptable request origins. May be filtered or ignored entirely.
  • KDC
    Key Distribution Centre, holds the long-term secret key of every Principal in the Realm.
  • AS
    Authentication Server, issues the Ticket Granting Ticket.
  • TGS
    Ticket Granting Server, issues Service Granting Tickets.
  • TGT
    Ticket Granting Ticket, proof that CC has authenticated to the AS. Encrypted under KTK_T, so only the AS and TGS can read it, not CC.
  • SGT
    Service Granting Ticket, proof that CC has authenticated to the TGS for VV. Encrypted under KVK_V, so only the TGS and VV can read it, not CC.

Each workstation runs a client installed once by the sysadmin with root permission, regardless of how many Users later log in through it.

Keys

  • KCK_C
    Long-term key shared between CC and the AS, computed as Hash(pwdsalt)\text{Hash}(pwd \,\|\, salt) from the User’s password and a stored salt. Never stored, only computed on demand and discarded.
  • KTK_T
    Long-term key shared between the AS and the TGS.
  • KVK_V
    Long-term key shared between the TGS and VV.
  • KC,TK_{C,T}
    Session key for CC and the TGS, chosen fresh by the AS for this login.
  • KC,VK_{C,V}
    Session key for CC and VV, chosen fresh by the TGS for this request.

pwdpwd itself is stored nowhere, not on any workstation and not at the KDC. Only KCK_C, derived from it, is stored at the KDC for verification. CC shares exactly 1 long-term secret with the AS (KCK_C) and 0 with the TGS or with any Service, since KC,TK_{C,T} and KC,VK_{C,V} are freshly generated session keys rather than long-term shared secrets. The AS and TGS share exactly 1 long-term key (KTK_T), and a Service shares exactly 1 long-term key with the TGS (KVK_V) but 0 with the AS.

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

Protocol Flow

1. Authentication Server Request

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

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

2. Authentication Server Reply

The AS checks CC and TT exist in 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, IP\text{-}list_{modified}, timestamp_{AS}, lifetime_{granted}, K_{C,T}) AS_REP=[EncKC(T,timestampAS,lifetimegranted,KC,T),TGT]AS\_REP = [\text{Enc}_{K_C}(T, timestamp_{AS}, lifetime_{granted}, K_{C,T}), TGT]

The client prompts the User for pwdpwd, 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. KCK_C is recomputed every login and never persisted, so the client never needs to store the User’s password.

3. Ticket Granting Server Request

To reach VV, CC requests an SGT from the TGS, presenting the TGT with a freshly built Authenticator.

Authenticator1=EncKC,T(C,timestampC)Authenticator_1 = \text{Enc}_{K_{C,T}}(C, timestamp_C) TGS_REQ=[V,lifetimerequested,Authenticator1,EncKT(TGT)]TGS\_REQ = [V, lifetime_{requested}, Authenticator_1, \text{Enc}_{K_T}(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 Authenticator1Authenticator_1 with KC,TK_{C,T}.

Before issuing an SGT, the TGS checks:

  • The TGT has not expired.
  • Authenticator1Authenticator_1 has not expired.
  • The CC in Authenticator1Authenticator_1 matches the CC in the TGT.
  • Authenticator1Authenticator_1 is not present in the replay cache.
  • If IP-listmodifiedIP\text{-}list_{modified} is non-empty, the source IP of the TGS_REQTGS\_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, IP\text{-}list_{modified}, timestamp_{TGS}, lifetime_{granted}, K_{C,V}) TGS_REP=[EncKC,T(V,timestampTGS,lifetimegranted,KC,V),SGT]TGS\_REP = [\text{Enc}_{K_{C,T}}(V, timestamp_{TGS}, lifetime_{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)Authenticator_2 = \text{Enc}_{K_{C,V}}(C, timestamp_C) AP_REQ=[Authenticator2,EncKV(SGT)]AP\_REQ = [Authenticator_2, \text{Enc}_{K_V}(SGT)]

VV decrypts the SGT with KVK_V to recover KC,VK_{C,V}, then decrypts Authenticator2Authenticator_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_REQAS\_REQ travels fully in the clear. Every later message carries fields encrypted under whichever key its sender shares with the intended reader of that field, so confidentiality is per-field rather than per-channel: the AS creates the TGT under KTK_T and the rest of AS_REPAS\_REP under KCK_C, CC creates each Authenticator under that step’s session key (KC,TK_{C,T} or KC,VK_{C,V}), and the TGS creates the SGT under KVK_V and the rest of TGS_REPTGS\_REP under KC,TK_{C,T}.

Written by September 16, 2026 5 min read
Was this helpful?