CSS411 Cryptography

Kerberos

Slide deck 19. Kerberos threats, the version 4 dialogue with AS and TGS, realms, and the version 5 exchanges.

17 min read

Kerberos basicsSearch on YouTube

ThreatsSearch on YouTube

Users wish to access services on servers across a network. Three threats exist:

ThreatExample
A user pretends to be another userAn attacker logs on with the identity of another user
A user alters the network address of a workstationRequests from the attacker look as if they come from another workstation
A user eavesdrops on exchanges and uses a replay attackThe attacker records an exchange and sends it again later

Kerberos propertiesSearch on YouTube

  • Kerberos provides a centralized authentication server. It authenticates users to servers and servers to users.
  • Kerberos relies on conventional (symmetric) encryption. It makes no use of public-key encryption.
  • There are two versions: version 4 and version 5.
  • Version 4 uses DES.

A good exam opener: "Kerberos is a centralized authentication service. It uses only symmetric encryption (DES in version 4)." Then give the three threats.

NotationSearch on YouTube

SymbolMeaning
CCClient
ASASAuthentication server
VVServer
IDCID_CIdentifier of the user on CC
IDVID_VIdentifier of VV
PCP_CPassword of the user on CC
ADCAD_CNetwork address of CC
KVK_VSecret encryption key shared by ASAS and VV
TSTSTimestamp
∥\VertConcatenation

The version 4 tables also use these keys. KCK_C is the key derived from the password of the user. KtgsK_{tgs} is the key shared by the AS and the TGS. Kc,tgsK_{c,tgs} and Kc,vK_{c,v} are session keys.

Kerberos version 4Search on YouTube

Simple authentication dialogueSearch on YouTube

The slides start with a simple dialogue:

(1) C→AS: IDC∥PC∥IDV\text{(1)}\ C \rightarrow AS:\ ID_C \Vert P_C \Vert ID_V

(2) AS→C: Ticket\text{(2)}\ AS \rightarrow C:\ Ticket

(3) C→V: IDC∥Ticket\text{(3)}\ C \rightarrow V:\ ID_C \Vert Ticket

Ticket=E(KV,[IDC∥PC∥IDV])Ticket = E(K_V, [ID_C \Vert P_C \Vert ID_V])

Only the AS and VV know KVK_V, so the client cannot change the ticket. This dialogue has two problems. The password goes over the network in clear in message 1. Also, the user must enter the password for each new service.

Ticket lifetime problemSearch on YouTube

The real version 4 dialogue uses a ticket-granting ticket that the client reuses. The lifetime of this ticket causes a problem:

  • If the lifetime is too short, the system repeatedly asks the user for the password.
  • If the lifetime is too long, an opponent has a greater opportunity to replay the ticket.

The threat is that an opponent steals the ticket and uses it before it expires.

A ticket is like a day pass. A short pass makes you queue again and again. A long pass is more useful to a thief.

AS, tickets and TGSSearch on YouTube

Version 4 uses DES to provide the authentication service.

Authentication server (AS):

  • The AS knows the passwords of all users and stores them in a centralized database.
  • The AS shares a unique secret key with each server.

Ticket:

  • The AS creates a ticket after it accepts the user as authentic.
  • The ticket contains the ID of the user, the network address of the user and the ID of the server.
  • The ticket is encrypted with the secret key shared by the AS and the server.

Ticket-granting server (TGS):

  • The TGS issues tickets to users who have been authenticated to the AS.
  • For each new service, the client applies to the TGS and uses its ticket for authentication.
  • The TGS then grants a ticket for that service.
  • The client saves each service-granting ticket. It uses the ticket each time the user requests that service.

Version 4 message exchangesSearch on YouTube

Table 15.1 and Figure 15.2 show three exchanges with six messages.

Client Clogs on onceper sessionKerberos (KDC)ASauthentication serverTGSticket-granting serverVapplication server(1) IDC​ ‖ IDtgs​ ‖ TS1​(2) E(KC​, [Kc,tgs​ … Tickettgs​])(3) IDV​ ‖ Tickettgs​ ‖ AuthC​(4) E(Kc,tgs​, [Kc,v​ … TicketV​])(5) TicketV​ ‖ AuthC​(6) E(Kc,v​, [TS5​ + 1])
Kerberos version 4: the client gets a ticket-granting ticket from the AS, a service ticket from the TGS, then uses the service.

(a) Authentication service exchange, to get a ticket-granting ticket:

(1) C→AS: IDC∥IDtgs∥TS1\text{(1)}\ C \rightarrow AS:\ ID_C \Vert ID_{tgs} \Vert TS_1

(2) AS→C: E(KC,[Kc,tgs∥IDtgs∥TS2∥Lifetime2∥Tickettgs])\text{(2)}\ AS \rightarrow C:\ E(K_C, [K_{c,tgs} \Vert ID_{tgs} \Vert TS_2 \Vert Lifetime_2 \Vert Ticket_{tgs}])

Tickettgs=E(Ktgs,[Kc,tgs∥IDC∥ADC∥IDtgs∥TS2∥Lifetime2])Ticket_{tgs} = E(K_{tgs}, [K_{c,tgs} \Vert ID_C \Vert AD_C \Vert ID_{tgs} \Vert TS_2 \Vert Lifetime_2])

The AS encrypts message 2 with KCK_C, the key derived from the password. Only a user who knows the password can decrypt it. The password itself does not go over the network.

(b) Ticket-granting service exchange, to get a service-granting ticket:

(3) C→TGS: IDV∥Tickettgs∥AuthenticatorC\text{(3)}\ C \rightarrow TGS:\ ID_V \Vert Ticket_{tgs} \Vert Authenticator_C

(4) TGS→C: E(Kc,tgs,[Kc,v∥IDV∥TS4∥TicketV])\text{(4)}\ TGS \rightarrow C:\ E(K_{c,tgs}, [K_{c,v} \Vert ID_V \Vert TS_4 \Vert Ticket_V])

TicketV=E(KV,[Kc,v∥IDC∥ADC∥IDV∥TS4∥Lifetime4])Ticket_V = E(K_V, [K_{c,v} \Vert ID_C \Vert AD_C \Vert ID_V \Vert TS_4 \Vert Lifetime_4])

AuthenticatorC=E(Kc,tgs,[IDC∥ADC∥TS3])Authenticator_C = E(K_{c,tgs}, [ID_C \Vert AD_C \Vert TS_3])

The TGS decrypts the ticket and gets Kc,tgsK_{c,tgs}. Then it decrypts the authenticator. IDCID_C and ADCAD_C must match in the ticket and the authenticator, and TS3TS_3 must be recent.

(c) Client/server authentication exchange, to get the service:

(5) C→V: TicketV∥AuthenticatorC\text{(5)}\ C \rightarrow V:\ Ticket_V \Vert Authenticator_C

(6) V→C: E(Kc,v,[TS5+1])(for mutual authentication)\text{(6)}\ V \rightarrow C:\ E(K_{c,v}, [TS_5 + 1]) \quad \text{(for mutual authentication)}

AuthenticatorC=E(Kc,v,[IDC∥ADC∥TS5])Authenticator_C = E(K_{c,v}, [ID_C \Vert AD_C \Vert TS_5])

In message 6, VV returns TS5+1TS_5 + 1 under Kc,vK_{c,v}. Only a server that can decrypt the ticket knows Kc,vK_{c,v}. Thus the client knows the server is genuine.

The order is AS, TGS, V. Message 1 is sent once per logon session. Message 3 is sent once per type of service. Message 5 is sent once per service session.

A ticket can be reused, but an authenticator cannot. A stolen ticket is not sufficient, because the thief cannot make a new authenticator without the session key.

Overview of KerberosSearch on YouTube

The overview figure gives the same exchanges in six steps:

  1. The user logs on to the workstation and requests service on the host.
  2. The AS verifies the access right of the user in the database. It creates a ticket-granting ticket and a session key. It encrypts the results with a key derived from the password of the user.
  3. The workstation prompts the user for the password and uses it to decrypt the incoming message. Then it sends the ticket and an authenticator to the TGS. The authenticator contains the name of the user, the network address and the time.
  4. The TGS decrypts the ticket and the authenticator, verifies the request, then creates a ticket for the requested server.
  5. The workstation sends the ticket and the authenticator to the server.
  6. The server verifies that the ticket and the authenticator match, then grants access to the service. If mutual authentication is necessary, the server returns an authenticator.

Kerberos realmsSearch on YouTube

Full-service environmentSearch on YouTube

A full-service Kerberos environment has a Kerberos server, a number of clients and a number of application servers. It requires that:

  • The Kerberos server has the user ID and hashed password of all participating users in its database. All users are registered with the Kerberos server.
  • The Kerberos server shares a secret key with each server. All servers are registered with the Kerberos server.
  • The Kerberos server in each interoperating realm shares a secret key with the server in the other realm. The two Kerberos servers are registered with each other.

Kerberos realmSearch on YouTube

A Kerberos realm is a set of managed nodes that share the same Kerberos database.

  • The database is on the Kerberos master computer system. Keep this system in a physically secure room.
  • A read-only copy of the database can also be on other Kerberos computer systems.
  • All changes to the database must be made on the master computer system.
  • To change or access the database, you must have the Kerberos master password.

Request in another realmSearch on YouTube

A client in realm A gets a service from a server in realm B in seven steps:

  1. The client requests a ticket for the local TGS from the AS in realm A.
  2. The AS sends a ticket for the local TGS.
  3. The client requests a ticket for the remote TGS from the local TGS.
  4. The local TGS sends a ticket for the remote TGS.
  5. The client requests a ticket for the remote server from the TGS in realm B.
  6. The remote TGS sends a ticket for the remote server.
  7. The client requests the remote service from the server in realm B.

The remote TGS accepts the ticket from step 4 because the two Kerberos servers share a secret key.

Kerberos version 5Search on YouTube

Differences from version 4Search on YouTube

The slides list five areas where version 5 changes version 4:

AreaVersion 4Version 5
Encryption system dependenceUses only DESCiphertext has an encryption type identifier, so any algorithm can be used
Internet protocol dependenceUses only IP addressesNetwork addresses have a type and length tag
Ticket lifetime8-bit field in units of 5 minutes, maximum 255×5=1275255 \times 5 = 1275 minutes (about 21 hours)Explicit start time and end time
Authentication forwardingNot possibleA server can use the credentials of a client to access another server
Interrealm authenticationEach pair of realms needs a key, so NN realms need N2N^2 relationshipsNeeds fewer relationships

Version 5 message exchangesSearch on YouTube

Table 15.3 shows the version 5 exchanges.

(a) Authentication service exchange:

(1) C→AS: Options∥IDC∥RealmC∥IDtgs∥Times∥Nonce1\text{(1)}\ C \rightarrow AS:\ Options \Vert ID_C \Vert Realm_C \Vert ID_{tgs} \Vert Times \Vert Nonce_1

(2) AS→C: RealmC∥IDC∥Tickettgs∥E(KC,[Kc,tgs∥Times∥Nonce1∥Realmtgs∥IDtgs])\text{(2)}\ AS \rightarrow C:\ Realm_C \Vert ID_C \Vert Ticket_{tgs} \Vert E(K_C, [K_{c,tgs} \Vert Times \Vert Nonce_1 \Vert Realm_{tgs} \Vert ID_{tgs}])

Tickettgs=E(Ktgs,[Flags∥Kc,tgs∥RealmC∥IDC∥ADC∥Times])Ticket_{tgs} = E(K_{tgs}, [Flags \Vert K_{c,tgs} \Vert Realm_C \Vert ID_C \Vert AD_C \Vert Times])

(b) Ticket-granting service exchange:

(3) C→TGS: Options∥IDV∥Times∥Nonce2∥Tickettgs∥AuthenticatorC\text{(3)}\ C \rightarrow TGS:\ Options \Vert ID_V \Vert Times \Vert Nonce_2 \Vert Ticket_{tgs} \Vert Authenticator_C

(4) TGS→C: RealmC∥IDC∥TicketV∥E(Kc,tgs,[Kc,v∥Times∥Nonce2∥RealmV∥IDV])\text{(4)}\ TGS \rightarrow C:\ Realm_C \Vert ID_C \Vert Ticket_V \Vert E(K_{c,tgs}, [K_{c,v} \Vert Times \Vert Nonce_2 \Vert Realm_V \Vert ID_V])

TicketV=E(KV,[Flags∥Kc,v∥RealmC∥IDC∥ADC∥Times])Ticket_V = E(K_V, [Flags \Vert K_{c,v} \Vert Realm_C \Vert ID_C \Vert AD_C \Vert Times])

AuthenticatorC=E(Kc,tgs,[IDC∥RealmC∥TS1])Authenticator_C = E(K_{c,tgs}, [ID_C \Vert Realm_C \Vert TS_1])

(c) Client/server authentication exchange:

(5) C→V: Options∥TicketV∥AuthenticatorC\text{(5)}\ C \rightarrow V:\ Options \Vert Ticket_V \Vert Authenticator_C

(6) V→C: E(Kc,v,[TS2∥Subkey∥Seq#])\text{(6)}\ V \rightarrow C:\ E(K_{c,v}, [TS_2 \Vert Subkey \Vert Seq\#])

AuthenticatorC=E(Kc,v,[IDC∥RealmC∥TS2∥Subkey∥Seq#])Authenticator_C = E(K_{c,v}, [ID_C \Vert Realm_C \Vert TS_2 \Vert Subkey \Vert Seq\#])

New element in version 5Purpose
OptionsOptionsThe client asks for flags in the ticket
RealmCRealm_C, RealmtgsRealm_{tgs}, RealmVRealm_VGive the realm of each party
TimesTimesThe client asks for start, end and renew times
Nonce1Nonce_1, Nonce2Nonce_2Random values that the reply repeats, so the client knows the reply is fresh
FlagsFlagsGive the permitted use of the ticket
SubkeySubkey, Seq#Seq\#Optional session subkey and start sequence number for the session

Kerberos in practiceSearch on YouTube

  • At the time of the slides, there were two versions in use. Version 4 is restricted to a single realm. Version 5 allows inter-realm authentication and was in beta test.
  • Kerberos version 5 is an Internet standard, specified in RFC 1510. Many utilities use it.
  • To use Kerberos, you must have a KDC on your network. You must also have Kerberised applications on all participating systems.
  • The major problem was US export restrictions. Kerberos could not be distributed outside the US directly in source format.
  • Binary versions had to hide the entry points of the crypto routines and have no encryption. Otherwise, users had to reimplement the crypto libraries locally.

Quick self-testSearch on YouTube

Give the three threats that Kerberos addresses.

A user pretends to be another user. A user alters the network address of a workstation. A user eavesdrops on exchanges and uses a replay attack.

Which type of encryption does Kerberos use?

Conventional (symmetric) encryption only. It makes no use of public-key encryption. Version 4 uses DES.

Write the simple authentication dialogue and give its problems.

(1) C→ASC \to AS: IDC∥PC∥IDVID_C \Vert P_C \Vert ID_V. (2) AS→CAS \to C: TicketTicket. (3) C→VC \to V: IDC∥TicketID_C \Vert Ticket, with Ticket=E(KV,[IDC∥PC∥IDV])Ticket = E(K_V, [ID_C \Vert P_C \Vert ID_V]). The password goes in clear, and the user must enter the password for each new service.

Why is the lifetime of the ticket-granting ticket a problem?

If the lifetime is too short, the system repeatedly asks for the password. If it is too long, an opponent has more time to steal the ticket and replay it before it expires.

Write messages 1 to 6 of Kerberos version 4.

(1) IDC∥IDtgs∥TS1ID_C \Vert ID_{tgs} \Vert TS_1. (2) E(KC,[Kc,tgs∥IDtgs∥TS2∥Lifetime2∥Tickettgs])E(K_C, [K_{c,tgs} \Vert ID_{tgs} \Vert TS_2 \Vert Lifetime_2 \Vert Ticket_{tgs}]). (3) IDV∥Tickettgs∥AuthenticatorCID_V \Vert Ticket_{tgs} \Vert Authenticator_C. (4) E(Kc,tgs,[Kc,v∥IDV∥TS4∥TicketV])E(K_{c,tgs}, [K_{c,v} \Vert ID_V \Vert TS_4 \Vert Ticket_V]). (5) TicketV∥AuthenticatorCTicket_V \Vert Authenticator_C. (6) E(Kc,v,[TS5+1])E(K_{c,v}, [TS_5 + 1]).

Why does a stolen ticket not let an attacker get a service?

Each request also needs a new authenticator encrypted with the session key. The authenticator has a recent timestamp and must match IDCID_C and ADCAD_C in the ticket. The attacker does not know the session key.

What is a Kerberos realm?

A set of managed nodes that share the same Kerberos database. The database is on a master system in a physically secure room. All changes are made on the master and need the Kerberos master password.

Give the seven steps of a request for service in another realm.

Request and get a ticket for the local TGS. Request and get a ticket for the remote TGS. Request and get a ticket for the remote server from the remote TGS. Request the remote service.

Give the five areas where version 5 differs from version 4.

Encryption system dependence, Internet protocol dependence, ticket lifetime, authentication forwarding and interrealm authentication.

What do you need to use Kerberos?

A KDC on your network, and Kerberised applications on all participating systems.

  • Kerberos is a centralized authentication service that uses only symmetric encryption. It addresses impersonation, address change and replay.
  • Version 4 has three exchanges: AS (ticket-granting ticket), TGS (service-granting ticket) and client/server. Message 6, E(Kc,v,[TS5+1])E(K_{c,v}, [TS_5 + 1]), gives mutual authentication.
  • Tickets are reusable until they expire. Authenticators are new for each use and stop replay of a stolen ticket.
  • A realm shares one Kerberos database. Kerberos servers in two realms share a key, so a client can get a service in another realm in seven steps.
  • Version 5 removes the DES and IP dependence and adds explicit ticket times, forwarding, better interrealm authentication, nonces, flags and subkeys.