Second-preimage experiments and finite bounds #
The second-preimage experiment for a function and an input distribution, with the finite-domain
counting and inversion bounds of [BS23], Exercise 8.23(a)–(b), pp. 352–353. Below,
OWadv[A, H] and SPRadv[B, H] are the success probabilities of inversionExperiment and
secondPreimageExperiment, and B := fun m => A (H m) is the finder that runs the inverter A
on the digest.
The asymptotic bit-string notion SecondPreimageResistant lives in
CslibFrontier.Crypto.Computational.SecondPreimageResistant.
Main definitions #
Cslib.Crypto.secondPreimageExperiment: drawx ← sample, runx' ← finder x, and accept whenx' ≠ xandf x' = f x.Cslib.Crypto.HasSecondPreimage:∃ m' ≠ m, H m' = H m.
Main results #
Cslib.Crypto.card_not_hasSecondPreimage_le,Cslib.Crypto.card_not_hasSecondPreimage_div_le: at most|T|inputs lack a second preimage, which is at most a1 / sfraction whens * |T| ≤ |M|and0 < s(Exercise 8.23(a)).Cslib.Crypto.inversionExperiment_le_secondPreimageExperiment_add: for any input distributionsample,OWadv[A, H] ≤ SPRadv[B, H] + ∑' x, sample x * A (H x) x.Cslib.Crypto.succProbability_inversionExperiment_uniform_le_add_card_div: on a uniform input from a nonempty finiteM,OWadv[A, H] ≤ SPRadv[B, H] + |T| / |M|.Cslib.Crypto.succProbability_inversionExperiment_uniform_le_two_mul_add_div: equation (8.22) of Exercise 8.23(b),OWadv[A, H] ≤ 2 · SPRadv[B, H] + 1 / swhens * |T| ≤ |M|and0 < s. It follows from the previous bound, which shows that the factor2is not needed.Cslib.Crypto.succProbability_secondPreimageExperiment_le_of_eq_imp: a finder succeeds againstgat most as often as againstfwhen every collision ofgon distinct inputs is one off.
References #
- D. Boneh and V. Shoup, A Graduate Course in Applied Cryptography, Section 8.11.1 (Definition 8.6, p. 336) and Exercise 8.23(a)–(b) (pp. 352–353).
The second-preimage experiment for f on inputs drawn from sample: the challenger draws x
and gives finder the input x; finder wins when it returns x' ≠ x with f x' = f x.
An injective function has no second preimages, so every second-preimage finder fails with
probability 1.
If every collision under g is a collision under f, then every second-preimage finder
succeeds at least as often against f as against g.
Finite-domain counting and (8.22) (Exercise 8.23(a)–(b)) #
m has a second preimage under H when some distinct m' ≠ m maps to the same digest.
Instances For
An input lacking a second preimage is uniquely determined by its digest.
Exercise 8.23(a), count form ([BS23], p. 352): at most |T| inputs in M lack
a second preimage under H : M → T.
Exercise 8.23(a), fraction form ([BS23], p. 352): if |M| ≥ s · |T| with
0 < s (the book assumes s > 1, and 0 < s suffices), then at most a 1 / s fraction of
inputs in M lack a second preimage.
Distributional split behind (8.22): for any input law sample, an inverter A either finds
a second preimage when invoked as x ↦ A (f x) or hits the challenge x itself.
Factor-one uniform inversion bound: the second-preimage finder B := fun m => A (H m) built
from an inverter A satisfies OWadv[A, H] ≤ SPRadv[B, H] + |T| / |M|, without the factor 2 of
(8.22).
Exercise 8.23(b), equation (8.22) ([BS23], p. 353): when |M| ≥ s · |T| with
0 < s, the second-preimage finder B := fun m => A (H m) built from an inverter A satisfies
OWadv[A, H] ≤ 2 · SPRadv[B, H] + 1 / s. This weakens
succProbability_inversionExperiment_uniform_le_add_card_div, which shows that the factor 2 is
not needed.
Evaluating the second-preimage experiment of programs gives the second-preimage experiment of their distributions.