Key exchange

A key exchange (or key agreement) protocol allows two parties communicating over a public, authenticated channel to establish a shared secret key that is computationally indistinguishable from uniformly random to any eavesdropper.

Syntax

A two-party key exchange protocol is a pair of interactive algorithms , run by parties and on input over a public channel. An execution outputs keys to and ; its transcript is the sequence of all messages sent.

The key space is a finite set determined by and the transcript, such as a group whose description one party sends, and it is the same set for every transcript when it depends on alone. It has at least two elements: for every and every transcript . On a one-element key space the uniform key equals , so every protocol, including one in which the parties send nothing, would be secure — standard.

Properties

Correctness

A key exchange protocol is -correct, for a function , if for all ,

over the randomness of both parties in . When , is perfectly correct.

Security (indistinguishability from random)

The adversary sees the transcript of an honest execution, in which and output keys and , and must distinguish from a uniform key.

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{ke}}_{\Pi,\calA}(\secpar)$}
\begin{algorithmic}
\State $(\tau, k_A, k_B) \gets \langle \mathsf{KE}_A(1^\secpar), \mathsf{KE}_B(1^\secpar) \rangle$; $b \getsr \bits$
\State $k_0 := k_A$; $k_1 \getsr \calK_\tau$
\State $b' \gets \calA(1^\secpar, \tau, k_b)$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}

A key exchange protocol is secure if for all efficient ,

is negligible.

As an object, KE denotes a protocol, with and PPT, that is -correct for a negligible function and secure. Without correctness, the protocol in which and output independent uniform keys and send nothing is secure.

One-way security

The adversary sees the transcript of an honest execution and must output ‘s key.

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{ow\text{-}ke}}_{\Pi,\calA}(\secpar)$}
\begin{algorithmic}
\State $(\tau, k_A, k_B) \gets \langle \mathsf{KE}_A(1^\secpar), \mathsf{KE}_B(1^\secpar) \rangle$
\State $k' \gets \calA(1^\secpar, \tau)$
\Return $[k' = k_A]$
\end{algorithmic}
\end{algorithm}

A key exchange protocol is one-way secure if for all efficient ,

is negligible.

The game asks for . For a -correct protocol, asking for instead changes the advantage of every by at most , so the choice does not matter when is negligible — standard. One-way security forces a large key space: if uniform elements of can be sampled efficiently given , the adversary that outputs one wins with probability , so in a one-way-secure protocol is negligible for every polynomial , and no protocol whose key space has polynomial size, such as , is one-way secure — standard.

Security in the indistinguishability game gives one-way security when is negligible: for an adversary outputting , the distinguisher that outputs exactly when has advantage at least — standard. The converse fails: if CDH is hard for a group generator outputting the groups for odd primes , the Diffie–Hellman key is one-way, but its Legendre symbol is determined by those of and , while that of a uniform element of is a uniform sign, so an eavesdropper tells the key from a uniform element with advantage — standard.

As a node, one-way KE denotes a protocol, with and PPT, that is -correct for a negligible function and one-way secure. Without correctness, the protocol in which outputs a uniform key in and sends nothing is one-way secure. Under CDH, the Diffie–Hellman protocol is one-way secure, with one-way advantage equal to the CDH advantage (CDH ⇒ One-way KE (Diffie–Hellman)) — folklore.

Variations

Non-interactive key exchange (NIKE)

A NIKE allows any two parties to derive the same shared key, each from its own secret key and the other’s public key, with no interaction at all. Diffie-Hellman over a cyclic group is the canonical example: given public keys and (DDH ⇒ Non-interactive key exchange (NIKE)) — DH76.

A NIKE is a tuple of efficient algorithms with a key space , which may depend on , has at least two elements for every , and from which uniform elements can be sampled efficiently:

  • , a randomized algorithm generating public parameters common to all parties, with when there is no setup;
  • , a randomized algorithm generating a party’s key pair;
  • , a deterministic algorithm taking a party’s secret key and another party’s public key and outputting a shared key or .

A NIKE is -correct, for a function , if for all ,

over and independent . When , is perfectly correct.

Security for honest key pairs

The adversary sees the public parameters and two honestly generated public keys, and must distinguish their shared key from a uniform key.

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{nike}}_{\Pi,\calA}(\secpar)$}
\begin{algorithmic}
\State $\pp \gets \Setup(1^\secpar)$; $b \getsr \bits$
\State $(\pk_1, \sk_1) \gets \Gen(\pp)$; $(\pk_2, \sk_2) \gets \Gen(\pp)$
\State $k_0 := \Combine(\sk_1, \pk_2)$; $k_1 \getsr \calK$
\State $b' \gets \calA(\pp, \pk_1, \pk_2, k_b)$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}

A NIKE is secure if for all efficient ,

is negligible.

As a node, NIKE denotes a NIKE that is -correct for a negligible function and secure for honest key pairs.

CKS models

FHKP13 define stronger models, building on the model of CKS08, in which the adversary interacts with many parties named by identities, which and take as additional inputs. In the CKS-light model the adversary may register honest identities, whose key pairs the challenger generates and whose public keys it returns; register corrupt identities with public keys of its choice; obtain the key an honest identity shares with a corrupt one; and make one query on two honest identities, answered with their shared key () or a uniform key () — FHKP13. The heavier models of FHKP13, among them CKS-heavy, add queries that reveal keys shared by two honest identities and secret keys of honest identities outside the tested pairs, and allow several queries; security in CKS-light implies security in each of them, with a polynomial loss — FHKP13. Each model comes in a version with dishonest key registration, in which the adversary registers arbitrary public keys for corrupt identities, and one with honest key registration, in which it cannot — FHKP13.

CKS08 give a twinned variant of the Diffie–Hellman NIKE and prove it secure under CDH in the random-oracle model against adversaries that also obtain the keys honest parties share with public keys of the adversary’s choice; their trapdoor test answers these queries without a DDH oracle.

Authenticated key exchange (AKE)

An authenticated key exchange (AKE) protocol lets parties holding long-term key pairs establish session keys over a network the adversary controls: many sessions run concurrently, and the key of a session between two uncorrupted parties is pseudorandom to the adversary, even given the keys of all other sessions. In a PAKE the parties authenticate each other with a shared password drawn from a possibly small dictionary.

The model below is that of BR93a in the public-key setting of BJM97. For every polynomial , there is a set of parties, and an AKE protocol consists of:

  • , a randomized algorithm generating a party’s long-term key pair;
  • the stateful interactive algorithm run by each instance , , of a party , on input and . An instance is started either as an initiator, with an intended peer, or as a responder. It processes incoming messages and eventually either rejects or accepts, outputting a partner identity , a session identity and a session key , for a finite key space of at least two elements.

Two instances are partners if one is an initiator and the other a responder, both accepted with the same , each one’s names the other’s party, and no other instance accepted with that . This is the partnering by session identities of BPR00 without its requirement that partners hold the same session key, which the security definition below imposes separately; BR93a partner instances by matching conversations.

BR93a formulate the model for parties that share long-lived symmetric keys, and in that setting give an AKE protocol from any PRF. With long-term key pairs, as here, an AKE protocol gives a key exchange secure against eavesdroppers (AKE ⇒ KE) — folklore.

Correctness. If the messages between an initiator instance of with intended peer and a responder instance of are delivered unchanged, both instances accept, are partners, and output the same session key, except with negligible probability.

Key indistinguishability

The adversary controls all communication through the , and oracles of BR93a, and learns long-term keys through a oracle as in BPR00:

  • delivers the message to and returns the instance’s reply and whether it has accepted or rejected; the message starts as an initiator with intended peer , and any other first message starts it as a responder;
  • returns the session key of if it has accepted;
  • returns ;
  • returns, according to a hidden bit , the session key of () or a uniform key ().

An instance is fresh if it has accepted with , no query was made to it or to a partner of it, and neither nor was corrupted. is admissible if it makes exactly one query, to an instance that is fresh at the end of the game: revealing the tested instance or a partner hands the key, and lets impersonate to . Forward secrecy relaxes the restriction on corruptions.

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{ake}}_{\Pi,\calA}(\secpar)$}
\begin{algorithmic}
\State $(\pk_U, \sk_U) \gets \KeyGen(1^\secpar)$ for every $U \in \calU$; $b \getsr \bits$
\State $b' \gets \calA^{\mathsf{Send}, \mathsf{Reveal}, \mathsf{Corrupt}, \mathsf{Test}}(1^\secpar, (\pk_U)_{U \in \calU})$
\Comment{Admissible: one $\mathsf{Test}$ query, to an instance fresh at the end}
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\algname{Oracle}
\caption{$\mathsf{Test}(U, i)$}
\begin{algorithmic}
\If{$\Pi^i_U$ has not accepted}
\Return $\bot$
\EndIf
\State $K_0 :=$ the session key of $\Pi^i_U$; $K_1 \getsr \calK$
\Return $K_b$
\end{algorithmic}
\end{algorithm}

An AKE protocol is secure if for all efficient the probability that two partners of uncorrupted parties accept with different session keys is negligible, and for all efficient admissible ,

is negligible.

As a node, AKE denotes a protocol, with and the instances PPT, that is correct, as defined above, and secure in the key-indistinguishability game; mutual authentication, forward secrecy, KCI resistance and SK-security in the CK and eCK models are separate notions.

Mutual authentication

The conversation of an instance is the sequence of messages it has received and sent, in order. An instance has a conversation matching that of if received exactly the messages sent and sent exactly the messages received, in the same interleaving, except that if sent the last message of the protocol, need not have received it — BR93a. The exception lets the instance sending the last message accept although the adversary may never deliver it.

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{ma}}_{\Pi,\calA}(\secpar)$}
\begin{algorithmic}
\State $(\pk_U, \sk_U) \gets \KeyGen(1^\secpar)$ for every $U \in \calU$
\State run $\calA^{\mathsf{Send}, \mathsf{Reveal}, \mathsf{Corrupt}}(1^\secpar, (\pk_U)_{U \in \calU})$
\Return $1$ if some $\Pi^i_U$ accepted with $\mathit{pid} = V$, neither $U$ nor $V$ is corrupted, and no instance of $V$ that was started with intended peer $U$, or as a responder that has not accepted or has accepted with $\mathit{pid} = U$, has a conversation matching that of $\Pi^i_U$; else $0$
\end{algorithmic}
\end{algorithm}

Following BR93a, provides mutual authentication if delivering unchanged the messages between an initiator instance of with intended peer and a responder instance of makes both accept, and for all efficient ,

is negligible.

Forward secrecy

has forward secrecy (or perfect forward secrecy) if it remains secure when freshness allows and after the tested instance has accepted: long-term keys leaked later do not expose earlier session keys. It has weak forward secrecy if this holds whenever moreover has a partner, so that the adversary did not actively interfere with the session — a notion introduced by Kra05. In a two-message protocol whose initiator sends only an ephemeral value , such as HMQV, the adversary can send its own in ‘s name, let accept, corrupt , and compute ‘s session key as would: such protocols have at most weak forward secrecy — Kra05.

resists key-compromise impersonation (KCI) if it remains secure when freshness allows at any time: does not let the adversary impersonate other parties to .

Canetti–Krawczyk model

In the model of CK01, a party is activated to run a session , as initiator or responder, with peer and a session identifier that the calling protocol supplies and that is unique among ‘s sessions; sessions and are matching. Besides activations and one test-session query, the adversary may reveal the internal state of an incomplete session, such as its ephemeral exponents, but not the long-term key; reveal session keys; and corrupt parties, learning a party’s entire memory, including its long-term key and session states, and taking control of the party. A completed session is exposed if it or its matching session had its state or key revealed, or if its owner or peer was corrupted. A protocol is SK-secure if for all efficient , two uncorrupted parties that complete matching sessions output the same key except with negligible probability, and guesses the test bit for an unexposed test session with probability at most — CK01. For forward secrecy, a session-expiration query erases a session’s key, and corrupting a party after a session expired does not expose that session — CK01.

The keys of an SK-secure protocol, used with a MAC and a symmetric encryption scheme, give secure channels in the sense of CK01. The authenticators of BCK98 preserve SK-security, so a protocol that is SK-secure when links are authenticated (the authenticated-links model) compiles into one that is SK-secure when the adversary controls the links; in the authenticated-links model, the basic Diffie–Hellman protocol is SK-secure under DDH — CK01.

Extended Canetti–Krawczyk model

The eCK model of LLM07 treats two-message protocols in which each party holds a static key pair and each session an ephemeral key pair; a session is identified by its owner, its peer and the two messages, and matches the peer’s session with the same messages. The adversary may reveal session keys, the ephemeral secret keys of sessions and the static secret keys of parties. A completed test session of with peer is fresh if neither it nor its matching session had its key revealed, the adversary did not learn both ‘s static key and the test session’s ephemeral key, and, if the matching session exists, did not learn both ‘s static key and that session’s ephemeral key, or, if it does not exist, did not learn ‘s static key — LLM07. eCK security thus covers key-compromise impersonation, weak forward secrecy and leakage of ephemeral keys — LLM07.

NAXOS, whose ephemeral exponent is a hash of the session’s ephemeral secret key and the party’s static secret key, is eCK-secure under the gap Diffie–Hellman assumption (CDH is hard given a DDH oracle) in the random-oracle model — LLM07. The CK and eCK models are formally incomparable — Cre11.

Key exchange with bit-string keys

A two-party key exchange whose key space is for a polynomial-time computable with . As a node, it denotes such a protocol, with PPT parties, that is -correct for a negligible function and secure against eavesdroppers. It is a key exchange (KE with bit-string keys ⇒ KE) — folklore, and an IND-CPA-secure KEM gives it (KEM ⇒ KE with bit-string keys) — folklore. In the random oracle model, hashing the Diffie–Hellman key to bits gives it under CDH (CDH ⇒ KE with bit-string keys (hashed Diffie–Hellman)) — folklore. Its keys can serve as one-time pads under , which an arbitrary finite key space does not support: for a uniform key on a three-element space encoded as , XOR-padding gives the support and padding gives , so the padded string reveals the padded value with constant advantage — standard.

Multi-party key exchange

For , an -party key exchange protocol is a tuple of interactive algorithms with a key space of at least two elements, run by parties on input over a public, authenticated broadcast channel. An execution outputs a key to each ; its transcript is the sequence of all messages broadcast. is -correct, for a function , if for all , over the randomness of all parties.

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{mke}}_{\Pi,\calA}(\secpar)$}
\begin{algorithmic}
\State $(\tau, k_1, \ldots, k_n) \gets \langle \mathsf{KE}_1(1^\secpar), \ldots, \mathsf{KE}_n(1^\secpar) \rangle$; $b \getsr \bits$
\State $K_0 := k_1$; $K_1 \getsr \calK$
\State $b' \gets \calA(1^\secpar, \tau, K_b)$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}

is secure if for all efficient ,

is negligible. As a node, multi-party key exchange denotes, for every polynomial , an -party protocol, with PPT parties, that is -correct for a negligible function and secure. Two-party key exchange with bit-string keys gives it (KE with bit-string keys ⇒ Multi-party key exchange) — folklore, and its case is a two-party key exchange (Multi-party key exchange ⇒ KE) — folklore.

The protocol of Burmester and Desmedt takes two rounds for every — BD94, KY03. KY03 prove a variant of it secure against eavesdroppers and give a compiler that adds one round and turns any group key exchange secure against eavesdroppers into an authenticated one, secure against an adversary that controls all communication; applied to that variant, the compiler gives a three-round authenticated group key exchange with forward secrecy, secure under DDH in the standard model.

Multiparty non-interactive key exchange

For , an -party NIKE is a tuple of efficient algorithms with a key space , which may depend on and has at least two elements for every :

  • , a randomized algorithm generating public parameters, with when there is no setup;
  • , a randomized algorithm run by party , which publishes and keeps ;
  • , an algorithm outputting party ‘s key .

is -correct, for a function , if for all , for , over and independent for .

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{mnike}}_{\Pi,\calA}(\secpar)$}
\begin{algorithmic}
\State $\pp \gets \Setup(1^\secpar, 1^N)$; $b \getsr \bits$
\State $(\mathit{msg}_i, \sk_i) \gets \mathsf{Publish}(\pp, i)$ for every $i \in [N]$
\State $K_0 \gets \mathsf{KeyDer}(\pp, 1, \sk_1, (\mathit{msg}_j)_{j \ne 1})$; $K_1 \getsr \calK$
\State $b' \gets \calA(\pp, \mathit{msg}_1, \ldots, \mathit{msg}_N, K_b)$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}

is secure if for all efficient ,

is negligible. As a node, multiparty NIKE denotes, for every polynomial , an -party NIKE that is -correct for a negligible function and secure. For and a that ignores , the syntax is that of a two-party NIKE. iO and one-way functions give multiparty NIKE, for every polynomial fixed in advance and without trusted setup (iO + OWF ⇒ Multiparty NIKE (Boneh–Zhandry)) — BZ14.

Three-party NIKE

A three-party NIKE is an -party NIKE, as defined above, for ; as a node, it denotes a three-party NIKE that is -correct for a negligible function and secure. Multiparty NIKE gives it as the case (Multiparty NIKE ⇒ Three-party NIKE) — folklore, and it gives a two-party key exchange (Three-party NIKE ⇒ KE) — folklore.

Other results

  • DDH ⇒ NIKE
  • NIKE ⇒ PKE
  • No relativizing reduction from OWP to KE — IR89
  • In the random oracle model, Merkle’s puzzles is a key agreement in which each honest party makes oracle queries and every eavesdropper that recovers the key with constant probability makes queries (ROM ⇒ Merkle puzzles) — Mer78. The quadratic gap is optimal, so no random-oracle key agreement is secure against eavesdroppers making polynomially many queries (No reduction from ROM to KE) — BM09.
  • LWE with polynomial ratio ⇒ CPA-secure PKE (Regev)
  • PKE ⇒ KE
  • BCK98 define the authenticated-links and unauthenticated-links models and authenticators, compilers that turn a protocol secure in the first into one secure in the second; they build authenticators from signatures, from public-key encryption and from pre-shared MAC keys, and apply them to Diffie–Hellman key exchange.
  • In the SIGMA (“SIGn-and-MAc”) protocols of Kra03, the parties exchange Diffie–Hellman values and ; each signs both values and MACs its own identity under a key derived from , from which the session key is also derived. SIGMA underlies the signature-based key exchange of IKE — Kra03. CK02 prove SIGMA and IKE’s signature-based protocols SK-secure in the CK model, adapted to sessions whose peer is learned during the run, under DDH and the security of the signature scheme, the MAC and the key derivation.
  • HMQV, a hashed variant of the MQV protocol of LMQSV03, is a two-message protocol: , with static key pair , sends , and , with , sends ; with and , both compute and the session key — Kra05. As originally posted, with and modeled as random oracles, HMQV was claimed secure in the CK model under CDH, with some further properties under the gap Diffie–Hellman assumption and KEA1 — Kra05. That claim fails for the protocol as stated, which does not check that , and the static public keys lie in the intended prime-order group; the revised Kra05 requires each party to verify that the Diffie–Hellman values it receives are non-identity elements of that group, and its security claims are for this validated protocol. Kra05 also gives attacks on MQV in the CK model.
  • Men05 gives attacks on the unvalidated HMQV in the CK model that recover a victim’s static secret key, by sending elements of small order and enumerating the revealed session keys over the small subgroup, and identifies flaws in the original security proof of Kra05; it proposes a patched variant, HMQV-1.

Participates in

Builds on Key exchange

Produces Key exchange

Barriers