开发者

Algorithm Complexity & Security: MD5 or SHA1?

开发者 https://www.devze.com 2023-01-01 12:54 出处:网络
Which is the best overall hashing algorithm in terms of complexity and security? md5 or sha1? From what I know md5 is 开发者_StackOverflow中文版faster than sha1 but SHA1 is more complex than md5.

Which is the best overall hashing algorithm in terms of complexity and security? md5 or sha1?

From what I know md5 is 开发者_StackOverflow中文版faster than sha1 but SHA1 is more complex than md5.

Am I missing anything?


First of all, MD5 is broken - you can generate a collision, so MD5 should not be used for any security applications. SHA1 is not known to be broken and is believed to be secure. Other than that - yes, MD5 is faster but has 128-bit output, while SHA1 has 160-bit output.

Update: SHA1 has been broken: a team of researchers at Google and CWI have published a collision - https://shattered.io/static/shattered.pdf


Here is the comparison between MD5 and SHA1. You can get a clear idea about which one is better.

Algorithm Complexity & Security: MD5 or SHA1?


MD5 is not suitable for use for with any sort of sensitive information. Collisions exist with the algorithm, and there have been successful attacks against it.

At the time of this update (3/2017) SHA-2 is now preferred.

When ever you embark on securely dealing with information, it is recommended that you check the latest guidelines.

0

精彩评论

暂无评论...
验证码 换一张
取 消