My Stoopid Stuff
  • Home
  • Projects
  • Blog
  • Lec'tronics
  • Links
  • CNC
  • Quick Recipes
  • 3D Printer Tips
  • Voron 2.4

How to check the MD5 or SHA hash on a file from Windows using the built-in certUtil

2/15/2019

0 Comments

 
Putting this here since I keep having to look it up.  Windows has a built in command line utility to check the MD5 or SHA1 hash on a file.  That can be useful to check the integrity of a file downloaded from a site that provides the info for the expected MD5 or SHA1 hash (such as sourceforge).  

The idea is that an algorithm is run against the original file, which spits out a long number - which is the "hash".  That number is posted on the site where the file is downloaded from, along with info on if the hash was generated with MD5 or SHA1, SHA256 or SHA512, so anyone can then run the same algorithm against the file they have, to generate the same number/hash.  Comparing the downloaded hash to the hash posted on the site tells you if the file that was downloaded is correct or not. 

So, when I download a file, I can check that the file is in tact and as intended, by running that algorithm against the file I have to see if the "hash" is the same as the one on the site.  If they are the same, then the file is good, if not then the file is bad and I should re-download it.  This is not something that is normally an issue, but when downloading new router firmware which is just a hex file, it is a good idea to verify the integrity of the new file before loading it.  

To do this with windows:

Type "cmd" in the search field under the start menu
When the window opens, first go to the directory where the file resides, start with the drive letter, then "cd" to the directory:

C:\Users\SomeUser>F:
F:\>
F:\>cd \Downloads
F:\Downloads>


Then run the command "certUtil" to get the checksum of the file:

SHA1:
certUtil -hashfile SomeFileName SHA1

SHA256:
certUtil -hashfile SomeFileName SHA256

SHA512:
certUtil -hashfile SomeFileName SHA512

MD5:
certUtil -hashfile SomeFileName MD5

The numbers that it spits out can then be compared to the MD5 or SHA1 hashes on the website where the files were downloaded from.  The spaces can be ignored, they are only for readability, since the numbers are normally without spaces.
0 Comments



Leave a Reply.

    Picture

    Stoopid Me

    Welcome to my Stoopid corner of teh Internet.  It's mostly gonna be 3D printing stuff, but I also post some recipes, projects, and the occasional rant here as well.  More Stoopid stuff is updated regularly.

    I recently joined the Amazon Associate program, so some of the links on this site are Amazon affiliate links. This means that, at zero cost to you, I will earn an affiliate commission if you click through the link and finalize a purchase.  This will help to support this site, and pay for more Stoopid Stuff.

    Currently, there are no active authorized sellers of my designs.  If you see my stuff (such as my Dummy 13 Weapons) for sale on Amazon, Etsy or AliExpress, the seller is using my designs without permission.

    If you want to help out with my parts and filament budget, you can also "Buy Me A Coffee" using the link below.
    ​​

    Buy Me A Coffee

    Archives

    March 2025
    February 2025
    January 2025
    December 2024
    November 2024
    October 2024
    September 2024
    August 2024
    July 2024
    June 2024
    May 2024
    April 2024
    March 2024
    February 2024
    January 2024
    December 2023
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    April 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    November 2017
    September 2017
    August 2017
    June 2017
    December 2016
    October 2016
    September 2016
    July 2016
    March 2016
    February 2016
    September 2015
    August 2015
    June 2015
    May 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    July 2014
    June 2014
    May 2014
    April 2014
    March 2014
    February 2014
    November 2013
    August 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    January 2013
    December 2012
    November 2012
    October 2012
    September 2012
    August 2012

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.