A birthday attack is a cryptanalytic technique. Birthday attacks can be used to find collisions in a cryptographic hash function. For instance, suppose we have a hash function which, when supplied with a random input, returns one of $k$ equally likely values. By repeatedly evaluating the function on $1.2\sqrt(k)$ different inputs, it is likely we will find some pair of inputs that produce the same output (a collision).
Birthday attacks are a class of brute-force techniques used in an attempt to solve a class of cryptographic hash function problems. These methods take advantage of functions which, when supplied with a random input, return one of k equally likely values. By repeatedly evaluating the function for different inputs, the same output is expected to be obtained after about $1.2\sqrt(k)$ evaluations.
A simple approach of finding a collision in a hash function is to look for a second preimage:
- An initial value $I$ is picked and the hash $H_I$ is calculated.
- Further values are picked and their hash is compared to $H_I$.
An attack based on the birthday paradox is more efficient to find a collision: It compares the new hash value of each round with all the hash values that have been calculated earlier.