Internet Windows Android

How to calculate the hash sum of a folder. How the hash sum of a file is determined and compared

Each file has its own unique value that can be used to validate the file. This value is called a hash or checksum. It is often used by software developers when accessing files. The file is verified using the checksum to determine its integrity and matches the specified identifier.

There are several algorithms for calculating the checksum of a file, among which the most famous and common are MD5, SHA256, SHA1, SHA384. You can calculate the hash of a file, that is, its checksum, using both standard Windows tools and third-party services. In this article we will look at how to do this.

Table of contents:

How to find out the hash of a file via the command line

The command line in Windows allows you to perform various actions, both with the system itself and with individual files. Through it, you can determine the checksum of files using the built-in CertUtil utility.

To find out the hash of a file via the command line, just enter the following query into the command line:

Certutil -hashfile *path to file* *algorithm*

Instead of *path to file* you need to enter the full path to the file. For example: d:\8.jpg

Instead of *algorithm* you need to enter the name of the algorithm by which you want to calculate the checksum. The CertUtil utility can calculate a checksum using the following algorithms: MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512.

By executing the specified command, you will be able to see the file hash calculated using the CertUtil utility.

How to find out the hash of a file using the PowerShell utility

Another utility built into Windows that can determine the checksum of a file is PowerShell. It differs from CertUtil by supporting a larger number of algorithms for calculating the checksum: SHA256, MD5, SHA384, SHA1, SHA512, MACTripleDES, RIPEMD160.

To check the hash through the PowerShell utility, use the following command:

Get-FileHash *path to file* | Format-List

Instead of *path to file* you must specify the full path to the file whose checksum is being checked.

It is important to note that by default the PowerShell utility calculates the checksum using the SHA256 algorithm.

If you want to use a different algorithm, you must specify this in the command when executing the request. For example, to determine a hash using the MD5 algorithm, you will need to run the command:

Get-FileHash *path to file* -Algorithm MD5 | Format-List

Instead of MD5, you can specify other algorithms supported by the utility.

How to find out the hash of a file using the HashTab utility

In addition to Windows tools, you can use third-party applications to determine the checksum of a file. For example, one handy program that can determine the hash of a file is HashTab. This is an extremely simple application that can be downloaded for free from the Internet.

After downloading the HashTab program and installing it, a new tab is created in the file properties, which is called “File Hash Sums”. In this tab you can see the checksum calculation for a file in various algorithms.

A hash is an individual unique code that corresponds to a specific unit of information, a mathematically calculated image of a specific file. When a file undergoes any modification, the hash sum of this file changes accordingly.

After downloading files from the Internet, especially ISO disk images of various products, it is a good idea to compare the hash of these files with the one published by the manufacturer of these products in order to determine whether the files have been subject to any changes (introduction of third-party programs, viruses, etc.). d.).

In most cases, information about the hash sums of a file is provided by the developer to the user on the website after describing its characteristics or system requirements.

By checking the hash code, the file is protected from modification. Its verification is especially relevant when downloading operating system disk images not from the manufacturer’s website, but from so-called file exchangers and torrent trackers.

If a checksum mismatch is detected, it is better to think 100 times before using the disk in this way. You may ask, how can you find out the checksum of a file in the Windows operating system?

HASH SUM

I will answer, there is such a small and at the same time free program called HashTab, which is integrated into Windows Explorer and will help you easily determine the hash sum (checksum) of the file you downloaded in order to verify its authenticity and integrity. The program can be downloaded from the official website at:

Http://implbits.com/products/hashtab/HashTab_v6.0.0.34_Setup.exe

where after going to the site you need to click on the “Download Now!” button.

In the field that appears, enter your email address, to which an email will be sent with a link to download the program, and click the “Send Download Link” button.

We check the mail and see a letter that provides the URL where we can download the program, the size of the program and its checksum.

Download the program, specifying the folder.

Extract the program installer from the archive and launch it by double-clicking the left mouse button. In the installer window that opens, click on the “Next” button.

In the next window, we agree to the license by clicking on the “I Agree” button.

Select the folder to install the program (it’s better to leave it as default) and click the “Install” button.

We complete the installation by clicking the “Finish” button.

CHECK SUM

Upon completion of installation, the program is integrated into the context menu of the operating system Explorer. To display the checksum of a file, we need to right-click on it and click on “Properties”.

In the window that opens, click on the “File hash sums” tab.

For large files, you may need to wait a few seconds for the hash calculation to progress.

Upon completion of the calculation, in the “Hash Value” window we will see the checksum for the file.

In the “Settings” of the program, you can add additional hash sums displayed and configure it in more detail (I leave it at default).

In order to compare the checksum of a disk image (in my case), I go to the official website and look for where the hash sum of the image is indicated (on the site I find the posted file “MD5SUMS”).

I open this file and look for the checksum for my disk image (this is ubuntu-12.10-desktop-i386.iso).

I copy it from the site.

I paste it into the “Hash Comparison” field in the “File Hash Sum” tab of my disk image and see a green checkmark indicating that the checksum of the file completely matches the checksum of the disk image on the official website.

You can check the hash sum of 2 files in another way by clicking on the “Compare file” button, selecting the file we need in Explorer and clicking on the “Open” button, and look at the result.

In this way we try to protect ourselves from using modified versions of files.

So, you've spent a lot of time downloading the Windows 7 image, and now you want to make sure that not a byte is lost along the way. Or the distribution package was brought to you by the good fairy, and you want to check if it is connected with pirates. To determine the integrity of the distribution, you will need two things - a checksum and a program to check it.

Windows 7 image checksums

Microsoft publishes their product checksums on MSDN or TechNet, specifying SHA1 as the hash type. Find the language version and edition of your Windows 7 and click Intelligence to see the checksum.

That's half the battle.

Checksum verification using the File Checksum Integrity Verifier utility

Microsoft, of course, has its own command line utility for calculating and verifying file checksums - File Checksum Integrity Verifier(fciv.exe). It can be downloaded from KB841290 (where the syntax is also described in detail), or via a direct link (41 kb). Next, I assume that you know where the utility is unpacked and where the Windows 7 ISO image is saved.

It is enough to execute one command in the command line (Start - Search - cmd):

<путь к утилите>\fciv.exe -sha1<путь к ISO>\filename.iso

For example, if the utility is on the desktop and the ISO image is in the root of drive D, the command will look like this:

%userprofile%\desktop\fciv.exe -sha1 D:\en_windows_7_ultimate_x86_dvd_x15-65921.iso

And the result is the checksum of the file:

If you do not specify the parameter -sha1, the utility will calculate the MD5 hash.

As you can see, everything is very simple! You can use this method to verify the MD5 or SHA1 checksums of any files.

Checksum verification using HashTab program

If the command line scares you, there is an easier way to check the checksum.

  1. Download and install the program.
  2. Right-click on the image file and select Properties.
  3. Go to the "File Hashes" tab.

While exploring the internet or before downloading certain files, you may come across the mysterious MD5, SHA-1 and SHA-256 parameters, also known as hashes. What at first appears to be just a random string of letters and numbers is actually a unique key that allows you to verify the authenticity of files and see if they have been altered or tampered with.

What are hash sums and what are they for?

A hash is the result of cryptographic algorithms designed to create a set of numbers and letters. It is also called a “digital fingerprint”. Typically these sets have a fixed length and number of characters, regardless of the size of the input information. For example, “WP” and “WP-SEVEN” will have hash amounts of exactly the same size. The length of the sum depends only on which hashing algorithm you are checking. For example, SHA1 will produce a sum of 40 characters, and MD5 only 32.

Also, note that although there is minimal difference between “WP-SEVEN” and “WP-SEVEM”, the hash sums are completely different and have nothing in common. This means that even if someone changes the file by even 1 bit (roughly speaking), the end result will get a completely different hash sum. This makes the hash a convenient way to verify the authenticity of a file. The publisher indicates the original amount, and the user checks the result and compares it with the original.

Hashing is carried out using various standards. Often these are MD5, SHA-1 and SHA-256. All three algorithms work differently, but the concept is the same. We will not go into the operating principle of each algorithm here, since this is very complex information, but we will only provide general information necessary for the average user.

How to check hash in Windows 10

Any desktop operating system, be it Windows 10, Linux or MacOS, has standard mechanisms for checking the hash sums of any files on your disk.

How to find hash in PowerShell


PowerShell will give you a hash of your file. By default, Windows generates a SHA-265 hash, but you can specify that you want a hash of a different algorithm. To do this, use the following commands:

  • Get-FileHash F:\Test.txt -Algorithm MD5
  • Get-FileHash F:\Test.txt -Algorithm SHA1
  • Get-FileHash F:\Test.txt -Algorithm SHA256
  • Get-FileHash F:\Test.txt -Algorithm SHA384
  • Get-FileHash F:\Test.txt -Algorithm SHA512
  • Get-FileHash F:\Test.txt -Algorithm MACTripleDES
  • Get-FileHash F:\Test.txt -Algorithm RIPEMD160

How to check hash sum via Command Line

Many of the things you do in PowerShell can be done in the classic command line. Checking the hash via the Command Line is done as follows.


By default, Command Prompt displays the hash sum SHA1 , but you can change this by telling the system exactly what hash you want to receive. To do this, use the following commands:

  • certutil -hashfile F:\Test.txt MD5
  • certutil -hashfile F:\Test.txt MD4
  • certutil -hashfile F:\Test.txt MD2
  • certutil -hashfile F:\Test.txt SHA512
  • certutil -hashfile F:\Test.txt SHA384
  • certutil -hashfile F:\Test.txt SHA256
  • certutil -hashfile F:\Test.txt SHA1

How to check hash using HasTab

HashTab is a great little utility that will make checking hashes a breeze. You won't have to enter complex commands every time to check. It will be enough just to go to the properties of the file, where all the amounts will already be collected.

Additionally, HashTab makes it easy to compare the hash sums of two files. To do this, right-click on the first file and select Properties and then open the tab File hashes. Click Compare file and specify the path to the second file.

The hash sum of the second file will be displayed in the field Hash comparison, and if the amounts match, there will be a green check mark next to the hash icon. If they do not match, there is a red cross.

In our digital age, even one measly byte can cost a lot. If the ISO image file is missing even a byte, then the benefit of such a file will be doubtful. At one point, when you want to install a new operating system for yourself, the process will be interrupted at a certain stage of the installation, due to the fact that the image turned out to be broken. Therefore, any ISO file should be scanned for integrity before burning it onto a blank. Thus, you save your precious time and warn yourself against ridiculous incidents that arose in the process of using discs on which this or that ISO image was recorded. And one more important point: a broken ISO image can be due to a reason beyond your control - for example, the file itself was uploaded by the author already broken. And also due to the instability of your Internet connection, which ultimately led to the loss of data when downloading a file to your computer.

To scan the checksum of an ISO image, you should follow the following steps sequentially. There is no point in describing it in detail, since the program is quite simple and does not require deep knowledge or a serious description. However, let's take it step by step:

  1. We search on the World Wide Web for the HashTab program (or a similar program designed to check checksums (or hashes) of ISO images), download it to your computer and install it. You can download the program, for example, from here http://www.softportal.com/get-19546-hashtab.html, or from the official website. The installation process is quite simple and does not require description;
  2. Next, right-click on the ISO image file and select “Properties” from the pop-up context menu, where the new tab created by the HashTab program will be located;
  3. Go to the “File hash sums” tab, the hash sum of the downloaded file will be indicated there. This sum is a checksum for the file that you downloaded and even if it is not complete, it will still have a checksum;
  4. We copy the hash sum from the description of the ISO file (usually, the checksum of the ISO image is indicated in the topic from which you download the file, and the checksum must also be present on the reverse side of the disk if the image is copied from the disk and if the disk is licensed), paste it in the “Hash comparison” field and click the “Compare file...” button.

Ready! This way we will know if the checksums match and make sure the ISO image is ready for burning. If the checksums differ, then you need to download the ISO file again and check its integrity again. If it turns out that the ISO image downloaded again is still broken, then it’s better for you to look on the Internet for another image, preferably from a different author.

The most interesting thing is that the HashTab program is available both for users of the Windows operating system and for MacOs connoisseurs. Therefore, HashTab is a universal tool for checking ISO image checksums. And even if you have several computers with different operating systems installed, you will be much more comfortable using one software rather than searching for separate programs designed for different operating systems. There are quite a few similar solutions on the Internet, which allows you to choose among an abundance of almost identical programs, differing from each other only in the interface. However, all of these programs are quite simple and not very broad in terms of their functionality, so no matter what you choose, it will all be about the same. Good luck to you and the integrity of the information!