Documentation

CslibFrontier.Crypto.Primitives.IdealCipher.CompressionVariants

Explicit Collisions for Insecure Block-Cipher Compression Variants #

Building on Cslib.IdealCipher (CslibFrontier.Crypto.Primitives.IdealCipher.Compression), this module records explicit 2-query ideal-cipher collision finders for two insecure variants of Davies–Meyer from [BS23], Section 8.5.2 (p. 301) and Exercise 8.11 (p. 349):

Both variants are modeled purely in the ideal-cipher model (CollisionFinder and collisionGame over an arbitrary finite additive group Block); no computational BlockCipher or CollisionResistantForOn corollary is formalized here.

Main definitions #

Main results #

References #

def Cslib.IdealCipher.keyMaskedAdversary {Block : Type} [Sub Block] (k1 k2 y : Block) :
ProbOracleComp (Spec Block Block) ((Block × Block) × Block × Block)

An explicit ideal-cipher collision finder for keyMasked (h₄ with its two arguments swapped, [BS23], Section 8.5.2, p. 301 and Exercise 8.11, p. 349; [KL20], Exercise 7.23(c)) using two inverse queries with distinct keys k1, k2 and target digest y.

theorem Cslib.IdealCipher.isQueryBounded_keyMaskedAdversary {Block : Type} [Sub Block] (k1 k2 y : Block) :

keyMaskedAdversary makes at most 2 ideal-cipher queries on every execution path.

theorem Cslib.IdealCipher.keyMaskedAdversary_wins {Block : Type} [DecidableEq Block] [Fintype Block] [AddGroup Block] {k1 k2 : Block} (hk : k1 ≠ k2) (y : Block) :

For any distinct keys k1 ≠ k2 and any target y, keyMaskedAdversary k1 k2 y wins collisionGame keyMasked with exact distribution PMF.pure true.

Existential summary for keyMasked (h₄ with its two arguments swapped) over any nontrivial finite additive group: there is a 2-query ideal-cipher collision finder winning with probability 1.

def Cslib.IdealCipher.keyMaskedInputAdversary {Block : Type} [AddGroup Block] (k1 k2 y : Block) :
ProbOracleComp (Spec Block Block) ((Block × Block) × Block × Block)

An explicit ideal-cipher collision finder for keyMaskedInput (h₅, [BS23], Section 8.5.2, p. 301 and Exercise 8.11, p. 349) using two inverse queries with distinct keys k1 and k2 and target digest y.

keyMaskedInputAdversary makes at most 2 ideal-cipher queries on every execution path.

For any distinct keys k1 ≠ k2 and any target y, keyMaskedInputAdversary k1 k2 y wins collisionGame keyMaskedInput with exact distribution PMF.pure true.

Existential summary for keyMaskedInput (h₅) over any nontrivial finite additive group: there is a 2-query ideal-cipher collision finder winning with probability 1.