How to calculate collision probability using md5?

I have keys that can range from 1 to 256 characters *

; how can I calculate the probability that any two keys will collide when using md5 (forbidding brute force to test each key)?

*

limited character set [a-z.-]

0


a source to share


2 answers


Check out the Birthday Paradox to help you analyze this. In short, since MD5 is a 128-bit hash, you need 2 elements of 64 before the chance of collision rises to 50%. There's an assumption there that MD5 is spread evenly across this 128-bit space, which I believe it doesn't, but comes close.



If you want to get an idea of ​​how these numbers overlap with your key space, let's say all your keys are 256 characters, you have 26,256 possible keys, or 2 1023, and of course you have a 100% chance of collisions after 2 128 : )

+4


a source


Pay attention to the birthday problem . This is exactly what you are looking for.



+2


a source







All Articles