Put simply, a checksum (also referred to as a hash value or hash sum) Is a unique string consisting of numbers and letters, that helps check & Identify errors In data. It's also used to determine whether a given file has been tampered with, by comparing the checksum of the original file to that of a file from another source. In this tutorial, I will show you how to generate a number of checksum algorithms natively within Windows.
Before I begin, here's what I'm referring to In terms of verifying the Integrity of a file. I've navigated to the official MySQL website, and next to each download button, there's an MD5 checksum as Illustrated below.
Downloading from the official website Is considered a trusted source, however when doing the same from another website, you never know for sure whether the file Is what It claims to be. To be absolutely certain, you'd generate (In this case) an MD5 checksum of the file you've downloaded, and compare the result with that from the official website. If they match, all Is well. If not, then the file has been altered In some way.
There are a few checksums used- the commonalities being MD5, SHA1 and SHA256. I will be demonstrating how to generate all these against a particular file, by using a couple of Windows built-In utilities named PowerShell and Certutil. So without further delay, let's rip Into this tutorial.
Firstly, I shall use PowerShell. To access It, open the Run menu, enter powershell and hit OK.
PowerShell will now open, so type Get-Filehash but do not hit the Enter key as yet. Drag the file that you wish to check Into PowerShell. For the purpose of this guide, I'm using a file named Charny Screenshot.exe as shown below
You will now see your file, Inclusive of It's directory. Make sure there's a space between the Get-Filehash command and the file path, otherwise this will not work. When you're ready, hit Enter.
By default, PowerShell generates a SHA256 hash. This can be clearly seen as arrowed.
To generate another hash algorithm, simply enter -Algorithm right at the end, and specify the checksum. For Instance, I want to generate an MD5 checksum, so I've entered -Algorithm MD5, and hit Enter. As you can see, the result has been returned.
I've done the exact same with the SHA1 algorithm, as demonstrated below.
Now let's generate a couple, by using Certutil. This Is actually accessed via the Command Prompt, so open the Run menu, enter cmd and hit OK.
Now type certutil -hashfile, and drag your file Into the Command Prompt, much the same as you did In Step Two above with PowerShell. Your entry should look similar to mine.
Upon hitting the Enter key on your keyboard, by default, Certutil generates a SHA1 hash as arrowed below.
To generate another type of hash algorithm, simply enter It at the end. In my case, I want to generate an MD5 hash algorithm, so I've typed MD5.
After hitting the Enter key, as you can see, the MD5 hash of the file, has been successfully generated.
It doesn't get any easier than this, does It? I could've shown you how to generate a given file hash by typing the entire directory of the file In question, but simply dragging It Into the utility (PowerShell and/or Certutil), serves the exact same purpose.
There are many third-party tools, such as Hash Generator that do the job with ease, but why use an external software when the same result can be achieved natively within Windows? So the next time you download a file from an unknown source, be sure to generate It's hash via any of the above methodologies, and compare the result with the official website (or It's related entity).