File Hashing Is Built Into Windows

I always used to download the md5sum.exe and sha1sum.exe files when I needed to generate a file’s hash in Windows.  I just discovered that certutil.exe, included with Windows 7 and Windows Server 2008 R2, will do this for you (I’m not sure if it was included in earlier versions of Windows).  Just use the following commands to generate the appropriate hash:

  • MD5:  certutil -hashfile C:\Windows\notepad.exe MD5
  • SHA1:  certutil -hashfile C:\Windows\notepad.exe SHA1
  • SHA256: certutil -hashfile C:\Windows\notepad.exe SHA256
  • SHA512: certutil -hashfile C:\Windows\notepad.exe SHA512

Note that it defaults to SHA1 if you do not specify a hashing algorithm.