Word-level birthday attack on block ciphers #
Formalizes the word-level collision distinguisher of Boneh–Shoup (§4.4.3, p. 134) against a
BlockCipher viewed as a pseudorandom function, wrapping the finite birthday distinguisher
PRP.birthdayDistinguisher with an explicit polynomial-time oracle adversary.
Main definitions #
Cslib.Crypto.wordBirthdayDistinguisher: queriesmin (Q n) (2 ^ blockLen n)distinctblockLen n-bit strings generated viaBitString.lowBits, returningtrueon any collision.Cslib.Crypto.birthdayQueries: the correspondingFin q → BitString mindexing map.
Main results #
Cslib.Crypto.isQueryBounded_wordBirthdayDistinguisher: exact query boundmin (Q n) (2 ^ blockLen n).Cslib.Crypto.isOraclePPT_wordBirthdayDistinguisher: polynomial-time oracle certification for polynomial-time computableblockLenandQ.Cslib.Crypto.coe_advantage_wordBirthdayDistinguisher,Cslib.Crypto.min_le_advantage_wordBirthdayDistinguisher,Cslib.Crypto.half_le_advantage_wordBirthdayDistinguisher: concrete advantage formula and lower bounds relatingE.prpRealGamevsprfIdealGametoPRP.birthdayDistinguisher, together with theirprfRealGamecounterpartsBlockCipher.coe_prfAdvantage_wordBirthdayDistinguisher,BlockCipher.min_le_prfAdvantage_wordBirthdayDistinguisher, andBlockCipher.half_le_prfAdvantage_wordBirthdayDistinguisherwhenE.keyLen = id.Cslib.Crypto.BlockCipher.not_indistinguishable_prpRealGame_prfIdealGameandCslib.Crypto.BlockCipher.not_pseudorandomFunctionOver_of_not_negligible: when((2 : ℝ≥0) ^ E.blockLen n)⁻¹is not negligible (for eventually nonzeroE.blockLen),Ecannot be aPseudorandomFunctionOverE.blockLenE.blockLen, showing that the super-polynomial block-size hypothesis inBlockCipher.prp_iff_indistinguishable_prpRealGame_prfIdealGameandBlockCipher.prp_iff_pseudorandomFunctionOver_of_keyLen_eq_idis necessary.
The deterministic counter-mode birthday attack of §4.4.4.1 is not formalized here.
References #
- [BS23] D. Boneh and V. Shoup, A Graduate Course in Applied Cryptography, v0.6, Section 4.4.3, p. 134.
Word-level birthday distinguisher querying min (Q n) (2 ^ blockLen n) distinct
blockLen n-bit inputs (via BitString.lowBits) and returning true iff two truncated outputs
collide.
Finite BitString m query family corresponding to the first q queries made by
wordBirthdayDistinguisher.
birthdayQueries m q is injective whenever q ≤ 2 ^ m.
birthdayQueries m (2 ^ m) enumerates every m-bit string bijectively.
wordBirthdayDistinguisher blockLen Q runs in probabilistic polynomial time when blockLen
and Q are computable in polynomial time on unary inputs.
wordBirthdayDistinguisher blockLen Q n aux makes at most min (Q n) (2 ^ blockLen n)
oracle queries.
Deterministic execution of wordBirthdayDistinguisher against an arbitrary word oracle f.
Against randomFunctionOracle, wordBirthdayDistinguisher matches the finite distinguisher
PRP.birthdayDistinguisher on birthdayQueries.
Output distribution of wordBirthdayDistinguisher in E.prpRealGame coincides with
PRP.realExperiment on E.permEquiv.
In E.prpRealGame, wordBirthdayDistinguisher outputs false almost surely.
Output distribution of wordBirthdayDistinguisher in prfIdealGame coincides with
PRF.idealExperiment on PRP.birthdayDistinguisher.
Exact real-valued advantage of wordBirthdayDistinguisher between E.prpRealGame and
prfIdealGame.
Concrete quadratic birthday lower bound on wordBirthdayDistinguisher against
E.prpRealGame vs prfIdealGame.
Constant 1 / 2 lower bound once 1 ≤ E.blockLen n and 2 ^ E.blockLen n ≤ Q n.
Exact real-valued PRF advantage of wordBirthdayDistinguisher for a BlockCipher with
E.keyLen = id.
Quadratic birthday lower bound on the PRF advantage of wordBirthdayDistinguisher for a
BlockCipher with E.keyLen = id.
Constant 1 / 2 PRF advantage lower bound once 1 ≤ E.blockLen n and
2 ^ E.blockLen n ≤ Q n.
If ((2 : ℝ≥0) ^ E.blockLen n)⁻¹ on nonzero blocks is not negligible, E.prpRealGame and
prfIdealGame are not indistinguishable for PPT adversaries: some PPT adversary distinguishes them,
namely wordBirthdayDistinguisher with a polynomial query count, whose advantage is at least
1 / 2 for infinitely many n.
Necessity of super-polynomial block size in
BlockCipher.prp_iff_pseudorandomFunctionOver_of_keyLen_eq_id:
when E.keyLen = id, 1 ≤ E.blockLen n eventually, and ((2 : ℝ≥0) ^ E.blockLen n)⁻¹ is not
negligible, E cannot be a PseudorandomFunctionOver E.blockLen E.blockLen.