Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Security

The RIPEMD-160 Cryptographic Hash Function

Antoon Bosselaers, and

, January 01, 1997


Dr. Dobb's Journal January 1997: Examining the Birthday Paradox

Dr. Dobb's Journal January 1997

Examining the Birthday Paradox


Consider the following question: If we have a group of 23 people, what is the probability p that at least two of them have the same birthday? The answer can be computed by looking at the problem in a different way: We compute the probability that they all have a different birthday (this probability is equal to 1-p). The first person can have his or her birthday on any day; for the second person, there are 364 days left out of 365 possible birthdays (we ignore leap years); for the third person, there are 363 days left out of 365, and so on. For the 23rd person, there are 343 days left out of 365.

The probability that all these birthdays are different is equal to the product of these probabilities, or

Thus we find p = 0.493. This probability is much higher than our intuition suggests. The explanation of this paradox is that there are only 23 people, but 2322/2 = 253 pairs of people.

How can this now be applied to finding collisions for hash functions? For a hash function with an n-bit result (typically n = 128 or 160), we have a space of size 2n (this corresponds to the 365 days in the year). If we evaluate the hash function for r inputs, we have t = r(r-1)/2 pairs of strings. The probability that the two strings in a pair are identical is 1/(2n). So if t equals about 2n, we expect to find one pair with identical strings. This corresponds to r 2n/2. So for a hash function with a 128-bit result, the effort to find a collision is only about 264 evaluations of the hash function, which is the square root of the effort to find a preimage. It turns out that clever algorithms allow us to find these solutions without having to store this huge number of strings.

-- A.B., H.D., B.P.


Copyright © 1997, Dr. Dobb's Journal


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.