TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Hash Algorithm Strength

1 pointsby dxjonesalmost 16 years ago

1 comment

jibikialmost 16 years ago
Normally when people talk about the birthday paradox, they mean "it is surprisingly likely that some two students in a classroom will have the same birthday" rather than "it is surprisingly likely that some student will have the same birthday as the teacher."<p>Anyways, let's say h is a hashing function, and x = h(a), where I know x but not a. I want to find b so that h(b) = h(a). Let's say that for a random b, we have P(h(a)=h(b)) = p. Then it is quite easy to compute that the expected number of tries to find b with h(a)=h(b) is 1/p.<p>(In particular:<p><pre><code> E(#of tries) = (p)(1) + (1-p)(p)(2) + (1-p)(1-p)(p)(3) + ... = p(1/p)(1/p) = 1/p. )</code></pre>