Algorithm complexity and security: MD5 or SHA1?

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

From what I know, md5 is faster than sha1, but SHA1 is more complex than md5.

Did I miss something?

+42
algorithm hash
Jun 01 '10 at 8:14
source share
3 answers

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

Update: SHA1 was broken: a team of researchers from Google and CWI published a clash - https://shattered.io/static/shattered.pdf

+48
Jun 01 '10 at 8:16
source share

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

enter image description here

+16
May 15 '16 at 6:04
source share

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

During this update (3/2017), SHA-2 is now preferred.

When you start working safely with information, it is recommended that you check the latest recommendations.

+6
Jun 01 '10 at 8:24
source share



All Articles