Validate the Hash or Checksum of a Downloaded File

Every once and a while I want to validate the hash of a downloaded file. Most of the time these are MD5 hashes, but I’ve seen SHA as well.

Windows actually has a couple built in ways of generating the hash of a file. You can use certutil or, in powershell you can use get-filehash.

With Certutil

To verify a checksum with certutil use the following command: certutil -hashfile {FILENAME} {ALGORITHM} replace the FILENAME and ALGORITHM with your choices.

With get-filehash

This is my preferred method. No reason, maybe I like the order of arguments better?

Use get-filehash -algorithm {ALGORITHM} {FILENAME}.

That’s it!

Leave a Reply

Your email address will not be published. Required fields are marked *