MD5之前有多少个随机元素产生碰撞? [英] How many random elements before MD5 produces collisions?

查看:168
本文介绍了MD5之前有多少个随机元素产生碰撞?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Amazon S3上有一个图像库。对于每张图片,我都会在我的服务器上添加源URL以及时间戳以获取唯一的文件名。由于S3不能有子目录,因此我需要将所有这些图像存储在一个单独的文件夹中。



我需要担心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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆