Check MD5 Hash on your Mac

Oct 13, 2009 - 11 Comments

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:

md5 big_huge_file.iso

You’ll be returned with an MD5 Checksum Hash that you can check against the source MD5 code provided to you (or that a friend shares, or whatever). It will look something like this:

MD5(big_huge_file.iso)= 20665acd5f59a8e22275c78e1490dcc7

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!

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

openssl md5 big_huge_file.iso

The data returned to you will be the same whether you use the openssl command or the md5 command, it’s really just a matter of preference.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Bill Ellis in How to, Tips & Tricks

11 Comments

» Comments RSS Feed

  1. DogsRULE says:

    the only reason to use MD5 on a Mac is for torrents

  2. Woodgie says:

    Nope, it isn’t.

    I regularly use it to check if 2 files that outwardly look the same (same size etc.) are actually the same. I’ll also use it (or to be more accurate, SHA1, the same as the hint above. Just substitute SHA1 for MD5 in the openssl command) as a quick and easy way to verify to people that attachments I’m eMailing them have not been tampered with. It’s the same basic theory as using a digital signature.

    Then you have http://support.apple.com/kb/DL930 and the like. Yep, Apple themselves use SHA1 (which is really just a ‘more accurate’ version of MD5 (yes, I KNOW how wrong that comment actually is!) to verify the contents of updates to the OS.

    It’s also used by online retailers and things like the Fink package manager. I could go on but I realise quite how boring I can be :-)

    So no, not just torrents.

  3. [...] more here: Check MD5 Hash on your Mac You can follow any responses to this entry through the RSS 2.0 feed. You can leave a [...]

  4. [...] unofficially at 4% worldwideSnow Leopard Incompatible Software List from AppleMessiest Desktop Ever?Check MD5 Hash on your MacWarning! Obscure Snow Leopard bug deletes entire user accounts!MacBook Keyboard Backlight Controls [...]

  5. [...] Mac’s checking the md5 hash is very easy, just use the md5 command line tool. You can do this on your Mac to check the md5 hash [...]

  6. Alex says:

    Yeah DogsRULE, you are right, there were a lot of people in the develop of the MD5, SHA1 (etc) hashes just for people to be able to download torrents.
    That’s the only use.

    I’ll give you another use, just to enlighten you, I use the MD5 to check on daily basis if my web site files were modified. This way, if there is a hacking attact to my site, I find out before Google banns my site.

    Another use? if you are making changing to your system, and want to know what files were changed by another process, you can relay on before/after md5 hashes

    Also, every piece of software available for download should publish a md5 hash or similar, so if you downloaded a whole Linux Distro, you can check if the download is good before you burn a DVD and try to install it.

  7. fribbley says:

    hey DogsRULE: you’re an idiot. In a couple years, if you make it to high school you might learn about being a big boy and keeping your fool mouth shut when you have no idea what you’re talking about.

  8. Petur says:

    I made a GUI program which does the same… http://itunes.apple.com/us/app/id465533447?mt=12

  9. Monberg says:

    Sweet! Coming to Mac from Windows i was a bit intimidated by the lack of all my usual (GUI) tools. But diving into the power of Term is a really rewarding experience. It sometimes makes me wish that i didn’t grow up with Windows…

  10. World's Fattest Man says:

    I am so fat i can’t check the MD5 of iAtkos L1.DMG

  11. [...] loop is usually best handled in a few different ways. Before beginning, you may want to check the md5 hash or SHA1 of the origin file if possible, that can easily tell you if the file was corrupted or is [...]

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates