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.
Principal, the uniquely identifiable name of the client (User) within a Realm, e.g.user.name@uom.lk.
Principal of the target Service.
Principal of the Ticket Granting Server, conventionallykrbtgt/REALM@REALM.
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 has authenticated to the AS. Encrypted under , so only the AS and TGS can read it, not . - SGT
Service Granting Ticket, proof that has authenticated to the TGS for . Encrypted under , so only the TGS and can read it, not .
Each workstation runs a client installed once by the sysadmin with root permission, regardless of how many Users later log in through it.
Keys
Long-term key shared between and the AS, computed as from the User’s password and a stored salt. Never stored, only computed on demand and discarded.
Long-term key shared between the AS and the TGS.
Long-term key shared between the TGS and .
Session key for and the TGS, chosen fresh by the AS for this login.
Session key for and , chosen fresh by the TGS for this request.
itself is stored nowhere, not on any workstation and not at the KDC. Only , derived from it, is stored at the KDC for verification. shares exactly 1 long-term secret with the AS () and 0 with the TGS or with any Service, since and are freshly generated session keys rather than long-term shared secrets. The AS and TGS share exactly 1 long-term key (), and a Service shares exactly 1 long-term key with the TGS () but 0 with the AS.
Because never changes across logins, an attacker who captures 1 can mount an offline dictionary attack against at leisure, without further interaction with the AS. This is the main weakness of password-based Kerberos.
Protocol Flow
1. Authentication Server Request
sends an unencrypted request to the AS for a TGT.
2. Authentication Server Reply
The AS checks and exist in the KDC database, then generates a fresh and embeds it in a TGT.
The client prompts the User for , computes , and decrypts the reply to recover . It stores and the TGT in the User’s credential cache. 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 , requests an SGT from the TGS, presenting the TGT with a freshly built Authenticator.
4. Ticket Granting Server Reply
The TGS checks exists in the KDC database, decrypts the TGT with to recover , then decrypts with .
Before issuing an SGT, the TGS checks:
- The TGT has not expired.
- has not expired.
- The in matches the in the TGT.
- is not present in the replay cache.
- If is non-empty, the source IP of the matches an entry in it.
If all checks pass, the TGS generates a fresh and embeds it in an SGT.
5. Application Request
uses the SGT as its credential to reach , building a second Authenticator secured under .
decrypts the SGT with to recover , then decrypts and runs the same 5 checks the TGS ran in step 4, substituting the SGT for the TGT. A pass grants access to the Service.
Steps 3 to 5 repeat for every Service 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 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 and the rest of under , creates each Authenticator under that step’s session key ( or ), and the TGS creates the SGT under and the rest of under .