MD5之前有多少个随机元素产生碰撞? [英] How many random elements before MD5 produces collisions?
问题描述
我需要担心MD5哈希值中的冲突获得生产?
奖金:在我开始看到MD5产生的散列值发生冲突之前,我可以拥有多少个文件?
我需要担心MD5哈希值中的冲突获得生产?
奖金:在我开始看到MD5产生的散列值发生冲突之前,我可以拥有多少个文件?
/www.wolframalpha.com/input/?i=2%5E128rel =noreferrer>这就是 1分340秒undecillion 282 decillion 366 nonillion 920 octillion 938 setillion 463 sextillion 463 quintillion 374 quadrillion 607兆431亿但是如果你保留所有的哈希值,那么感谢生日悖论。要有50%的机会与任何其他散列相冲突,您需要 2 64 散列。这意味着要平均发生碰撞,您需要散列 6亿欧元每秒 100年。
I've got an image library on Amazon S3. For each image, I md5 the source URL on my server plus a timestamp to get a unique filename. Since S3 can't have subdirectories, I need to store all of these images in a single flat folder.
Do I need to worry about collisions in the MD5 hash value that gets produced?
Bonus: How many files could I have before I'd start seeing collisions in the hash value that MD5 produces?
Probability of just two hashes accidentally colliding is 1/2128 which is 1 in 340 undecillion 282 decillion 366 nonillion 920 octillion 938 septillion 463 sextillion 463 quintillion 374 quadrillion 607 trillion 431 billion 768 million 211 thousand 456.
However if you keep all the hashes then the probability is a bit higher thanks to birthday paradox. To have a 50% chance of any hash colliding with any other hash you need 264 hashes. This means that to get a collision, on average, you'll need to hash 6 billion files per second for 100 years.
这篇关于MD5之前有多少个随机元素产生碰撞?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!