The birthday collision finder #
birthdayFinder digest sampler s samples s messages, computes the digest of each with the
oracle program digest, and returns the first pair of different messages with equal digests
([BS23], §8.3, Algorithm BirthdayAttack, printed p. 294). It reaches the function being
attacked only through its oracle, so a bound on its oracle calls is a bound on evaluations of that
function.
- Cost. When each digest makes at most
coracle calls, the finder makes at mosts * con every path (isQueryBounded_birthdayFinder). This counts oracle calls, the cost measure of §8.3. It is not a running time: sampling and the search among thesdigests, which compares up tos ^ 2pairs, are not counted, and no machine model is involved. It is a worst-case count, not an expected cost. - Success. Run against a deterministic oracle under which
digest mreturnsf m, with uniform messages, the finder returns a collision offwith probability at least1 - exp (-s (s - 1) / (2 |D|)) - C(s, 2) / |M|, whereDcontains every value off(birthdayFinder_success), and at least1/2with the book's parameters|M| ≥ 100 |D|ands = ⌈2 √|D|⌉ + 1(birthdayFinder_success_book). Nothing is assumed aboutfbeyondD. It never returns a pair that is not a collision (birthdayFinder_sound).
Differences from [BS23] #
- Lemma 8.2 is about the messages the algorithm samples. Here it is a statement about the output
of the program
birthdayFinder, which samples them; the probabilistic part isCslib.Probability.PMF.one_sub_exp_neg_sub_choose_le_iid_uniformOfFintype_exists_collision, whose docstring lists the differences in the proof. - Steps 4 and 5 of Algorithm BirthdayAttack look for two positions with equal digests and then
test whether their messages differ.
collidingPair?returns the first pair of positions, in lexicographic order, with equal digests and different messages, so the finder succeeds exactly on the event of Lemma 8.2. - The algorithm fixes
s = ⌈2 √N⌉ + 1. The finder takessas a parameter, andbirthdayFinder_success_bookinstantiates the book's value. - The book counts evaluations of
H. Heredigest mis any oracle program, and the count is of its oracle calls. The book'sO(√N)memory is not stated.
Main definitions #
Cslib.Crypto.birthdayFinder: the birthday collision finder (collidingPair?,collisionOutputs, andbruteForceFinderare defined inCslibFrontier.Crypto.Computational.CollisionResistant.BruteForce).
Main results #
Cslib.Crypto.isQueryBounded_birthdayFinder: the finder makes at mosts * coracle calls.Cslib.Crypto.eval_run_birthdayFinder: against a deterministic oracle, the finder samples and searches.Cslib.Crypto.birthdayFinder_sound: every output other thannoneis a collision.Cslib.Crypto.birthdayFinder_success,Cslib.Crypto.birthdayFinder_success_book: the success probability ([BS23], Lemma 8.2).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, §8.3, Algorithm BirthdayAttack and Lemma 8.2 (printed pp. 294–295).
The birthday collision finder ([BS23], §8.3, Algorithm BirthdayAttack, printed
p. 294, with the number of samples s as a parameter): sample s messages and run
bruteForceFinder digest on them (computing the digest of each with digest and returning the
first pair of different messages with equal digests, together with the digest).
Cost of the birthday finder. When each digest makes at most c oracle calls, the finder
makes at most s * c on every path. Sampling and the search among the digests are not counted:
this is a count of oracle calls, not a running time.
Against a deterministic oracle O under which digest m returns f m, the finder samples
and searches.
The finder never returns a wrong pair: against a deterministic oracle under which digest m
returns f m, every output other than none is a collision of f, for every sampler.
Success probability of the birthday finder ([BS23], §8.3, Lemma 8.2, printed
p. 294, with explicit error terms). Against a deterministic oracle under which digest m returns
f m, with s uniform messages, the finder returns a collision of f with probability at least
1 - exp (-s (s - 1) / (2 |D|)) - C(s, 2) / |M|, where D contains every value of f.
Lemma 8.2 with the book's parameters ([BS23], §8.3, printed p. 294): if
|M| ≥ 100 |D|, where D contains every value of f, then the finder with
s = ⌈2 √|D|⌉ + 1 uniform messages returns a collision of f with probability at least 1/2.
With isQueryBounded_birthdayFinder it makes s digest computations.