KEM-DEM Composition (Hybrid Encryption) #
The KEM-DEM construction is the standard recipe for hybrid public-key
encryption: a key encapsulation mechanism (KEM) ships a fresh symmetric key
under the public key, and a data encapsulation mechanism (DEM) encrypts the
payload under that key. This file builds the composition as a core PKEScheme
and proves its security by a three-hop hybrid argument.
This is the proof-ladders "asymmetric" benchmark (Rosulek, The Joy of Cryptography, hybrid encryption): a secure KEM composed with a secure DEM yields a secure public-key scheme.
Overview #
To encrypt m under pk:
(k, ek) ← KEM.encap pk— encapsulate a fresh symmetric keykc := DEM.enc k m— encrypt the payload underk- output
(ek, c)
To decrypt (ek, c) under sk: recover k := KEM.decap sk ek, then
m := DEM.dec k c.
Security #
These are IND-CPA games: the real game encrypts the actual message and the ideal
game encrypts a null message, and the adversary sees only (pk, ek, c) — there is
no decryption oracle, so the statement is confidentiality (CPA), not CCA.
The distinguishing advantage against the composed PKE-CPA game is bounded by
Adv_PKE ≤ Adv_KEM + Adv_DEM + Adv_KEM,
via three game hops (pke_security): swap the encapsulated key for a random
key (KEM), swap the payload for a null message (DEM), swap the random key back
(KEM). When both components are perfectly secure the composition is perfectly
secure (pke_perfect_security): every advantage collapses to 0.
As a concrete headline, BoolXorDEM (the one-time-pad DEM over Bool) is
perfectly DEM-secure via the XOR bijection coupling, so composing it with any
perfectly-secure KEM gives a perfectly-secure hybrid PKE
(xorHybrid_perfect_security).
Main definitions #
KEMScheme,DEMScheme,PKEScheme— the component and target interfaces.HybridPKE— the KEM-DEM composition as aPKEScheme.BoolXorDEM— the XOR (one-time-pad) DEM overBool.
Main results #
hybridPKE_correct— correctness of the composition from component correctness.pke_security— the three-term hybrid boundAdv_PKE ≤ Adv_KEM + Adv_DEM + Adv_KEM.pke_perfect_security— perfect KEM + perfect DEM ⇒ perfect PKE.boolXorDEM_perfect— the XOR DEM is perfectly DEM-secure (XOR-bijection coupling).xorHybrid_perfect_security— perfect hybrid PKE from a perfect KEM and the XOR DEM.
References #
- [Rosulek, The Joy of Cryptography — hybrid (KEM-DEM) encryption]
- [Cramer & Shoup, Design and Analysis of Practical Public-Key Encryption Schemes]
- [Brzuska et al., State-Separating Proofs, ASIACRYPT 2018: https://eprint.iacr.org/2018/306]
KEM Scheme #
A Key Encapsulation Mechanism generates a fresh symmetric key and encapsulates it under the public key; the key is recovered from the encapsulation using the secret key.
A Key Encapsulation Mechanism (KEM) scheme.
Type parameters: PKey public key, SKey secret key, Key symmetric key,
EKey encapsulation (KEM ciphertext).
- kgen : Core.SPComp (PKey × SKey)
Key generation: produces a public/secret key pair.
- encap : PKey → Core.SPComp (Key × EKey)
Encapsulation: from a public key, a symmetric key and its encapsulation.
- decap : SKey → EKey → Key
Decapsulation: deterministically recovers the symmetric key.
Instances For
KEM correctness: decapsulation inverts encapsulation for generated key pairs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
DEM Scheme #
A Data Encapsulation Mechanism is a deterministic symmetric cipher.
A Data Encapsulation Mechanism (DEM): deterministic encryption/decryption.
- enc : Key → Plain → Cipher
Deterministic encryption.
- dec : Key → Cipher → Plain
Deterministic decryption.
Instances For
PKE Scheme #
The target interface implemented by the KEM-DEM composition.
A Public Key Encryption (PKE) scheme.
The ciphertext is a pair (EKey × Cipher) of the KEM encapsulation and the
DEM ciphertext.
- kgen : Core.SPComp (PKey × SKey)
Key generation: produces a public/secret key pair.
- enc : PKey → Plain → Core.SPComp (EKey × Cipher)
Encryption: public key and plaintext to a ciphertext pair.
- dec : SKey → EKey × Cipher → Plain
Decryption: deterministic, secret key and ciphertext pair to plaintext.
Instances For
KEM-DEM Hybrid Construction #
The KEM-DEM hybrid encryption scheme built from a KEM and a DEM.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Correctness #
Correctness of the hybrid scheme from KEM and DEM correctness.
KEM-CPA Security Game #
Real: the challenge key is the encapsulated key. Ideal: the challenge key is fresh and independent of the encapsulation.
KEM-CPA real game: return (pk, ek, k) for the actual encapsulated key k.
Equations
- One or more equations did not get rendered due to their size.
Instances For
KEM-CPA ideal game: return (pk, ek, k') for a fresh random key k'.
Equations
- One or more equations did not get rendered due to their size.
Instances For
KEM-CPA advantage.
Equations
Instances For
Perfect KEM-CPA security: the real and ideal games are perfectly coupled.
Equations
- One or more equations did not get rendered due to their size.
Instances For
DEM-CPA Security Game #
Real: encrypt the actual message. Ideal: encrypt a fixed null message.
DEM-CPA real game: sample a key, encrypt the actual message.
Equations
- CatCrypt.Examples.KEMDEM.DEM_CPA_real DEM m = do let k ← CatCrypt.Core.SPComp.sample Key pure (DEM.enc k m)
Instances For
DEM-CPA ideal game: sample a key, encrypt the null message.
Equations
- CatCrypt.Examples.KEMDEM.DEM_CPA_ideal DEM nullPlain _m = do let k ← CatCrypt.Core.SPComp.sample Key pure (DEM.enc k nullPlain)
Instances For
DEM-CPA advantage.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perfect DEM-CPA security: real and ideal games are perfectly coupled.
Equations
- One or more equations did not get rendered due to their size.
Instances For
PKE-CPA Security Game (for the hybrid scheme) #
PKE-CPA real game: return (pk, ek, c) encrypting the actual message.
Equations
- One or more equations did not get rendered due to their size.
Instances For
PKE-CPA ideal game: return (pk, ek, c) encrypting the null message.
Equations
- One or more equations did not get rendered due to their size.
Instances For
PKE-CPA advantage.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Perfect PKE-CPA security.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Hybrid Games for the Security Reduction #
Game 0 (PKE real) → Game 1 (random key) → Game 2 (random key + null) → Game 3 (PKE ideal).
Hybrid Game 1: encrypt the actual message under a random key.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Hybrid Game 2: encrypt the null message under a random key.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Security Reductions #
Reduction to KEM-CPA (first hop): receive (pk, ek, k), DEM-encrypt m, run A.
Instances For
Reduction to DEM-CPA (second hop): run KEM, receive c, run A.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reduction to KEM-CPA (third hop): as ReductionKEM1 but on nullPlain.
Equations
Instances For
Game Equivalences #
Each consecutive pair of games equals a component game composed with a reduction.
PKE-CPA real, post-composed with A, equals KEM-CPA real ∘ ReductionKEM1.
HybridGame1 ∘ A equals KEM-CPA ideal ∘ ReductionKEM1.
HybridGame1 ∘ A equals DEM-CPA real ∘ ReductionDEM.
Uses SDistr.bind_comm to commute the (independent) uniform key sampling past
the KEM operations.
HybridGame2 ∘ A equals DEM-CPA ideal ∘ ReductionDEM.
HybridGame2 ∘ A equals KEM-CPA ideal ∘ ReductionKEM2.
PKE-CPA ideal ∘ A equals KEM-CPA real ∘ ReductionKEM2.
Main Security Theorem #
KEM-DEM security: the hybrid PKE-CPA advantage is bounded by two KEM-CPA advantages and one DEM-CPA advantage,
Adv_PKE(A) ≤ Adv_KEM(A₁) + Adv_DEM(A₂) + Adv_KEM(A₃),
where A₁ = ReductionKEM1, A₂ = ReductionDEM, A₃ = ReductionKEM2. Proved by
the triangle inequality over the three hybrid games and the game equivalences.
Corollary: Perfect Security #
If both components are perfectly secure, so is the composition.
Perfect KEM-DEM security: if the KEM and DEM are perfectly secure, then
the hybrid PKE is perfectly secure. Proved by transitivity through the hybrid
games PKE_real ≈ Hybrid1 ≈ Hybrid2 ≈ PKE_ideal.
XOR-DEM Instantiation: Perfect Security #
The one-time-pad DEM over Bool (enc k m = k ⊕ m) is perfectly DEM-secure:
encrypting the real message and encrypting the null message false are both
uniform over the sampled key, so they couple through the XOR bijection
(Prob/XorBij). Composed with any perfectly-secure KEM, the hybrid PKE has
advantage exactly 0.
The XOR DEM is correct: dec k (enc k m) = m.
The XOR DEM is perfectly DEM-secure (null message false).
For every message m, encrypting m and encrypting false under a uniform key
are equidistributed: mapping the real key k to k ⊕ m is a bijection
(boolXorBij) under which the real ciphertext k ⊕ m equals the ideal
ciphertext (k ⊕ m) ⊕ false.
Perfect hybrid PKE from the XOR DEM: composing any perfectly-secure KEM
with the one-time-pad DEM over Bool yields a perfectly-secure hybrid PKE —
every distinguisher has advantage exactly 0.
The XOR-hybrid PKE is perfectly indistinguishable, so every adversary's
distinguishing advantage is exactly 0.