Как проверить sha256 windows

Хэш или контрольная сумма файла — короткое уникальное значение, вычисляемое из содержимого файла и обычно использующееся для проверки целостности и соответствия (совпадения) файлов при загрузке, особенно если речь идет о больших файлах (образы системы и подобные), которые могут быть скачены с ошибками или есть подозрения о том, что файл был подменен вредоносным ПО.

На сайтах загрузок часто бывает представлена контрольная сумма, вычисленная по алгоритмам MD5, SHA256 и другим, позволяющая сверить загруженный файл с файлом, выложенным разработчиком. Для вычисления контрольных сумм файлов можно использовать сторонние программы, но есть способ сделать это и стандартными средствами Windows 10, 8 и Windows 7 (требуется версия PowerShell 4.0 и выше) — с помощью PowerShell или командной строки, что и будет продемонстрировано в инструкции.

Получение контрольной суммы файла средствами Windows

Для начала потребуется запустить Windows PowerShell: проще всего использовать поиск в панели задач Windows 10 или меню Пуск Windows 7 для этого.

Команда, позволяющая вычислить хэш для файла в PowerShell — Get-FileHash, а чтобы использовать ее для вычисления контрольной суммы достаточно ввести ее со следующими параметрами (в примере вычисляется хэш для образа ISO Windows 10 из папки VM на диске C):

Get-FileHash C:\VM\Win10_1607_Russian_x64.iso| Format-List

Вычисление контрольной суммы sha256

При использовании команды в таком виде, хэш вычисляется по алгоритму SHA256, но поддерживаются и другие варианты, задать которые можно с помощью параметра -Algorithm, например, для вычисления контрольной суммы MD5 команда будет выглядеть как в примере ниже

Get-FileHash C:\VM\Win10_1607_Russian_x64.iso -Algorithm MD5 | Format-List

Контрольная сумма MD5

При этом поддерживаются следующие значение для алгоритмов вычисления контрольной суммы в Windows PowerShell

  • SHA256 (по умолчанию)
  • MD5
  • SHA1
  • SHA384
  • SHA512
  • MACTripleDES
  • RIPEMD160

Подробное описание синтаксиса команды Get-FileHash доступно также на официальном сайте https://technet.microsoft.com/en-us/library/dn520872(v=wps.650).aspx

Получение хэша файла в командной строке с помощью CertUtil

Получение хэша файла в CertUtil

В Windows присутствует встроенная утилита CertUtil для работы с сертификатами, которая, помимо прочего, умеет высчитывать контрольную сумму файлов по алгоритмам:

  • MD2, MD4, MD5
  • SHA1, SHA256, SHA384, SHA512

Для использования утилиты достаточно запустить командную строку Windows 10, 8 или Windows 7 и ввести команду в формате:

certutil -hashfile путь_к_файлу алгоритм

Пример получения хэша MD5 для файла показан на скриншоте ниже.

Получение контрольной суммы MD5 в CertUtil

Дополнительно: на случай, если вам требуются сторонние программы для вычисления хэшей файлов в Windows, можно обратить внимание на SlavaSoft HashCalc.

Если же требуется вычислить контрольную сумму в Windows XP или в Windows 7 без PowerShell 4 (и возможности его установить), вы можете использовать утилиту командной строки Microsoft File Checksum Integrity Verifier, доступную для загрузки на официальном сайте https://www.microsoft.com/en-us/download/details.aspx?id=11533 (формат команды для использования утилиты: fciv.exe путь_к_файлу — результат будет MD5. Также можно вычислить хэш SHA1: fciv.exe -sha1 путь_к_файлу)

how to check sha256 checksum windows 10

Verifying a SHA256 checksum on Windows 10 is straightforward. It ensures that the file you downloaded has not been tampered with or corrupted. You can do this by using the built-in Command Prompt tool. Open Command Prompt, navigate to the directory containing your file, and use the certutil command followed by the file name. This will generate and display the SHA256 checksum, which you can then compare to the original checksum provided.

This step-by-step guide will walk you through the process of checking a SHA256 checksum on a Windows 10 computer. By the end, you’ll be able to confirm the integrity of any file you download.

Step 1: Open Command Prompt

First, open the Command Prompt on your Windows 10 computer.

You can do this by typing «cmd» in the search bar next to the Start menu and hitting Enter. Alternatively, press Win + R, type «cmd,» and hit Enter.

Step 2: Navigate to the File Location

Once the Command Prompt is open, navigate to the directory containing the file you want to check.

You can do this by typing «cd» followed by the directory path. For example, if your file is in the Downloads folder, type cd Downloads and hit Enter.

Step 3: Enter the certutil Command

Now, use the certutil command to generate the SHA256 checksum.

Type certutil -hashfile filename SHA256 and hit Enter. Replace «filename» with the actual name of your file, including its extension.

Step 4: Compare the Checksums

After running the certutil command, the checksum will be displayed.

Compare this checksum with the one provided by the source from where you downloaded the file. If they match, your file is intact. If not, the file may be corrupt or tampered with.

What Happens Next

Once you’ve checked the SHA256 checksum, you’ll know if your file is secure and unaltered. Matching checksums confirm that the file you have is exactly what was intended by its creator. A mismatch suggests the file could be corrupt or compromised, and you should avoid using it.

Tips for How to Check SHA256 Checksum Windows 10

  • Verify Source: Always get the original checksum from a trusted source.
  • Check Regularly: For critical files, make it a habit to always check the checksum.
  • Be Cautious: If the checksums don’t match, do not use the file.
  • Use Shortcuts: Create a batch file to speed up the process if you frequently check checksums.
  • Documentation: Keep a record of checksums for important files for future reference.

Frequently Asked Questions

What is a SHA256 checksum?

A SHA256 checksum is a unique string of characters created by a cryptographic hash function, used to verify data integrity.

What is certutil?

Certutil is a command-line tool that’s part of Windows, used for certificate services, and it can also generate checksums.

Is it safe to use Command Prompt?

Yes, using Command Prompt is safe as long as you follow trusted instructions and do not run unfamiliar commands.

Can I use other tools apart from certutil?

Yes, there are third-party tools like HashMyFiles and QuickSFV that can also verify checksums.

What if my checksums don’t match?

If checksums don’t match, do not use the file. It may be corrupt or have been tampered with.

Summary

  1. Open Command Prompt.
  2. Navigate to the file location.
  3. Enter the certutil command.
  4. Compare the checksums.

Conclusion

Checking the SHA256 checksum on Windows 10 is quick and crucial for ensuring file integrity. By following these simple steps, you can confidently verify that the files you download or receive are safe and unaltered. Always remember to compare the checksum with the one provided by the original source. If there’s a mismatch, it’s a red flag that something might be wrong with the file. For further reading, you might want to explore more about cryptographic hashes and their role in digital security.

So, the next time you download a file, take a few extra seconds to verify its SHA256 checksum. It’s a small step that can save you from potential headaches down the line. Happy computing!

Kermit Matthews is a freelance writer based in Philadelphia, Pennsylvania with more than a decade of experience writing technology guides. He has a Bachelor’s and Master’s degree in Computer Science and has spent much of his professional career in IT management.

He specializes in writing content about iPhones, Android devices, Microsoft Office, and many other popular applications and devices.

Read his full bio here.

This guide shows you how to check the MD5 or SHA256 checksum (or other hashing algorithms) of any file in Windows 11 or Windows 10 using only Command Prompt or Windows Terminal.

What is checksum and why do we use it?

A checksum is a unique set of numbers and letters generated for a file using a hash algorithm such as MD5 or SHA-256 (the most commonly used checksum algorithms) to verify if the file has not been modified during transmission (e.g. downloading the file).

Most software vendors display the checksum of their downloadable files (such as installers and zip files) so that users can check the integrity of the file using the checksum after download. This is to ensure that the file has not been altered in any way during transfer.

How to Verify MD5 SHA256 Checksum Windows 11

After downloading a file, you can generate the checksum of the downloaded file and see if it matches the checksum provided by the software vendor. If it matches, this means that there were no errors or alternations during the transfer and that the files were identical before and after the transfer.

See also: How to Compare Two Folders in Windows 11

How to check MD5 or SHA256 checksum of a file in Windows 11

To verify the MD5 checksum or SHA256 checksum of a file in Windows 11, follow the steps below.

  1. First, right-click the file you want to verify the checksum for and select “Copy as path“. You will need this path later.
    Copy as path Windows 11

  2. Next, open Command Prompt (search for “CMD” via Start) or Windows Terminal (right-click Start and select Windows Terminal).
    Open CMD Windows 11

  3. To check the MD5 checksum of a file, type the following command in the Command Prompt or Windows Terminal window.
    certutil -hashfile filepath MD5

    Replace filepath with the actual path to the file that you want to check the checksum for. You can highlight the filepath and press Ctrl + V to paste the path you’ve copied in step 1. For example:

    certutil -hashfile "C:\Users\alvin\Desktop\testing.txt" MD5

    MD5 Checksum Windows 11

    To check the SHA256 checksum of the file, replace MD5 with SHA256. For example:

    certutil -hashfile "C:\Users\alvin\Desktop\testing.txt" SHA256

    SHA256 checksum Windows 11

  4. Press Enter to execute the command. The checksum of the file will then be shown.

Related: How to Password Protect a Folder in Windows 11

Verify different checksum algorithms

To check the checksum of a file using a different hashing algorithm, replace the MD5 in the command line with the checksum algorithm that you want to use. The following are the hashing functions that the certutil command-line tool supports.

  • MD2
  • MD4
  • MD5
  • SHA1
  • SHA256
  • SHA384
  • SHA512

What to do if the checksums do not match?

If the checksum of the file you generated on your computer do not match the one provided by the software vendor, it indicates that the file is corrupted, incomplete or has been altered.

In most circumstances, if the checksums do not match, you should not open the file because the data may have been tampered with and could pose a security risk if you run the file.

  • If you suspect that the file is corrupted or incomplete, try to download the file again from the same source.
  • If the checksum still does not match on your second try, you may want to contact and notify the source from which you download the file. The cause of the problem may be on their side.
  • Try to download the file from a different trusted source.
  • Clear your browser’s cache (if you use your browser to download the file) and history before downloading the file again. This is to ensure that the browser will request new download from the source again instead of re-downloading the corrupted file from your browser’s cache.
  • Before you re-download the file, delete the old one whose checksum does not match.

Проверка контрольной суммы скачанного файла позволяет проверить его целостность и убедиться, что содержимое файла не было изменено. Чаще всего администраторы используют процедуру проверки чексуммы для загруженных дистрибутивов ОС и установочных образов ПО.

Идея контрольной суммы заключается в том, что для оригинального файла выполняется расчет некоего значения (хэша) по определенному алгоритму получения хэш-функции (чаще всего это MD5, SHA1 и SHA256), а пользователи потом могут выполнить такую же проверку для файла, который они скачали. Сравнение этих двух значений хэшей позволяет убедиться, что вы получили не модифицированный оригинальный файл. Если хэши файлов отличаются, значит файл был изменен или поврежден.

Для проверки контрольной суммы файла в Windows можно использовать встроенный PowerShell командлет Get-FileHash или утилиту certutil.

Например, чтобы получить значение хэша ISO образа, выполните команду:

Get-FileHash "F:\ISO\en-us_windows_10_enterprise_ltsc_2021_x64_dvd_d289cf96.iso"

Get-FileHash проверка хэш суммы ISO файла

Черех некоторое время (расчет может занять некоторое время в зависимости от размера файла), командлет вернет контрольную сумму файла по алгоритму SHA-256 (по умолчанию). С помощью атрибута
-Algorithm
можно задать другой алгоритм вычисления контрольной суммы

  • SHA1
  • SHA256
    (по умолчанию) – наиболее популярный алгоритм с наименьшей вероятности возникновения коллизий (когда два разных файла имеют одинаковую контрольную сумму)
  • SHA384
  • SHA512
  • MD5
    – самый быстрый, но устаревший алгоритм хэширования

Аналогично можно получить хэш сумму файла с помощью certutil.exe:

certutil -hashfile F:\ISO\en-us_windows_10_enterprise_ltsc_2021_x64_dvd_d289cf96.iso SHA256

certutil -hashfile SHA256

Где получить контрольные суммы оригинальных ISO файлов образов Windows?

Если у вас есть учетная запись Microsoft, вы можете найти контрольную сумму интересующего вас дистрибутива на сайте https://my.visualstudio.com/Downloads/. Для этого не обязательно иметь активную подписку MSDN. Информация о контрольной сумме образа доступна на вкладке с информацией о продукте.

просмотр хэшей образов Windows в visualstudio.com

Также список всех оригинальных образов от Microsoft и их хэшей доступен в следующей сторонней онлайн базе https://files.rg-adguard.net/search. В отличии от сайта Microsoft, здесь можно искать сразу по значению хэша. Выполните поиск по полученному хэшу, чтобы убедиться, что вы скачали оригинальный файл образа.

база данных ISO образов microsoft и их хэшей

Регистр символов в хэш сумме не имеет значения.

Для автоматизации проверки хэш сумму скачанного образа с оригинальным значением, можно использовать такой однострочник PowerShell:

((get-filehash .\ en-us_windows_10_enterprise_ltsc_2021_x64_dvd_d289cf96.iso).hash) -eq "c90a6df8997bf49e56b9673982f3e80745058723a707aef8f22998ae6479597d"

сравнить хэш ISO файла с оригинальным

Команда вернет
True
, если контрольная сумма файла совпадает с эталонной.

After downloading a file from our site, you may want to verify its SHA-256 checksum to ensure the downloaded file’s integrity.

What is an SHA-256 checksum?

You can think of a checksum as a fingerprint of a file.

Here’s an example of a checksum:

f7efd7168f50fd6b574c1d948779ac1cc3d70afcc95c5757ff82f57bfa06b194

Every file has a unique checksum that you can use to ensure its integrity. In other words, you can verify the file’s checksum to ensure the file you downloaded is exactly the file you want and that it was not corrupted or modified in any way.

SHA-256 is a name for one of the hash algorithms you can use to generate a checksum.

What You Need To Remember

There are two things you need to remember while generating checksums of our files:

  • All checksums in Rublon Downloads are generated using the SHA-256 algorithm. If you use a different algorithm to generate your checksum, e.g. SHA 1, it will produce a different result. Always generate an SHA-256 checksum.

  • For checksums, capitalization does not matter, e.g. A and a are the same. These two strings are the same checksum:

    F7EFD7168F50FD6B574C1D948779AC1CC3D70AFCC95C5757FF82F57BFA06B194

    f7efd7168f50fd6b574c1d948779ac1cc3d70afcc95c5757ff82f57bfa06b194

How to verify an SHA-256 checksum?

To verify the SHA-256 checksum of a file, you must generate a checksum of the downloaded file and compare it to the checksum in Rublon Downloads.

Find the instructions below to learn how to generate a checksum of a file on your operating system.

Windows

You can use Command Prompt or PowerShell to generate a SHA-256 checksum on Windows.

Using Command Prompt

1. Press Windows+R to open the Run box

2. Type cmd and click OK.

3. The Command Prompt window will open.

4. Run the following command:

certutil -hashfile C:\file\path\my_file.exe SHA256

Make sure to replace C:\file\path\my_file.exe with the actual path to the file.

5. Compare the generated value to the checksum of the file in Rublon Downloads.

Using Power Shell

1. Press Windows+R to open the Run box

2. Type powershell and click OK.

3. The Windows PowerShell window will open.

4. Run the following command:

Get-FileHash C:\file\path\my_file.exe -Algorithm SHA256

Make sure to replace C:\file\path\my_file.exe with the actual path to the file

5. Compare the generated value to the checksum of the file in Rublon Downloads.

Linux

Every Linux distribution comes with tools for various checksum algorithms. SHA-256 checksum tool is called sha256sum.

1. Go to the directory where your downloaded file is stored, e.g.:

cd home/downloads

2. Use the following command to generate the checksum:

sha256sum my_file.exe

Make sure to replace my_file.exe with the actual name of the file.

3. Compare the generated value to the checksum of the file in Rublon Downloads.

macOS

1. Click the Launchpad icon in the Dock, type Terminal in the search field, then click Terminal.

2. Use the following command to generate the checksum:

shasum -a 256 /file/path/my_file.exe

Make sure to replace /file/path/my_file.exe with the actual path to the file

3. Compare the generated value to the checksum of the file in Rublon Downloads.

Helpful Links

Rublon Downloads

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows server 2012 datacenter активатор
  • Как запустить средство восстановления windows через командную строку
  • Windows 10 compact rutracker
  • Oblivion не запускается на windows 11
  • Opendiagfree для windows 10