Birthday bound

For balls thrown independently and uniformly at random into bins, denotes the probability that some bin receives at least two. For ,

and for ,

— BKR00, Proposition A.1; GB08, Proposition A.1, with the constant . For some bin receives two balls, and — standard. In particular balls give , hence a collision with probability at least — standard.

Proof

Let be the event that ball lands in an occupied bin. At most bins are occupied when ball is thrown, so , and a union bound gives . If balls occupy distinct bins, ball avoids them with probability exactly , so by ,

For , , and on ; — BKR00, Appendix. The inequality holds because is concave and agrees with at and — standard.

Two lists

Let be a set of size , a set of size , and uniform elements of independent of , drawn either independently or as a uniform -subset. Then

Each is uniform on , which gives the upper bound by a union bound. Conditioned on , all miss with probability in the independent case and in the distinct case, and — standard. Two independent uniform -subsets of a set of size therefore meet with probability at least , the estimate behind Merkle’s puzzles in the random oracle model — standard.

Non-uniform samples

Let be a distribution on a set of size , and independent samples from . Then

so the uniform distribution minimizes the collision probability — standard (TODO: attribution). For both sides are , and for both are . For , the samples are distinct with probability , where . For distinct ,

with the elementary symmetric polynomials of degrees , , in the other coordinates; replacing and by their mean keeps a distribution, keeps , and raises by . is continuous on the simplex, which is compact, so it attains its maximum at some . The uniform distribution has , so has at least nonzero coordinates and at for every pair ; averaging two unequal coordinates of would increase , so is uniform. Hence — standard.

A function into is regular if every point of has the same number of preimages, so that for uniform is uniform on — GB08, §8.3. If is not regular, the birthday attack below may succeed with fewer trials: BK04 measure the regularity of by its balance, estimate the success rate of the attack as a function of it, and find that for of low balance the number of trials can be significantly less than . TODO: state the BK04 bound in terms of balance.

Generic collision attack

\begin{algorithm}
\algname{Algorithm}
\caption{Birthday attack $\calA^{h}(q)$ on $h : \calD \to \calR$}
\begin{algorithmic}
\For{$i = 1, \ldots, q$}
\State $x_i \getsr \calD$; $y_i \gets h(x_i)$
\If{$y_j = y_i$ and $x_j \neq x_i$ for some $j < i$}
\Return $(x_j, x_i)$
\EndIf
\EndFor
\Return $\bot$
\end{algorithmic}
\end{algorithm}

This is the birthday attack of GB08, §8.3, Figure 8.6. For every function and it makes evaluations of on independent uniform inputs, stores pairs, and returns a collision of with probability at least

The are independent with , so two of them coincide with probability at least by the non-uniform bound, and the attack misses such a coincidence only if two of the coincide, which has probability — standard. When , the correction is at most half the upper birthday bound , so for the attack succeeds with probability at least

— standard. A collision-resistant hash function compresses to with , so , and the attack run on wins with probability at least using evaluations when , since then , and with probability at least using evaluations when , and when — standard. If for a constant and infinitely many , the second attack is efficient and has advantage at least for those , which is not negligible. Collision resistance therefore requires — standard.

For with and , the sequence has a unique tail length and cycle length such that are distinct and ; for , if and only if and . Write for the number of distinct values. If , then and ; if , every lies on the cycle, where is injective, and the sequence contains no collision of — standard.

Floyd’s cycle finding locates such a collision with two pointers, a tortoise and a hare — standard (TODO: attribution).

\begin{algorithm}
\algname{Algorithm}
\caption{Rho search $\calA^{f}(x_0)$ with Floyd's cycle finding}
\begin{algorithmic}
\State $u \gets f(x_0)$; $v \gets f(f(x_0))$
\Comment{$u = x_i$, $v = x_{2i}$ with $i = 1$}
\While{$u \neq v$}
\State $u \gets f(u)$; $v \gets f(f(v))$
\EndWhile
\If{$v = x_0$}
\Return $\bot$
\Comment{$\mu = 0$}
\EndIf
\State $u \gets x_0$; $u' \gets f(u)$; $v' \gets f(v)$
\While{$u' \neq v'$}
\State $u \gets u'$; $v \gets v'$; $u' \gets f(u)$; $v' \gets f(v)$
\EndWhile
\Return $(u, v)$
\Comment{$u = x_{\mu - 1}$, $v = x_{\mu - 1 + i}$}
\end{algorithmic}
\end{algorithm}

The first loop stops at the least with , the least multiple of that is at least , so and if and only if . In the second loop, after steps, and ; since , first holds at , where lies on the tail and on the cycle. So for every and the algorithm returns a collision of if and only if , after evaluations of , and stores elements of — standard.

For a uniformly random and any fixed , each is a fresh uniform value as long as are distinct, so , and by ,

For , given , the value is uniform on , so with probability , and then is uniform on and equals with probability ; hence and . The rho search therefore finds a collision of a uniformly random with probability at least , with fewer than evaluations of in expectation and memory — standard.

For with , a collision of on is a collision of . When is a random oracle, is a uniformly random function on and the bounds hold with : expected queries, as for the birthday attack, but memory in place of stored pairs. For a fixed , applying the random-function analysis is a heuristic — standard. Pollard’s methods for factoring and discrete logarithms run such a search on a walk built from the instance (TODO: cite Pol75 and Pol78 here, and Floyd’s algorithm). For the discrete-logarithm walk, with its partition of the group into three sets chosen uniformly at random, which forfeits the memory, the walk in a cyclic group of odd order repeats an element after at most expected steps from every starting element, with no heuristic — KMPT10 (Theorem 4.2). TODO: parallel collision search with distinguished points (van Oorschot–Wiener, J. Cryptology 1999).