KEM–DEM hybrid public-key encryption #
A Key Encapsulation Mechanism (KEM) samples a public/secret key pair (pk, sk) ← keyGen n and
encapsulates a symmetric key (k, ctKem) ← encaps n pk ([BS23], Exercise 11.9). Its
chosen-plaintext / semantic security (KEMINDCPA, Exercise 11.9) asks that replacing the
encapsulated key k with an independent uniform n-bit key BitString.sampleList n is
computationally indistinguishable to every uniform strict PPT distinguisher receiving
(pk, (k, ctKem)).
A Data Encapsulation Mechanism (DEM) over message space Msg encrypts a single challenge message
under a fresh uniform n-bit key ([BS23], Section 2.2, Attack Game 2.1, p. 16, and
Definition 2.2). As for public-key encryption (Encryption.gameOn), the experiment demGameOn
takes a challenge-pair admissibility predicate valid, and an inadmissible pair makes it output
false in both experiments. demGame and DEMOneTimeINDCPAOf are the always-true case,
DEMOneTimeINDCPA specializes to single-bit messages, and DEMOneTimeWordINDCPA imposes Attack
Game 2.1's equal-length rule on bit words.
Combining encaps with encryptSym produces the hybrid public-key encryption scheme
hybridEncrypt encaps encryptSym (hybridDecrypt decaps decryptSym, Exercise 11.9(a)). By
Boneh and Shoup's Exercise 11.9(b), if the KEM is IND-CPA secure and the DEM is one-time IND-CPA
secure, then hybridEncrypt encaps encryptSym is IND-CPA secure: KEMINDCPA.hybrid_indcpa for
unrestricted challenge pairs, and KEMINDCPA.hybrid_indcpaOn under an admissibility predicate that
ignores the public key, such as the equal-length rule. We formalize both the single hidden-bit KEM
distinguisher bound of Exercise 11.9(b) (advantage_hybridGame_le_two_mul) and its
two-distinguisher triangle-inequality variant (advantage_hybridGame_le), together with
non-vacuous single-bit and n-bit word one-time pad DEM instantiations (otpEncrypt,
otpDecrypt, demOneTimeINDCPA_otpEncrypt, KEMINDCPA.hybrid_otpEncrypt_indcpa,
otpWordEncrypt, otpWordDecrypt, demOneTimeINDCPA_otpWordEncrypt,
demOneTimeWordINDCPA_otpWordEncrypt, KEMINDCPA.hybrid_otpWordEncrypt_indcpa).
Relative to Boneh and Shoup, Exercise 11.9, this development has the following representation conventions:
- Plaintext messages are parameterized by
Msg : Type(with message encodingencMsg : Msg ↪ List Boolfor PPT admissibility), matchingEncryption.gameOnandEncryption.INDCPAOninComplexity/Crypto/Computational/Encryption/Basic.lean. - The DEM adversary receives the empty public key
[], anddemGameOn validevaluatesvalidat it.KEMINDCPA.hybrid_indcpaOntherefore asks thatvalidignore the public key. - Both the ideal KEM key distribution and the one-time DEM key distribution at security parameter
nare fixed to uniformn-bit strings (BitString.sampleList n). Becauseencapsreturns arbitrary bit lists andKEMINDCPArequires only negligible distinguishing advantage, finitely many or negligibly probable length deviations remain compatible withKEMINDCPA, whereas non-negligible length deviations are detectable (as innot_kemINDCPA_leaking). - Decapsulation
decapsand hybrid decryptionhybridDecryptare total deterministic functions without a separaterejectsymbol;hybridDecrypt_hybridEncryptstates exact recovery on supported ciphertexts whendecapsanddecryptSymare correct on supported outputs. - In
kemRealGameandkemIdealGame, the KEM distinguisher receives the public keypkexplicitly alongside(k, ctKem)(encoded as(pk, (k, ctKem))). Although the prose of Exercise 11.9 writes that the challenger sends(k_b, c_kem), the public keypkis public in a public-key KEM experiment and is required by the reduction distinguisher to runadversary.choose n pk.
Main definitions #
Cslib.Crypto.Encryption.kemRealGame,Cslib.Crypto.Encryption.kemIdealGame,Cslib.Crypto.Encryption.KEMINDCPA: real and ideal KEM IND-CPA experiments and security.Cslib.Crypto.Encryption.demGameOn,Cslib.Crypto.Encryption.demGame,Cslib.Crypto.Encryption.DEMOneTimeINDCPAOn,Cslib.Crypto.Encryption.DEMOneTimeINDCPAOf,Cslib.Crypto.Encryption.DEMOneTimeINDCPA,Cslib.Crypto.Encryption.DEMOneTimeWordINDCPA: one-time symmetric encryption experiments and security, with and without an admissibility predicate.Cslib.Crypto.Encryption.hybridEncrypt,Cslib.Crypto.Encryption.hybridDecrypt: KEM–DEM hybrid encryption and deterministic decryption.Cslib.Crypto.Encryption.hybridIdealGame: intermediate game replacing the encapsulated key with an independent uniformn-bit key.Cslib.Crypto.Encryption.hybridToKEMDistinguisher,Cslib.Crypto.Encryption.hybridToKEMHiddenBitDistinguisher,Cslib.Crypto.Encryption.hybridToDEMAdversary: the certified uniform reductions.Cslib.Crypto.Encryption.otpEncrypt,Cslib.Crypto.Encryption.otpDecrypt,Cslib.Crypto.Encryption.otpWordEncrypt,Cslib.Crypto.Encryption.otpWordDecrypt: one-time pad single-bit andn-bit word DEMs.
Main results #
Cslib.Crypto.Encryption.isPPTOn_kemRealGame,Cslib.Crypto.Encryption.isPPTOn_kemIdealGame,Cslib.Crypto.Encryption.isPPTOn_demGameOn,Cslib.Crypto.Encryption.isPPTOn_demGame,Cslib.Crypto.Encryption.isPPTOn_hybridEncrypt,Cslib.Crypto.Encryption.computableInPolyTime_hybridDecrypt: polynomial-time certificates.Cslib.Crypto.Encryption.hybridDecrypt_encPair,Cslib.Crypto.Encryption.hybridDecrypt_hybridEncrypt: exact decryption correctness (Exercise 11.9(a)).Cslib.Crypto.Encryption.advantage_hybridGame_le_two_mul,Cslib.Crypto.Encryption.advantage_hybridGame_le: quantitative Boneh–Shoup Exercise 11.9(b) reduction and its two-distinguisher variant.Cslib.Crypto.Encryption.eval_demGame_restrict,Cslib.Crypto.Encryption.DEMOneTimeINDCPAOf.demOneTimeINDCPAOn: unrestricted one-time security implies one-time security under every polynomial-time admissibility predicate.Cslib.Crypto.Encryption.KEMINDCPA.hybrid_indcpa,Cslib.Crypto.Encryption.KEMINDCPA.hybrid_indcpaOn: asymptotic Boneh–Shoup Exercise 11.9(b), without and with an admissibility predicate.Cslib.Crypto.Encryption.demOneTimeINDCPA_otpEncrypt,Cslib.Crypto.Encryption.KEMINDCPA.hybrid_otpEncrypt_indcpa,Cslib.Crypto.Encryption.demOneTimeINDCPA_otpWordEncrypt,Cslib.Crypto.Encryption.demOneTimeWordINDCPA_otpWordEncrypt,Cslib.Crypto.Encryption.KEMINDCPA.hybrid_otpWordEncrypt_indcpa: unconditional one-time pad DEM security and the KEM-to-PKE corollaries.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 2.2 (Attack Game 2.1 and Definition 2.2, p. 16) and Exercise 11.9 (pp. 460–461).
Key Encapsulation Mechanisms #
The real KEM IND-CPA experiment ([BS23], Exercise 11.9, Experiment 0):
sample (pk, sk) ← keyGen n and (k, ctKem) ← encaps n pk, and pass the encoded triple
(pk, (k, ctKem)) to distinguisher n.
Instances For
The ideal KEM IND-CPA experiment ([BS23], Exercise 11.9, Experiment 1):
sample (pk, sk) ← keyGen n, (k, ctKem) ← encaps n pk, and an independent uniform n-bit key
kIdeal ← BitString.sampleList n, and pass (pk, (kIdeal, ctKem)) to distinguisher n.
Instances For
The real KEM IND-CPA experiment is uniform strict PPT when key generation, encapsulation, and the distinguisher have native certificates.
The ideal KEM IND-CPA experiment is uniform strict PPT when key generation, encapsulation, and the distinguisher have native certificates.
IND-CPA / semantic security for a Key Encapsulation Mechanism ([BS23],
Exercise 11.9): every uniform strict PPT distinguisher has negligible advantage between
kemRealGame and kemIdealGame.
Instances For
One-Time Symmetric Encryption (DEM) #
The one-time symmetric chosen-plaintext experiment over message space Msg with challenge-pair
admissibility predicate valid ([BS23], Section 2.2, Attack Game 2.1, p. 16): sample a
uniform n-bit key k ← BitString.sampleList n and invoke adversary.choose n []; the adversary
receives the empty public key [], and valid is evaluated at it. If the chosen pair is valid,
encrypt the selected message under encryptSym n k and pass the saved state and challenge
ciphertext to adversary.guess n; otherwise return false, in both experiments.
Instances For
The unrestricted one-time symmetric experiment: demGameOn with every challenge pair
admissible.
Instances For
Running the unrestricted demGame on adversary.restrict valid has the same output
distribution as running demGameOn valid on adversary.
The one-time symmetric experiment demGameOn valid has a strict polynomial clock when valid
is computable in polynomial time and symmetric encryption and both adversary stages have native
certificates.
The unrestricted one-time symmetric experiment has a strict polynomial clock when symmetric encryption and both adversary stages have native certificates.
One-time symmetric IND-CPA / semantic security over message encoding encMsg with
challenge-pair admissibility predicate valid ([BS23], Section 2.2, Attack Game 2.1,
p. 16, and Definition 2.2): every uniform strict PPT Encryption.AdversaryOf Msg has negligible
distinguishing advantage between demGameOn valid encryptSym adversary false and
demGameOn valid encryptSym adversary true.
Instances For
One-time symmetric IND-CPA with every challenge pair admissible. For List Bool messages this
is stronger than the textbook notion, which DEMOneTimeWordINDCPA states.
Instances For
Unrestricted one-time symmetric IND-CPA implies one-time symmetric IND-CPA under every polynomial-time admissibility predicate.
One-time symmetric IND-CPA / semantic security for bit-word encryption under Attack Game 2.1's
equal-length rule ([BS23], Section 2.2, p. 16): challenge pairs with
m₀.length ≠ m₁.length are inadmissible.
Instances For
Hybrid Encryption Construction and Correctness #
KEM–DEM hybrid encryption ([BS23], Exercise 11.9): encapsulate a symmetric key
(k, ctKem) ← encaps n pk, encrypt the plaintext message under k via
ctDem ← encryptSym n k msg, and encode (ctKem, ctDem) using encPair encBits encBits.
Instances For
Deterministic KEM–DEM hybrid decryption ([BS23], Exercise 11.9):
decode the hybrid ciphertext ct into ctKem = unframe ct and ctDem = dropFrame ct,
decapsulate k = decaps n sk ctKem, and return decryptSym n k ctDem.
Instances For
Hybrid encryption is uniform strict PPT when encapsulation and symmetric encryption are.
Hybrid decryption is computable in polynomial time when decapsulation and symmetric decryption are computable in polynomial time.
Hybrid decryption on an encoded ciphertext pair (ctKem, ctDem) decapsulates ctKem and
decrypts ctDem under the resulting key.
Hybrid decryption correctness: if decaps n sk recovers the encapsulated key k on every
supported output (k, ctKem) of encaps n pk, and decryptSym n k recovers msg on every
supported output of encryptSym n k msg, then hybridDecrypt recovers msg on every supported
ciphertext of hybridEncrypt.
Boneh–Shoup Exercise 11.9(b) Reductions and Asymptotic Security #
The intermediate hybrid game $G_1$ for the standard hybrid argument of
[BS23], Exercise 11.9(b): identical to
Encryption.game keyGen (hybridEncrypt encaps encryptSym) except that the symmetric key passed to
encryptSym is an independent uniform n-bit key kIdeal ← BitString.sampleList n rather than
encapsulated.1.
Instances For
Direct per-bit KEM distinguisher $D_{\mathrm{kem}, b}$ constructed from an
Encryption.AdversaryOf Msg and DEM encryption encryptSym (for the two-distinguisher variant of
[BS23], Exercise 11.9(b)): given an encoded KEM challenge (pk, (k, ctKem)), run
adversary.choose n pk, encrypt the bit-selected message under k, and run adversary.guess on
(ctKem, ctDem).
Instances For
Single hidden-bit KEM distinguisher $\mathcal{B}_{\mathrm{kem}}$ for
[BS23], Exercise 11.9(b): given an encoded KEM challenge (pk, (k, ctKem)), run
adversary.choose n pk, sample a fair challenge bit bit ← ProbComp.uniform Bool, encrypt the
selected message under k, run adversary.guess, and return guess ^^ bit.
Instances For
Two-stage DEM adversary $\mathcal{B}_{\mathrm{s}}$ constructed from keyGen, encaps, and a
hybrid Encryption.AdversaryOf Msg for [BS23], Exercise 11.9(b): stage 1 samples
(pk, sk) ← keyGen n and (k, ctKem) ← encaps n pk, runs adversary.choose n pk, and saves
encPair encBits encBits (ctKem, choice.2); stage 2 combines ctKem with the DEM challenge
ciphertext ctDem and runs adversary.guess.
Instances For
hybridToKEMDistinguisher is uniform strict PPT whenever symmetric encryption and the hybrid
adversary are.
hybridToKEMHiddenBitDistinguisher is uniform strict PPT whenever symmetric encryption and the
hybrid adversary are.
hybridToDEMAdversary is an admissible uniform strict PPT Encryption.AdversaryOf Msg whenever
key generation, encapsulation, and the hybrid adversary are.
In the real KEM experiment, hybridToKEMDistinguisher reproduces the actual hybrid encryption
experiment Encryption.game keyGen (hybridEncrypt encaps encryptSym).
In the ideal KEM experiment, hybridToKEMDistinguisher reproduces the intermediate game
hybridIdealGame.
In the one-time symmetric DEM experiment, hybridToDEMAdversary reproduces the intermediate
game hybridIdealGame.
In the real KEM experiment, hybridToKEMHiddenBitDistinguisher averages the two hybrid
chosen-message games, complementing the second.
In the ideal KEM experiment, hybridToKEMHiddenBitDistinguisher averages the two intermediate
games hybridIdealGame, complementing the second.
Success probability of hybridToKEMHiddenBitDistinguisher in kemRealGame is one half plus
half the signed hybrid chosen-message gap.
Success probability of hybridToKEMHiddenBitDistinguisher in kemIdealGame is one half plus
half the signed hybridIdealGame gap.
Quantitative KEM–DEM reduction via two per-bit KEM distinguishers (two-distinguisher
variant of [BS23], Exercise 11.9(b)): the hybrid IND-CPA advantage is bounded by the sum
of the KEM advantages of hybridToKEMDistinguisher encryptSym adversary false and
hybridToKEMDistinguisher encryptSym adversary true, plus the DEM advantage of
hybridToDEMAdversary keyGen encaps adversary.
Quantitative KEM–DEM reduction via a single hidden-bit KEM distinguisher ([BS23],
Exercise 11.9(b)): the hybrid IND-CPA advantage is at most twice the KEM advantage of
hybridToKEMHiddenBitDistinguisher encryptSym adversary, plus the DEM advantage of
hybridToDEMAdversary keyGen encaps adversary.
IND-CPA security of KEM–DEM hybrid encryption ([BS23], Exercise 11.9(b)):
if (keyGen, encaps) is an IND-CPA secure KEM and encryptSym is a one-time IND-CPA secure DEM
over encMsg (with uniform strict PPT honest algorithms), then hybridEncrypt encaps encryptSym
is IND-CPA secure over encMsg.
When valid ignores the public key, running the unrestricted demGame on the DEM adversary
built from adversary.restrict valid has the same output distribution as running demGameOn valid
on it: an invalid pair already makes the restricted adversary's guess false.
IND-CPA security of KEM–DEM hybrid encryption under an admissibility predicate
([BS23], Exercise 11.9(b)), for a polynomial-time predicate valid that ignores the
public key, such as the equal-length rule: if (keyGen, encaps) is an IND-CPA secure KEM and
encryptSym satisfies DEMOneTimeINDCPAOn valid encMsg, then hybridEncrypt encaps encryptSym
satisfies INDCPAOn valid encMsg.
Non-vacuous One-Time Pad DEMs #
One-time pad encryption is uniform strict PPT.
One-time pad decryption is computable in polynomial time.
For 1 ≤ n, a uniform n-bit key masks the challenge bit perfectly in demGame otpEncrypt,
so the false and true experiment distributions are identical.
For 1 ≤ n, every adversary has exact advantage 0 in demGame otpEncrypt.
The one-time pad is unconditionally one-time IND-CPA secure
(DEMOneTimeINDCPA otpEncrypt).
KEM-to-PKE corollary: combining any IND-CPA secure KEM with the one-time pad DEM yields an IND-CPA secure public-key bit-encryption scheme.
One-time pad word encryption is uniform strict PPT.
One-time pad word decryption is computable in polynomial time.
A uniform n-bit key masks any challenge word perfectly in demGame otpWordEncrypt, so the
false and true experiment distributions are identical for every n.
Every word adversary has exact advantage 0 in demGame otpWordEncrypt.
The n-bit word one-time pad is unconditionally one-time IND-CPA secure
(DEMOneTimeINDCPAOf encBits otpWordEncrypt).
The n-bit word one-time pad satisfies equal-length word DEM security
(DEMOneTimeWordINDCPA otpWordEncrypt).
KEM-to-word-PKE corollary: combining any IND-CPA secure KEM with the n-bit word one-time
pad DEM yields a public-key word-encryption scheme satisfying WordINDCPA, through the
equal-length instance of KEMINDCPA.hybrid_indcpaOn.