40

Is there a built-in method for computing an SHA-1 or MD5 hash in Windows 7?

7
  • superuser.com/questions/89191/…
    – akira
    May 14, 2011 at 9:04
  • I'd support incorporating sha1 into the title of the other question and closing this one May 14, 2011 at 16:51
  • This question is not a duplicate of superuser.com/questions/89191/… . That question is asking for shell integration only, no command line.
    – wisbucky
    Apr 22, 2015 at 1:55
  • 2
    This solution is not exactly built-in to Windows 7, but if you already have Git Bash (msys/mingw) installed, it includes md5sum command line
    – wisbucky
    Apr 22, 2015 at 2:11
  • 5
    powershell get-filehash -algorithm sha1 <file_to_check> May 22, 2015 at 20:59

7 Answers 7

32

There is no built-in utility, however Microsoft provides a command-line utility as a free download:

Availability and description of the File Checksum Integrity Verifier utility

2
  • 7
    This is not quite true anymore. PowerShell 4 adds the Get-FileHash command. (About time, isn't it?) Although, to be fair, PowerShell 4 is only installed in the very newest Windows operating systems right now, but upgrading is extremely reasonable on older OSes. (PS4 has a LOT of other nice things, too.)
    – jpmc26
    Sep 15, 2014 at 0:11
  • One major caveat: fciv fails for filenames containing unicode characters.
    – wisbucky
    Oct 2, 2017 at 18:19
19

No built-in tools.

I use the HashCheck shell extension:

alt text

4
  • This is my favorite because it's a kernel extension (dunno if they still use that terminology). Been using it for years. Jun 5, 2013 at 23:36
  • Any way to get SHA-256 hashes with this?
    – max
    Aug 23, 2014 at 4:06
  • 1
    @DavidCowden: What is benefits of implementing such feature as a kernel extension compared to a application working solely on userspace. Doesn't that potentially unstable the OS?
    – Isaac
    Dec 14, 2015 at 8:39
  • @Isaac I miss spoke. In old Windows terms it's a shell extension, not kernel extension. The benefit is that it adds the ui right into windows explorer so you can, as the image shows, view the checksums and hashes right in the file's properties window. It's pretty neat! Dec 28, 2015 at 11:23
11

It's not exactly built-in, but at least you don't have to download any new software to make it work. You can create a powershell script to compute the MD5sum of files. The actual script can be found here:

http://www.ahmadsoft.org/powershelljunkie/index.html

Copy that text into a file called something like, "ps-md5sum.ps1" and save it somewhere. When you need to compute the hash of a file, open up PowerShell in the directory of the file you need to check, and then run it:

[PS] C:\> ps-md5sum.ps1 file-of-choice.exe

And it should return the hash of that file.

1
6

There's nothing built-in. Might I suggest using HashTab?

6

Again, nothing built in, so I use HashCalc.

HashCalc Screenshot

0
5

Arpoon Checksum is also nice, as it doesn't require installation

Arpoon Checksum - Main Screen

4

In addition to all the great options already posted, there's also md5deep/hashdeep, an open source hash calculation suite for Windows (but can also be used in *nix and OS X systems) that supports:

  • MD5
  • SHA-1
  • SHA-256
  • Tiger
  • Whirlpool

Some advantages of md5deep/hashdeep:

  • It's open source and cross-platform.
  • It runs from the command-line and can be used for scripting.
  • It has optimized binaries for both 32-bit and 64-bit systems.
  • It supports modern hashing algorithms (MD5 and SHA-1 are both broken at this point for verifying file integrity and digital signatures since collisions can already be produced for MD5 with relative ease and SHA-1 collisions are increasingly within the realm of possibility).
  • It can recursively generate checksums for an entire directory.
  • It can test a file or directory against a previously generated list of checksums to perform a quick audit of the directory (identifying unknown files or files which have been altered).

To use it in Windows, you can either install it in Cygwin or you can just include the md5deep directory in your %PATH% variable. Though I personally prefer the following setup:

  1. Extract all files somewhere, e.g.

    %ProgramFiles%\md5deep

  2. Create a set of batch files in your windows directory, e.g.

    %WinDir%\md5.bat
    %WinDir%\hash.bat
    %WinDir%\sha1.bat
    %WinDir%\sha256.bat
    %WinDir%\tiger.bat
    %WinDir%\whirlpool.bat

  3. Include the path to the appropriate binaries, e.g.

    In md5.bat:
    @ECHO OFF
    "%ProgramW6432%\md5deep\md5deep64.exe" %* (64-bit systems)
    "%ProgramFiles%\md5deep\md5deep.exe" %* (32-bit systems)

    In hash.bat:
    @ECHO OFF
    "%ProgramW6432%\md5deep\hashdeep64.exe" %* (64-bit systems)
    "%ProgramFiles%\md5deep\hashdeep.exe" %* (32-bit systems)
    ...

Or if you want to automatically switch between the 32-bit and 64-bit binaries for WoW64, you can put the 32-bit binaries in %ProgramFiles(x86)% and the 64-bit ones in %ProgramW6432%, and then write your batch files like this:

@ECHO OFF
SET cmd=hashdeep
IF "%ProgramFiles%" EQU "%ProgramW6432%" SET cmd=%cmd%64
"%ProgramFiles%\md5deep\%cmd%.exe" %*
0

Not the answer you're looking for? Browse other questions tagged .