Key encapsulation mechanism
A key encapsulation mechanism (KEM) is a public-key primitive that allows a sender to encapsulate a fresh uniformly random symmetric key into a ciphertext using a public key , such that only the holder of the secret key can recover by decapsulation. Combined with a data encapsulation mechanism (DEM), a SKE scheme keyed by the encapsulated key, a KEM gives KEM-DEM hybrid encryption.
Syntax
A KEM is a tuple of efficient algorithms with key space :
- is a randomized algorithm that generates a public/secret key pair.
- is a randomized algorithm that takes a public key and outputs a ciphertext and a symmetric key .
- is a deterministic algorithm that recovers the symmetric key from the ciphertext, or outputs .
Every KEM on this page is -correct, as defined under Correctness, for a negligible function , its key space is for a polynomial-time computable with , and its encapsulated key is uniform: for and , is uniform on , over the random oracle too for a KEM in the random oracle model. Without correctness, the scheme with for a uniform and a constant meets every notion below. With , so does a scheme with a fixed key. The KEM-DEM hybrid needs a uniform key for its correctness: its DEM is correct for keys drawn by its own key generation, which the encapsulated key replaces (IND-CPA KEM + SKE ⇒ IND-CPA PKE). The Diffie–Hellman KEM, which encapsulates under the key as , has keys in a group rather than in ; hashing the group element into with a random oracle gives a KEM of this syntax, hashed ElGamal (CDH ⇒ IND-CPA KEM (hashed ElGamal)). As an object, KEM denotes a correct KEM with the key space and key distribution above; its security notions are the variants IND-CCA and IND-CPA.
Properties
Correctness
A KEM is -correct if for all ,
over and . When , the KEM is perfectly correct.
IND-CCA security
The adversary receives , a challenge encapsulation and either the key it encapsulates or an independent uniform key , may have any ciphertext other than decapsulated, and guesses which key it was given.
\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{cca}}_{\mathrm{KEM},\calA}(\secpar)$}
\begin{algorithmic}
\State $(\pk, \sk) \gets \KeyGen(1^\secpar)$
\State $(c^*, k_0) \gets \Encap(\pk)$
\State $k_1 \getsr \calK$
\State $b \getsr \bits$
\State $b' \gets \calA^{\Decap(\sk, \cdot)}(\pk, c^*, k_b)$
\Comment{$\calA$ may not query $\Decap$ on $c^*$}
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}
A KEM is IND-CCA secure if for all efficient that do not query on ,
is negligible. The restriction is necessary: except with probability , so one query on reveals — standard. KEMs were introduced by Cramer and Shoup as the asymmetric part of hybrid encryption — Sho01b, CS03, as credited by ABC+25 (Section 2.1); PSJS24 (Sections I and III) credit CS03 with formalizing their security. The game is the IND-CCA experiment of ABC+25 (Section 2.3, Figure 3), with the same restriction on ; the literature also calls it IND-CCA2 (ABC+25, Section 2.3).
KEM-DEM hybrid encryption
Given a KEM with key space and a DEM, an SKE scheme keyed by uniform -bit keys, the hybrid PKE scheme has the KEM’s and
- : run ; run ; output .
- : run ; output if , and otherwise.
If the KEM is IND-CCA secure and the DEM is a one-time CCA-secure SKE scheme, CCA-secure against an adversary that sees a single challenge encryption, the hybrid is IND-CCA secure (IND-CCA KEM + one-time CCA-secure SKE ⇒ IND-CCA PKE) — CS03, as credited by PSJS24 (Section I). One-time security suffices because each encapsulated key encrypts one message. An IND-CPA DEM does not suffice: with CTR mode as DEM, flips a bit in the masked part of , queries on for the result , and receives with that bit flipped (No fixed-construction reduction from length-preserving PRF to CCA-secure SKE (randomized CTR)) — standard; HHK10 study which KEM/DEM notion pairs suffice.
Variations
IND-CPA KEM
The adversary receives , a challenge encapsulation and either the key it encapsulates or an independent uniform key , and guesses which.
\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{cpa}}_{\mathrm{KEM},\calA}(\secpar)$}
\begin{algorithmic}
\State $(\pk, \sk) \gets \KeyGen(1^\secpar)$
\State $(c^*, k_0) \gets \Encap(\pk)$
\State $k_1 \getsr \calK$
\State $b \getsr \bits$
\State $b' \gets \calA(\pk, c^*, k_b)$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}
A KEM is IND-CPA secure if for all efficient ,
is negligible. The game is the IND-CCA game without the decapsulation oracle, so IND-CCA security implies IND-CPA security (IND-CCA security ⇒ IND-CPA KEM).
Lattice-based KEM (Kyber / ML-KEM)
Kyber is an IND-CCA KEM from Module LWE: a variant of the Fujisaki–Okamoto transform turns a CPA-secure public-key encryption scheme over module lattices into a CCA-secure KEM — BDK+18 (Module LWE ⇒ IND-CCA KEM). ML-KEM, standardized by NIST in FIPS 203, is derived from the round-three CRYSTALS-Kyber submission, a scheme first described in BDK+18. It applies a Fujisaki–Okamoto transform with implicit rejection to the encryption scheme K-PKE, which is not IND-CCA2-secure and is approved only as a component of ML-KEM — NIST24 (Sections 1.1, 3.2, 3.3 and 6).
K-PKE
K-PKE works over with and , at module rank . draws each of the coefficients independently from the centered binomial distribution, as for and sums of uniform bits. For , maps to and maps back, both coefficientwise, where rounds to the nearest integer with ties rounded up; a message is the polynomial whose coefficients are its bits. is SHA3-512 with its output split into two 256-bit halves, is SHA3-256, is SHAKE256 with 256-bit output, is expanded from a 256-bit seed by SHAKE128, and the small elements are sampled from coins for a counter — NIST24 (Sections 2.3, 4.1, 4.2 and 5). The pseudocode shows the ring operations, which FIPS 203 carries out in the number-theoretic-transform domain, and omits the byte encodings.
\begin{algorithm}
\algname{Algorithm}
\caption{$\mathrm{K\text{-}PKE}.\KeyGen(d)$}
\begin{algorithmic}
\State $(\rho, \sigma) \gets G(d \,\|\, k)$
\Comment{$d \in \bits^{256}$}
\State $\mathbf{A} \gets \mathrm{SHAKE128}(\rho) \in R_q^{k \times k}$
\Comment{Rejection sampling in the NTT domain}
\State $\mathbf{s} \gets D_{\eta_1}(R_q)^k$ ; $\mathbf{e} \gets D_{\eta_1}(R_q)^k$
\Comment{Coins $\PRF(\sigma, \cdot)$}
\State $\mathbf{t} \gets \mathbf{A}\mathbf{s} + \mathbf{e}$
\Return $(\pk, \sk) := ((\mathbf{t}, \rho), \mathbf{s})$
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\algname{Algorithm}
\caption{$\mathrm{K\text{-}PKE}.\Enc(\pk, m; r)$}
\begin{algorithmic}
\State $(\mathbf{t}, \rho) \gets \pk$ ; $\mathbf{A} \gets \mathrm{SHAKE128}(\rho)$
\State $\mathbf{y} \gets D_{\eta_1}(R_q)^k$ ; $\mathbf{e}_1 \gets D_{\eta_2}(R_q)^k$ ; $e_2 \gets D_{\eta_2}(R_q)$
\Comment{Coins $\PRF(r, \cdot)$}
\State $\mathbf{u} \gets \mathbf{A}^\top \mathbf{y} + \mathbf{e}_1$
\State $v \gets \mathbf{t}^\top \mathbf{y} + e_2 + \mathrm{Decompress}_1(m)$
\Return $c := (\mathrm{Compress}_{d_u}(\mathbf{u}), \mathrm{Compress}_{d_v}(v))$
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\algname{Algorithm}
\caption{$\mathrm{K\text{-}PKE}.\Dec(\sk, c)$}
\begin{algorithmic}
\State $(c_1, c_2) \gets c$
\State $\mathbf{u}' \gets \mathrm{Decompress}_{d_u}(c_1)$ ; $v' \gets \mathrm{Decompress}_{d_v}(c_2)$
\State $w \gets v' - \mathbf{s}^\top \mathbf{u}'$
\Return $m := \mathrm{Compress}_1(w)$
\end{algorithmic}
\end{algorithm}
Write and , with and the rounding errors of compression followed by decompression. Then , and returns bit of whenever coefficient of , as an integer in , lies in — standard.
ML-KEM
\begin{algorithm}
\algname{Algorithm}
\caption{$\mathrm{ML\text{-}KEM}.\KeyGen()$}
\begin{algorithmic}
\State $d \getsr \bits^{256}$ ; $z \getsr \bits^{256}$
\State $(\pk, \sk') \gets \mathrm{K\text{-}PKE}.\KeyGen(d)$
\Return $(\pk, \sk) := (\pk, (\sk', \pk, H(\pk), z))$
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\algname{Algorithm}
\caption{$\mathrm{ML\text{-}KEM}.\Encap(\pk)$}
\begin{algorithmic}
\State $m \getsr \bits^{256}$
\State $(K, r) \gets G(m \,\|\, H(\pk))$
\State $c \gets \mathrm{K\text{-}PKE}.\Enc(\pk, m; r)$
\Return $(c, K)$
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\algname{Algorithm}
\caption{$\mathrm{ML\text{-}KEM}.\Decap(\sk, c)$}
\begin{algorithmic}
\State $(\sk', \pk, h, z) \gets \sk$
\State $m' \gets \mathrm{K\text{-}PKE}.\Dec(\sk', c)$
\State $(K', r') \gets G(m' \,\|\, h)$ ; $\bar{K} \gets J(z \,\|\, c)$
\If{$c \ne \mathrm{K\text{-}PKE}.\Enc(\pk, m'; r')$}
\State $K' \gets \bar{K}$
\Comment{Implicit rejection}
\EndIf
\Return $K'$
\end{algorithmic}
\end{algorithm}
Decapsulation returns whenever K-PKE decryption returns , since re-encryption with then reproduces — standard. Unlike the transform of IND-CPA PKE ⇒ IND-CCA KEM (Fujisaki–Okamoto), whose key is , ML-KEM derives the key and the encryption coins together from and , and rejects implicitly with . The approved parameter sets all have , and a 256-bit shared key — NIST24 (Section 8, Tables 1–3):
| Parameter set | Claimed security category | (bytes) | (bytes) | Decapsulation failure rate | |||||
|---|---|---|---|---|---|---|---|---|---|
| ML-KEM-512 | 2 | 3 | 2 | 10 | 4 | 1 | 800 | 768 | |
| ML-KEM-768 | 3 | 2 | 2 | 10 | 4 | 3 | 1184 | 1088 | |
| ML-KEM-1024 | 4 | 2 | 2 | 11 | 5 | 5 | 1568 | 1568 |
The decapsulation failure rate is the probability over , and that returns , with the hash functions and the XOF modelled as uniformly random functions; for the details, NIST24 (Section 3.2) refers to Theorem 1 of BDK+18 and to the Kyber security-estimation scripts. In input-output behaviour ML-KEM differs from the round-three Kyber specification as follows: its shared key has a fixed length of 256 bits; encapsulation no longer hashes the ciphertext into the shared key, and decapsulation is adjusted to match; encapsulation uses the sampled directly instead of first replacing it by ; encapsulation and decapsulation check their inputs; and key generation hashes the rank together with the seed , a domain separation between the three parameter sets added after the initial public draft — NIST24 (Appendix C).
RSA-KEM / RSAES-OAEP
RSA-KEM samples , sends with no padding, and derives — HT25 (Appendix A), who specify the RSA-KEM of ISO/IEC 18033-2. It is IND-CCA secure under RSA in the random oracle model (RSA ⇒ IND-CCA KEM) — Sho01b. With a DEM and the key derivation modelled as a random oracle, its security is tightly related to the RSA problem and to the DEM’s security — Sho01b, as credited by HT25 (Sections 1.1 and 3). RSAES-OAEP is a PKE, not a KEM. In the random oracle model, OAEP over a trapdoor permutation is IND-CCA secure if the permutation is partial-domain one-way. The RSA function can be inverted from a sufficiently large part of a preimage, so when OAEP’s partial domain is that large, a non-tight reduction relates partial-domain one-wayness of RSA to the RSA assumption (RSA ⇒ IND-CCA PKE (RSA-OAEP)) — FOPS01; MKJR16 (Section 7.1).
KEM combiners
A KEM combiner builds one KEM from two ingredient KEMs: it runs both and derives the key from both keys and possibly both ciphertexts. A combiner preserves IND-CPA (IND-CCA) security if the combined KEM is IND-CPA (IND-CCA) secure whenever at least one ingredient is — GHP18; ABC+25 (Section 4.6.3). Not every primitive has a robust combiner: secret-key pseudorandom codes admit no black-box robust combiner, and neither does public-key encryption with pseudorandom ciphertexts in the sparse-ciphertext regime, whereas IND-CPA public-key encryption has one — DKRR26.
For KEMs , , with key spaces and ciphertext spaces , and an efficiently computable core function , the combined KEM has
- : run for ; output .
- : run for ; output .
- : compute for ; output if or , and otherwise.
This is the framework of GHP18, as restated by PSJS24 (Section VI); ABC+25 (Section 4.6.1) build the same composite KEM and also pass the encapsulation keys and the parameter set to the combiner. If is -correct, is -correct, by a union bound. The combined key is uniform on for the XOR combiner, since is uniform and independent of , and for a random oracle with range that the ingredients do not query — standard.
XOR combiner
Let and . The XOR combiner preserves IND-CPA security but not IND-CCA security — GHP18, as credited by PSJS24 (Section VI).
For IND-CPA, let attack , and let , on input , run and and output . When is the key encapsulated in , sees the real world of the combined game; when is uniform and independent of the rest, so is , and sees the random-key world. So , whatever is, and is symmetric — standard.
For IND-CCA, no XOR combination of two correct KEMs whose encapsulations rarely repeat is IND-CCA secure, even when both ingredients are: pairs each challenge component with a fresh encapsulation of its own and asks for both mixed ciphertexts to be decapsulated.
\begin{algorithm}
\algname{Algorithm}
\caption{$\calA^{\Decap(\sk, \cdot)}((\pk_1, \pk_2), (c_1^*, c_2^*), k)$}
\begin{algorithmic}
\State $(c_1, k_1) \gets \Encap_1(\pk_1)$; $(c_2, k_2) \gets \Encap_2(\pk_2)$
\If{$c_1 = c_1^*$ or $c_2 = c_2^*$}
\Return $0$
\EndIf
\State $u \gets \Decap(\sk, (c_1^*, c_2))$; $v \gets \Decap(\sk, (c_1, c_2^*))$
\Comment{Both queries differ from $(c_1^*, c_2^*)$}
\Return $[u \ne \bot \wedge v \ne \bot \wedge u \oplus v \oplus k_1 \oplus k_2 \ne k]$
\end{algorithmic}
\end{algorithm}
Write for the components of the challenge encapsulation, so that the real key is , and let over , which bounds . Unless or , with probability at most , or one of the decapsulations of , , and errs, with probability at most , the oracle returns and , so that , which a uniform key equals with probability . None of these events depends on , so
— standard. For an IND-CPA KEM with negligible correctness error, is negligible (IND-CCA KEM + one-time CCA-secure SKE ⇒ IND-CCA PKE, Notes), so the XOR combination of two IND-CCA KEMs is not IND-CCA secure.
A combiner whose core function reads only and does not preserve IND-CCA security, whatever the function — BCD+24, as credited by ABC+25 (Section 4.6.3), for a key-derivation function of the two keys. Suppose has an efficient map with and for all and . The adversary that queries and outputs receives the real key unless or decapsulates wrongly, so for its advantage is at least , whatever is — standard. Appending to every ciphertext of an IND-CPA KEM a bit that decapsulation ignores gives such a , still IND-CPA secure — standard. X25519, viewed as a KEM whose ciphertext is the sender’s share (SFG26, Section 2), has such a map, since it masks the most significant bit of the received u-coordinate — LHT16 (Section 5).
Hashed and split-key PRF combiners
With for a random oracle with range , the combined KEM is IND-CCA secure if or is — GHP18, as credited by ABC+25 (Section 4.6.3). ABC+25 (Section 4.6.3) encourage combiners that preserve IND-CCA security and give as an example this combiner with from the SHA-3 family and with the two encapsulation keys and a domain separator identifying the composite scheme as further inputs; GHP18 omit the encapsulation keys, which IND-CCA preservation does not need.
A split-key PRF is an efficiently computable that, for each , is a PRF keyed by on inputs , against distinguishers that use a fresh in every query. With the combined KEM is IND-CCA secure if either ingredient is — GHP18, as credited by DFH22 (Sections 1 and 4.1). For a random oracle and an efficient with for each , each value of the other key and each , the function is a split-key PRF with distinguishing advantage at most for queries to — GHP18, as credited by DFH22 (Section 4.1), who prove it secure in the quantum random-oracle model as well (Theorem 2 and Corollary 1). DFH22 (Section 4.1) name , which gives the hashed combiner above, and the sum of the keys; for , both the identity and have — standard. In the random oracle model, hashing together with both ciphertexts therefore preserves IND-CCA security, while alone does not.
ABC+25 (Section 4.6.2) approve two kinds of key combiner. A key-derivation method of SP 800-56C applied to the tuple of shared secrets is approved when at least one of them, in any position, comes from SP 800-56A, SP 800-56B or an approved KEM, where SP 800-56C itself allows a pair with the approved secret; its FixedInfo input may carry ciphertexts, encapsulation keys and a domain separator. The key-combination methods of SP 800-133, namely concatenation, XOR and HMAC-based extraction, are approved only when every component scheme is approved, and a concatenated key should pass through a key-derivation function before use.
X25519MLKEM768
X25519MLKEM768 is the TLS 1.3 hybrid key agreement of ML-KEM-768 with X25519 Diffie–Hellman (LHT16, Section 6.1) — KKWS26. The client’s key share is its ML-KEM-768 encapsulation key (1184 bytes) followed by its X25519 share (32 bytes); the server’s key share is an ML-KEM-768 ciphertext encapsulated to that key (1088 bytes) followed by the server’s X25519 share (32 bytes); the 64-byte shared secret is the ML-KEM-768 shared secret followed by the X25519 shared secret — KKWS26 (Sections 4.1–4.3). The shares and the secret put ML-KEM first although the group name lists X25519 first, which reverses, for historical reasons, the rule of SFG26 (Section 3.2) that shares are concatenated in the order of the name (KKWS26, Section 4.1). Putting the ML-KEM secret first makes the first of the two secrets the FIPS-approved one, which SP 800-56C requires when HKDF is applied to two shared secrets (KKWS26, Section 5).
The concatenated secret replaces the (EC)DHE shared secret as the input of the HKDF-Extract that yields the TLS 1.3 handshake secret — SFG26 (Section 3.3, Figure 1). For fixed-length shared secrets, SFG26 (Section 6) identify this construction with the dual-PRF combiner of BBF+19, which preserves security if the hash function is a dual PRF. The security analysis relies on the TLS 1.3 message transcript, and the same hybridization cannot be assumed secure in other protocols — KKWS26 (Section 6). A standalone KEM whose key is derived from the two shared secrets alone is a key-only combiner, and the one-query attack above, with the masked bit of the server’s X25519 share flipped, breaks its IND-CCA security — standard.
X-Wing is a hybrid KEM built from the same two components at lower cost than a generic combiner. It is IND-CCA secure if the strong Diffie–Hellman assumption holds in the X25519 group, in the random oracle model, and IND-CCA secure against quantum adversaries if ML-KEM-768 is IND-CCA secure and SHA3-256 is a PRF, in the standard model; these guarantees rest on the concrete choice of components — BCD+24.
Other results
- PKE ⇒ KEM
- IND-CPA PKE ⇒ IND-CCA KEM (Fujisaki–Okamoto), in the random oracle model, composed of IND-CPA PKE ⇒ OW-PCA PKE (Fujisaki–Okamoto transform T) and OW-PCA PKE ⇒ IND-CCA KEM (Fujisaki–Okamoto transform U, implicit rejection) — HHK17
- Module LWE ⇒ IND-CCA KEM, in the random oracle model: Kyber — BDK+18; ML-KEM, machine-checked down to a variant of Module LWE — AAB+24
- IND-CCA KEM + one-time CCA-secure SKE ⇒ IND-CCA PKE — CS03
- IND-CPA KEM ⇒ IND-CPA PKE, with the one-time pad as DEM — folklore
- CDH ⇒ IND-CPA KEM (hashed ElGamal), in the random oracle model — folklore
- The KEM-DEM paradigm is standardized as HPKE (RFC 9180) — BBLW22
- KEM ⇒ KE with bit-string keys
Participates in
Builds on Key encapsulation mechanism
- IND-CCA security ⇒ IND-CPA KEM (via IND-CCA security)
- IND-CPA KEM + SKE ⇒ IND-CPA PKE (via IND-CPA KEM)
- IND-CPA KEM ⇒ IND-CPA PKE (via IND-CPA KEM)
- IND-CCA KEM + one-time CCA-secure SKE ⇒ IND-CCA PKE (via IND-CCA security)
- KEM ⇒ KE with bit-string keys (via IND-CPA KEM)
Produces Key encapsulation mechanism
- CDH ⇒ IND-CPA KEM (hashed ElGamal) (via IND-CPA KEM)
- IND-CCA security ⇒ IND-CPA KEM (via IND-CPA KEM)
- IND-CPA PKE ⇒ IND-CCA KEM (Fujisaki–Okamoto) (via IND-CCA security)
- Module LWE ⇒ IND-CCA KEM (via IND-CCA security)
- NTRU ⇒ IND-CCA KEM (via IND-CCA security)
- OW-PCA PKE ⇒ IND-CCA KEM (Fujisaki–Okamoto transform U, implicit rejection) (via IND-CCA security)
- PKE ⇒ KEM (via IND-CPA KEM)
- RSA ⇒ IND-CCA KEM (via IND-CCA security)