This question already has an answer here:

I'm pulling a “Dave” and I'm designing my own hashing algorithm. Not that I intend to use it, I'm not certifiable or anything, I just want the challenge of creating something. I'm not going to get into exactly what I'm doing, because it's probably worthless anyway. I just wanted some advice on how to calculate the chance of collisions.

So, if anybody can enlighten me on how to calculate the probability of collisions happening, I'd greatly appreciate it.


marked as duplicate by Squeamish Ossifrage, kelalaka, Ella Rose Mar 10 at 15:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    $\begingroup$ You mean probability that collisions happen due to weaknesses in your design? Because generally (without cryptanalysis) the probability of finding one is good after $2^{-n/2}$ calls for digest length $n$. $\endgroup$ – SEJPM Aug 11 '15 at 17:42
  • 6
    $\begingroup$ ... because of the birthday problem. I guess what SEJPM is saying is that the calculation of the probability of collisions that are happening because of the internal design depends on the internal design. $2^{-n/2}$ is just the lower bound (where $n$ is the output size). $\endgroup$ – Maarten Bodewes Aug 11 '15 at 18:11