A checksum is a series, unique string derived from a digital file for the purpose of detecting errors that may have been introduced during its transmission or injected by malware. It’s one of the most effective ways to verify the integrity of the file you download from the internet to make sure the file is not tempered in any way. The most commonly used algorithms used to generate the checksum are MD5 and SHA family (SHA1, SHA256, SHA384, and SHA512). Obviously, The higher bit used in the algorithm, the better.
To use a checksum to verify a file’s integrity, you need to get the original checksum from the source that provides the file first. And then, compare it to the one you generate from the downloaded file using the same algorithm. If both strings match, the downloaded file hasn’t changed. But if not, something has happened to the file to corrupt the file. In that case, redownloading the file will be the best practice for you.
Now, the question is, how do I generate the checksum of the file I downloaded?
Here are 5 ways that will help you overcome this gap and do the job relatively easy for you.
A command-line way
CertUtil is a Windows built-in command line installed as part of certificate services, but it also offers a switch -hashfile that allows you to generate the hash string using a specified algorithm. For example, running the following command generates an SHA-512 checksum for an executable file called lsr.exe.
certutil -hashfile z:\desktop\lsr.exe SHA512
A PowerShell way
In PowerShell 4.0, there is a new cmdlet called Get-FileHash that lets you generate the file hash without any coding involved.
Get-FileHash -Path z:\desktop\lsr.exe -Algorithm SHA512
From the right-click context menu
Hash Generator is a tool that adds a new item in the context menu that lets you easily generate hashes for any given file.
3rd Party tools
If command-lines are not your thing, here are 3 free tools that can also do the job very well.
Hash Generator
Hash Generator is the FREE universal hash generator tool which automates the generation of 14 different type of hashes or checksums. It supports most of the popular hashes including MD5 family, SHA family, BASE64, LM, NTLM, CRC32, ROT13, RIPEMD, ALDER32, HAVAL, WHIRLPOOL, etc.
MD5 & SHA Checksum Utility
MD5 & SHA Checksum Utility is a tool that allows you to generate CRC32, MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of single or multiple files. You can also verify hashes with the matching file to ensure the file integrity is correct.
HashMyFiles
HashMyFiles is another small and portable tool from NirSoft that also displays the hashes for CRC32, MD5 and the SHA family (SHA1, SHA256, SHA384, and SHA512). If you need to check the hashes for a bunch of files, HashMyFiles is your best friend.
A tab from File’s properties
HashTab is a free tool that adds a separate tab in File Properties dialog box to display the hash strings for any given file. It would be my go-to tool if it offered more algorithms for SHA family. SHA-1 is apparently not enough these days to ensure the integrity of the file.
HashMyFiles works from context menu, and performs comparison of clipboard contents with final calculated hashes. This is a fast way to copy known good hash into clipboard and check to see it if matches one of the calculated hashes via content menu.
i think Hash Generator is already a 3rd party tool – wrong section. (but it might be a command line tool.)
HashTab has several more options (which might not have been available at the time of the article):
SHA-256 or SHA3 are also part of the list.
Just press settings and choose which you want to check.
According to Windows Defender, HashGenerator is infected with trojan virus.
Caught by Windows Defender:
https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?name=Trojan%3aWin32%2fBluteal.B!rfn&threatid=2147727314
After further investigation
https://www.joesandbox.com/analysis/48746/0/executive
Interesting, I just downloaded again on my Windows 10 and scanned it through Windows Defender. It wasn’t caught.
Thank you.
It was simple to get the md5 using the powershell get-filehash that you mentioned here.
The best is by far HashCheck which you can find at: https://github.com/gurnec/HashCheck
However, I stumbled upon this article looking for a replacement as the HashCheck version I was using was the original from 2009 as I didn’t realise it had been updated by someone else on github.
Please take a look at it as it runs through the context menu and you can compare to a copied checksum easily.
*** UPDATE! *** It’s a shame the article fails to mention the Settings feature in HashTab, already pointed out by Sergio, but missed by untold many. Since it shows in the screenshot, I suspect the feature has been there all along.
I have loved MD5 & SHA Checksum Utility for years, but have always wished for a context-menu option. If it exists, I’ve never found it. I just tried HashTab and although when pitted directly against my former favorite it did run a very few seconds slower on huge files, it is a great time saver.
THERE ARE NO FEWER THAN 30 HASH FORMATS TO CHOOSE FROM! For ease of use, though, you may wish to select something small for your first run, possibly just a .txt file, to get to the Settings. See, it takes off scanning immediately, and I had started with a 4.2GB file… that left me unable to set preferences until it had finished, then had to run it again after selecting the five I wish to check against. (I did realize later that I could have canceled the scan, but was thinking it would close the entire Properties window.)
Despite one little weakness, lack of portability, it is a fabulous program. I would also still prefer to access a scan from the top level of a right-click, but going at it via Properties is nonetheless a very logical thing. Just copy the supposed HASH from the download site, into the Hash Comparison box, and you are set.
I hope this helps, and that the article might also be updated.
Blessings!
FH
I forgot to mention that, after one scan finishes, you can then click on Compare a file, which gives you a browser window, where you can select another to check against the first.
I’ll be surprised if anyone regrets trying this program. It’s a keeper for me!
FH