13. Key Establishment

Distribution of cryptographic keys to protect subsequent sessions. In TLS, public keys allow clients/servers to share a new communication key.

Kerberos: key establishment without public keys.

Key Management

Key management has four phases:

Hierarchy

Keys often organized into a hierarchy. In a two-level hierarchy, there are long- and short-term keys:

Key Establishment

Symmetric keys with ciphers (e.g. AES, MAC) are used in practice for session keys as as they are more efficient than public key algorithms.

Long-term keys can be symmetric or asymmetric.

Key Distribution Security Goals

Authentication: they should be able to authenticate that the receiver is the party they intended to send the key to.

Confidentiality: no adversary can obtain the session key accepted by a particular party.

In formal models, the protocol is broken if the adversary can distinguish the session key from a random string.

Mutual and Unilateral Authentication

Mutual authentication: both parties achieve the authentication goal.

Unilateral authentication: only one party achieves the authentication goal. This is done by most real-world key establishment protocols: typically clients authenticate the server with client authentication happening later.

Adversary Capabilities

A strong adversary knows the details of the cryptographic algorithms and can:

Distribution of Pre-Shared Keys

A trusted authority (TA) generates and distributes long-term keys to all users when they join the system. Their involvement ends here in the pre-distribution phase so if there are no new users they can go offline.

A simple scheme is to assign a secret key for each pair of users, but this will not scale well as the number of keys grows quadratically.

Probabilistic schemes reduce key material at each party by forwarding messages to other parties that hopefully have a link to the final receiver. Hence, it offers only a high probability of a secure channel between any two parties and requires other nodes to be trusted as they must decrypt and re-encrypt the message. This is suitable for sensor networks.

Key Distribution using Symmetric Keys

Key distribution with online server.

A TA shares a long-term shared key with each user. They distribute session keys to users when requested and hence, the TA is highly trusted and is a single point of attack. Scalability may also be a problem.

Needham-Schroeder Protocol

Widely-known key establishment protocol published 1978. Found vulnerable to replay attacks in 1981 - attacker can replay old messages that a honest party will accept an old session key.

Notation:

Protocol:

1.AS:IDA,IDB,NA2.SA:{KAB,IDA,IDB,NA,{KAB,IDA,IDB}KBS}KAS3.AB:{KAB,IDA,IDB}KBS,IDA4.BA:{NB}KAB5.AB:{NB1}KAB \begin{aligned} \text{1.}\>& A \to S: \mathrm{ID}_A, \mathrm{ID}_B, N_A \\ \text{2.}\>& S \to A: \left\{ K_{AB}, \mathrm{ID}_A, \mathrm{ID}_B, N_A, \left\{ K_{AB}, \mathrm{ID}_A, \mathrm{ID}_B \right\}_{K_{BS}} \right\}_{K_{AS}} \\ \text{3.}\>& A \to B: \left\{ K_{AB}, \mathrm{ID}_A, \mathrm{ID}_B \right\}_{K_{BS}}, \mathrm{ID}_A \\ \text{4.}\>& B \to A: \{ N_B \}_{K_{AB}} \\ \text{5.}\>& A \to B: \{ N_B - 1 \}_{K_{AB}} \end{aligned}
Replay Attacks

If an attacker CC gets a previous session key KABK'_{AB}, they can masquarade as AA and persuade BB to use the old key (steps 3-5).

To defend against this, the established key must be fresh for each session:

The repaired protocol uses random challenges. After AA establishes request for connection with BB:

1.BA:IDB,NB2.AS:IDA,IDB,NA,NB3.SA:{KAB,IDA,IDB,NA}KAS,{KAB,IDA,IDB,NB}KBS4.AB:{KAB,IDA,IDB,NB}KBS \begin{aligned} \text{1.}\>& B \to A: \mathrm{ID}_B, N_B \\ \text{2.}\>& A \to S: \mathrm{ID}_A, \mathrm{ID}_B, N_A, N_B \\ \text{3.}\>& S \to A: \left\{ K_{AB}, \mathrm{ID}_A, \mathrm{ID}_B, N_A \right\}_{K_{AS}}, \left\{ K_{AB}, \mathrm{ID}_A, \mathrm{ID}_B, N_B \right\}_{K_{BS}} \\ \text{4.}\>& A \to B: \left\{ K_{AB}, \mathrm{ID}_A, \mathrm{ID}_B, N_B \right\}_{K_{BS}} \end{aligned}

Tickets can also be used: if AA wishes to communicate with BB, SS generates ticket {KAB,IDA,IDB,TB}KBS\left\{ K_{AB}, \mathrm{ID}_A, \mathrm{ID}_B, T_B \right\}_{K_{BS}} where TBT_B is a validity period - AA can use the ticket for this duration.

1.AS:IDA,IDB,NA2.SA:{KAB,IDA,IDB,NA}KAS,ticket3.AB:ticket \begin{aligned} \text{1.}\>& A \to S: \mathrm{ID}_A, \mathrm{ID}_B, N_A \\ \text{2.}\>& S \to A: \left\{ K_{AB}, \mathrm{ID}_A, \mathrm{ID}_B, N_A \right\}_{K_{AS}}, \text{ticket} \\ \text{3.}\>& A \to B: \text{ticket} \end{aligned}

Kerberos

Now on V5, released 1995. Standardized as RFC 4120. Used in Windows as the default domain authentication method.

Kerberos allows:

It is a 3-level protocol:

Level 1

Client CC interacts with authentication server ASAS to obtain a ticket-granting ticket at the start of a session.

1.CAS:IDC,IDTGS,N12.ASC:{KC,TGS,IDTGS,N1}KC,ticketTGS \begin{aligned} \text{1.}\> C \to AS&: \mathrm{ID}_C, \mathrm{ID}_{TGS}, N_1 \\ \text{2.}\> AS \to C&: \left\{ K_{C, TGS}, \mathrm{ID}_{TGS}, N_1 \right\}_{K_{C}}, \text{ticket}_{TGS} \end{aligned}

Where:

At the end of this exchange, CC has a ticket-granting ticket that can be used to obtain different service-granting tickets from the ticket-granting server.

Level 2

Client CC interacts with ticket granting server TGSTGS:

1.CTGS:IDV,N2,ticketTGS,authenticatorTGS2.TGSC:IDC,ticketV,{KC,V,N2,IDV}KC,TGS \begin{aligned} \text{1.}\> C \to TGS&: \mathrm{ID}_V, N_2, \text{ticket}_{TGS}, \text{authenticator}_{TGS} \\ \text{2.}\> TGS \to C &: \mathrm{ID}_C, \text{ticket}_V, \{ K_{C, V}, N_2, \mathrm{ID}_V \}_{K_{C, TGS}} \end{aligned}

Where:

The ticket-granting server must also check that the client has permission to access the service VV.

In practice, the AS and TGS are the same machine.

Level 3

Client CC interacts with application server VV:

1.CV:ticketV,authenticatorV2.VC:{TS2}KC,V \begin{aligned} \text{1.}\> C \to V&: \text{ticket}_V, \text{authenticator}_V \\ \text{2.}\> V \to C&: \left\{ TS_2 \right\}_{K_{C, V}} \end{aligned}

Where:

The reply from VV is intended to provide mutual authentication, allowing CC to verify they are talking to the right VV.

Limitations

Realms (domains over which an authentication server has authority to authenticate a user) must share keys with every other realm, so although multiple realms are supported it has limited scalability.

KCK_{C} is derived from the user’s password, so offline password guessing is possible.

Key Distribution using Asymmetric Cryptography

No online TA is required. Instead, public keys (managed by PKI - certificates and CAs) is used for authentication. Users are trusted to generate good session keys (so hopefully each party has a good PRNG).

Key transport: user chooses key material and sends it to another party (encrypted, possibly signed). Does NOT provide forward secrecy.

Key agreement: Diffie-Hellman or some other protocol where both parties provide input to the key. The messages are signed, providing authentication. Provides forwards secrecy.

TLS supports both key transport and agreement.

Forward Secrecy

If a long-term key is compromised, the attacker can now claim to be the owner of the key. If key transport is used, all previous session keys will be compromised.

A protocol provides (perfect) forwards secrecy if compromise of the long-term secret keys do not reveal session keys previously agreed using the long-term keys.

Signed Diffie-Hellman

Computations done in Zp\mathbb{Z}_p^*. Notation:

Protocol:

  1. AA sends IDA\mathrm{ID}_A, gag^a
  2. BB sends IDB\mathrm{ID}_B, gbg^b and SignB(IDAIDAgbga)\mathrm{Sign}_B(\mathrm{ID}_A \| \mathrm{ID}_A \| g^b || g^a)
    • AA checks signature. If valid, computes session key KAB=(gb)a=gabK_{AB} = (g^b)^a = g^{ab}
  3. A sends SignB(IDAIDBgagb)\mathrm{Sign}_B(\mathrm{ID}_A \| \mathrm{ID}_B \| g^a || g^b)
    • BB checks signature. If valid, computes session key KAB=(ga)b=gabK_{AB} = (g^a)^b = g^{ab}