Professional Documents
Culture Documents
Validating The MD5 Checksum of A File
Validating The MD5 Checksum of A File
Validating The MD5 Checksum of A File
Linux
Tweet
Share
Email
When you download a large file such as a Linux distribution in the form of an ISO you should
validate it to make sure that the file downloaded properly—free of errors or unauthorized
modifications.
Developers of large files like ISOs run those completed images through a program to generate an
MD5 encrypted file. This method provides a unique checksum, which is a fingerprint of the file.
Thus, you download the ISO and then run a tool that creates an MD5 checksum against that file.
The checksum that is returned should match the one located on the website of the software
developer.
Most Linux distributions provide either an SHA or MD5 checksum for their ISO images. One
distribution that uses the MD5 checksum method of validating a file is Bodhi Linux.
Standard
AppPack Release
Legacy Release
Download two files: The Bodhi Linux ISO, available at the download link, and the MD5 file.
You'll compare the checksum you see in the MD5 file with the checksum you'll get in a shell
session.
1. Download the ISO itself by clicking on the Download link just under the Standard
Release section.
3. Open the MD5 file in a text editor. The contents look something like this:
ba411cafee2f0f702572369da0b765e2 bodhi-4.1.0-64.iso
2. Open your downloads folder by typing cd Downloads. If you saved the files in a
different location, go there instead.
3. Type certutil -hashfile followed by the file name and then MD5.
4. Check that the value returned matches the value the MD5 file you downloaded from the
Bodhi website (and opened in Notepad).
5. If the values don't match then the file is not valid and you should download it again.
1. Open a shell session then visit the directory where you downloaded the files.
2. Enter md5sum followed by the file name.
3. The value displayed by the md5sum command should match the the value in the MD5
file.
Considerations
The md5sum method of checking the validity of a file only works as long as the site you are
downloading the software from hasn't been compromised.
In theory, it works well when there are lots of mirrors because you can always check back
against the main website.
However, if the main site gets hacked and a link is provided to a new download site and the
checksum is changed on the website then you are basically being hoodwinked into downloading
something you probably don't want to use.
If the file's checksum doesn't match the value in the supplementary download file, you know that
the file was corrupted in some way. Try re-downloading it. If several attempts fail, notify the
owner of the file or the administrator of the site that serves it.
CertUtil is a pre-installed Windows utility that can be used to generate hash checksums:
So for example, the following generates an MD5 checksum for the file
C:\TEMP\MyDataFile.img:
To get output similar to *Nix systems you can add some PowerShell magic:
$(CertUtil -hashfile C:\TEMP\MyDataFile.img MD5)[1] -replace " ",""