M BUZZ CRAZE NEWS
// news

What is the difference between md5sum and sha1sum

By Jessica Wood

I use the following two commands to get the checksum of text file, but it gives me two different checksums, why?

md5sum log
sha1sum log
0

1 Answer

md5sum and sha1sum implement two different hashing algorithms, MD5 and SHA-1 respectively, so the outputs will be different.

Note that, md5sum generates 128 bit hash whereas sha1sum generates 160 bit hash.

As a side note, both of them are considered cryptographically insecure now. Consider using SHA-2 family of hashes e.g. sha512sum for any implementation that requires much robustness. Although just for checking the integrity of file(s), they can be considered usable.

Also check man md5sum, and man sha1sum.

Video explaining checksums.

8

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy