On the internet you can download a lot of files, but when it comes to know whether the file is from the official source or to ensure that the file has not been modified, you need to perform an integrity check.


Many websites provide a hash for file they have on the server. To make sure the file you downloaded is the same as the one on the official site, you need to compare the hash on the official site with the hash you find on the file you downloaded to make sure it’s identical. If the hash is the same, you can confirm that the file has not been tampered with or modified.


There are many ways to verify hash on your operating system (OS) like Windows Command Prompt, Windows PowerShell, third party program and online hash file calculator. Lots of free hash file calculator available on Windows, MacOS, Linux and other operating system.


To verify the hash on Windows 10, you can use the certutil command in the command prompt, Get-FileHash in PowerShell, online hash calculator or use third-party software to perform the integrity checks.


How to check file integrity in Windows 10 with command prompt

Go to the Windows 10 search bar, type cmd, and then click Command Prompt. Or

Simultaneously press Windows key and R key to open run, type cmd, and then press Enter.

The command to view the hash of a file with certutil using the Windows command prompt or Windows PowerShell: certutil -hashfile FileName algorithm

To view the hash of the Haitian-coffee.pdf file with the SHA256 algorithm, in the Command Prompt window, type the command below and then press Enter.

certutil -hashfile Haitian-coffee.pdf SHA256


To view the hash of the Haitian-coffee.pdf file with the SHA512 algorithm, in the Command Prompt window, type the command below and then press Enter.

certutil -hashfile Haitian-coffee.pdf SHA512

Now compare the hash of the file with the hash on the official site.


Note: Add your filename and file path if it is not in the same folder, add SHA256 or SHA512 depending on the hash algorithm used on the file but remember that there are other hash algorithms on the market like SHA-3, xxHash, MD5, Blake3, CRC32, etc. Also, other thing you need to know, if you edit the file, you will get a new hash value.


How to check file integrity in Windows 10 using PowerShell

To get hash of a file using the PowerShell utility, use certutil or Get-FileHash. For example, to get the hash of the file Haitian-coffee.pdf with algorithm SHA256, type the command below and then press Enter.

certutil -hashfile Haitian-coffee.pdf SHA256


Or

Go to the Windows 10 search bar, type powershell, and then click Windows PowerShell in the search result. Or Simultaneously press Windows key and R key to open run, type powershell, and then press Enter.

In the Windows PowerShell window, type the command below and then press Enter.

Get-FileHash Haitian-coffee.pdf

In the above command, SHA256 algorithm is used without explicitly added in the command. By default Get-FileHash uses SHA256 algorithm, but if you need information for a different algorithm, for example SHA512, use the command below and press Enter.

Get-FileHash -Path FileName -Algorithm SHA512

Note: Remember to add the filename, and the path to the file if you are not working in the same folder.


How to check hash value of a file online

You can also use an online service like the md5file website to calculate the file hash online. When you are on the website, check the algorithm for which you want to find the information and drag and drop your file into the “Drop files here or click to select” section or click “Choose files” to add your file. When you are done, you will have all the information display on the web page.


How to check hash value of a file with QuickHash

If you prefer a Graphical User Interface (GUI) application on your computer, you can use an application like QuickHash which is open source, free and available for Windows, Linux and Apple Mac OSX. The interface of the QuickHash tools is simple and self-explain that contains multiple tabbed, like Text, File, FileS, Copy, Compare Two Files, etc.

For example, with the File tab selected, choose your hash algorithm for your hash, add your hash value in the “Expected Hash Value” box, then drag and drop your file to the appropriate section at the top.


How to calculate file hash with 7-zip

Locate the file whose hash you want to view, right click on it, select “CRC SHA“, then click on the algorithm you want to find the hash. If you want to find hash information for all algorithms available in the app, choose the asterisk.


How to Verify a GPG Signature in Windows 10

If you have not yet installed Gpg4win on your computer, click Bookmark to open the links database.

Type Gpg4win in the search box.

Click Gpg4win in the search result to open the Gpg4win website in a new tab.

Download Gpg4win, verify the hash with one of the previous methods that I have already described in this post, and then install the program on your computer.

When the installation of Gpg4win is complete, go to the website where you want to download your files.


Download your file and the OpenPGP signature that came with the file.

Go to the Windows 10 search bar, type cmd, and then click Command Prompt. Or

Simultaneously press Windows key and R key to open run, type powershell, and then press Enter.

Enter the folder where you have the file you want to verify and the key signing.

The command to verify file with gpg using the Windows command prompt or the Windows PowerShell: gpg –verify File-Signature FileName

To verify haitian-independence.zip file with haitian-independence.zip.asc signature, in the Command Prompt window or the PowerShell window, type the command below and then press Enter.

gpg --verify haitian-independence.zip.asc haitian-independence.zip

What To Read Next


If you like the content of this post or if it has been useful to you, please consider sharing it on your social media and follow me on Facebook and Twitter for more exclusive content.