Station-to-Station protocol


In public-key cryptography, the Station-to-Station protocol is a cryptographic key agreement scheme. The protocol is based on classic Diffie–Hellman, and provides mutual key and entity authentication. Unlike the classic Diffie–Hellman, which is not secure against a man-in-the-middle attack, this protocol assumes that the parties have signature keys, which are used to sign messages, thereby providing security against man-in-the-middle attacks.
In addition to protecting the established key from an attacker, the STS protocol uses no timestamps and provides perfect forward secrecy. It also entails two-way explicit key confirmation, making it an authenticated key agreement with key confirmation protocol.
STS was originally presented in 1987 in the context of ISDN security, finalized in 1989 and generally presented by Whitfield Diffie, Paul C. van Oorschot and Michael J. Wiener in 1992. The historical context for the protocol is also discussed in.

Description

Deployment of STS can take different forms depending on communication requirements and the level of prior communication between parties. The data described in [|STS Setup] may be shared prior to the beginning of a session to lessen the impact of the session's establishment.
In the following explanations, exponentiation operations provide the basis for key agreement, though this is not a requirement. The protocol may be modified, for example, to use elliptic curves instead.

STS Setup

The following data must be generated before initiating the protocol.
Sharing this data prior to the beginning of the session lessens the complexity of the protocol.

Basic STS

Supposing all setup data has been shared, the STS protocol proceeds as follows. If a step cannot be completed, the protocol immediately stops. All exponentials are in the group specified by p.
  1. Alice generates a random number x and computes and sends the exponential gx to Bob.
  2. Bob generates a random number y and computes the exponential gy.
  3. Bob computes the shared secret key K = y.
  4. Bob concatenates the exponentials , signs them using his asymmetric key B, and then encrypts the signature with K. He sends the ciphertext along with his own exponential gy to Alice.
  5. Alice computes the shared secret key K = x.
  6. Alice decrypts and verifies Bob's signature using his asymmetric public key.
  7. Alice concatenates the exponentials , signs them using her asymmetric key A, and then encrypts the signature with K. She sends the ciphertext to Bob.
  8. Bob decrypts and verifies Alice's signature using her asymmetric public key.
Alice and Bob are now mutually authenticated and have a shared secret. This secret, K, can then be used to encrypt further communication. The basic form of the protocol is formalized in the following three steps:
Alice → Bob : gx
Alice ← Bob : gy, EK
Alice → Bob : EK

[|Full STS]

Setup data can also be incorporated into the protocol itself. Public key certificates may be sent in steps 2 and 3 if the keys are not known in advance.
Alice → Bob : gx
Alice ← Bob : gy, CertB, EK
Alice → Bob : CertA, EK
If system-wide key establishment parameters are not used, the initiator and responder may create and send their own parameters. In this case, parameters should be sent with the exponential.
Alice → Bob : g, p, gx
They must also be verified by Bob to prevent an active attacker from inserting weak parameters. recommend against special checks to prevent this and instead suggest including the group parameters in Alice's certificate.

Variations

The variations mentioned here are from the original STS paper. See the following references for other, more significant variations.
A simplified form of STS is available that provides mutual authentication but does not produce a shared secret. It uses random number challenges instead of the above Diffie–Hellman technique.
  1. Alice generates a random number x sends it to Bob.
  2. Bob generates a random number y.
  3. Bob concatenates the random numbers and signs them using his asymmetric key B. He sends the signature along with his own random number to Alice.
  4. Alice verifies Bob's signature.
  5. Alice concatenates the random numbers and signs them using her asymmetric key A. She sends the signature to Bob.
  6. Bob verifies Alice's signature.
Formally:
Alice → Bob : x
Alice ← Bob : y, SB
Alice → Bob : SA
This protocol can be extended to include certificates as in Full STS.

STS-MAC

In cases where encryption is a not viable choice in session establishment, K can instead be used to create a MAC.
Alice → Bob : gx
Alice ← Bob : gy, SB, MACK
Alice → Bob : SA, MACK
note that this variation may be preferable to original STS in any case because
The paper goes on to counsel, however, that using K for both a MAC and as the session key violates the principle that keys should not be used for more than one purpose, and presents various workarounds.

Cryptanalysis

STS-MAC is vulnerable to some unknown key-share attacks, whereby an active attacker can inject his own identity into the session establishment procedure in place of either initiator or responder. present the vulnerabilities and some solutions.