MD5 is a widely used cryptographic hash function with a 128-bit hash value. It is commonly used to check the integrity of files.
If you downloaded a file from the web and the file owner provided a MD5 hash (checksum) then you can compare the hash of the downloaded file with the hash provided by file owner. So you will know you have got the exact copy of the file without any error. And of course you can provide MD5 hash for your own files if you want.
In Windows I use an open source software HashCheck for MD5 hash verification and creation.
Download HashCheck from here and install it.
1, MD5 hash verification
HashCheck is a shell extension for Windows Explorer, it will add a “Checksums” tab to the shell’s file properties dialog so that you could easily check the hash of a file from Windows Explorer.
In the following example I checked the hash of Joomla_1.5.6_to_1.5.9-Stable-Patch_Package.zip file with HashCheck.
As you can see in the above screenshots my copy of Joomla upgrade patch is correct.
If the file owner provides the MD5 hash stored in a checksum file such as file.md5, just double-click on the checksum file, and HashCheck will check it.
2, Checksum file creation
You can also create hash/checksum file of your files with HashCheck.
Select the files and directories that you want to hash and create a checksum file for, right-click on them, and select “Create Checksum File”. Double-click on the created checksum file and you will see the hash(es).
HashCheck supports the CRC-32 (in SFV format), MD4, MD5, and SHA-1 algorithms.
1, MD5 hash verification
In Linux the verifying process is more easy.
Open a terminal and type:
Press enter and you will see the MD5 hash. Compare it with the MD5 hash provided by the file owner.
In my case:
4e9e98fb058253f6f87d54fbcacf8466 /home/laja/Downloads/Progik/Joomla_1.5.6_to_1.5.9- Stable-Patch_Package.zip
The MD5 hash: 4e9e98fb058253f6f87d54fbcacf8466
My copy of Joomla upgrade patch is correct, look at the screenshot of my Ubuntu desktop:
If the file owner provided the MD5 hash stored in a file such as file.md5, you can simply verifying the MD5sum:
md5sum -c /your/directory/file.md5
If it is correct, it will produce this output:
Note: make sure that the file and the corresponding .md5 checksum file are downloaded in the same directory otherwise the test will fail.
2, Hash/checksum file creation
If you want to provide hash value of your file, it is simple:
This command generates a 32-bit MD5 hash value of “yourfile”, press enter and you will see the hash (this is a sample output only):
If you want to store the MD5 hash in a checksum file, open a terminal and go to the directory where your file is located:
Create the checksum file:
md5sum yourfile > yourfile.md5
and make a test verification:
md5sum -c yourfile.md5