Tags

, ,

An MD5 (Message digest algorithm-5) checksum value ensures that the digital integrity and security of a file has not been broken by someone else and also that it is the accurate copy of the original file.

Thus, there are the two main reasons if the MD5 hash value of a file you downloaded does not match against the original sum:

  1. The file might be modified by someone else in an unauthorized way.
  2. The file was not downloaded properly and some of its elements might have been corrupted.

The MD5 checksum or hash value of a file might look like this:

  • 88c95273193f35c1f298f46e3341308a

You can easily check the MD5 Hash of any file on your Mac, all you need to do is launch the Terminal and type the ‘md5′ command as shown below:

Example :

$ Md5 xcode_5.dmg

You’ll be returned with an MD5 Checksum Hash that you can check against the source MD5 code provided to you during download. It will look something like this:

MD5(xcode_5.dmg)= 88c95273193f35c1f298f46e3341308a

The part after the = sign is the MD5 hash code that you can compare against the source to be sure that the file has retained it’s integrity through transmission. Very handy when downloading large files!

The host will provide an MD5 checksum, which is a hash of the raw file data that you can use to compare and see if any of the data was corrupted, changed, or lost during the download process.

Alternatively you can use the openssl command to check MD5 checksums on your Mac, like so:

openssl md5 xcode_5.dmg

MD5 (xcode_5.dmg) = 88c95273193f35c1f298f46e3341308a

The data returned to you will be the same whether you use the openssl command or the md5 command as shown in the above image.