Ask a question »

md5sum - Check integrity of downloads

May 2015


[md5sum] Check integrity of downloads



Introduction



A small tutorial for the program "md5" or "md5sum" commonly called "checksum".

The md5sum utility is use to calculate what is called the fingerprint of a file. ( the checksum is a value of 128 bits corresponding to a checksum calculated from the archive).

An MD5 checksum is not intended to guarantee the provenance of a file or file group. His interest is to verify the integrity of retrieved data. Indeed, no one is immune from disturbance or a network problem which results in the corruption of an archive is being downloaded.

Windows

Using command line


First download version for Windows
  • Unpack the archive into a folder at the root of 'C'. In our example we will name "md5sum".
  • Open a console MSDos.
  • Start> Run>
  • Type cmd (W2K or XP) or command (on Win98) and press [Enter] on your keyboard.
  • Change to the directory containing the"md5.exe" file in command line.


C:\> cd md5sum [Enter] 



If however you were not at the root of your hard drive, type: cd then [Enter].

C:\md5sum> 


Make sure the "md5.exe" file is there:

C:\md5sum>dir /w /p [Enter] 


[.]            [..]           index.html     main.c   
md5.c          md5.exe        md5.gif        md5.h   
md5.vcproj     rfc1321.html   rfc1321.txt   
              11 file(s)          157 564 bits   
               2 Dir(s)   6 791 827 456 bits libres




Then run the following command:

md5 'The_complete_path_to_your_Iso_image' [Enter] 


Example:
Assuming that our image file is in "D: \ image_isoSmoothwall"

C:\md5sum>md5 D:\image_isoSmoothwall\smoothwall-2.0-metro.iso [Enter] 


After a few seconds you should have the following result:

D0AB11311B866B2332E92479906F2FF9 D:\Linuximage_isoSmoothwall\smoothwall-2.0-metro.iso  

Use the "-n" if you do not want to have the name and path of the image displayed after the comparison:
C:\md5sum>md5 -n D:\image_isoSmoothwall\smoothwall-2.0-metro.iso [Enter]

D0AB11311B866B2332E92479906F2FF9 



You just have to compare the result obtained with the "md5.txt" file, or "iso.md5 ..." or even "... iso.md5.asc", downloaded along with your "iso" image.

Another method is to place the program "md5" or "md5sum" (depending on the program downloaded) in one of the following directory:
  • C:\windows\command\ (for Windows 95/98/Me)
  • C:\winnt\system32\(for Windows 2000)
  • C:\windows\system32\ (for Windows XP, Vista et 7)


You can from this point call the "md5" or "md5sum" command (from the MSDos command prompt) directly from the directory containing the .iso image.

Example:
D:\image_isoSmoothwall>md5 -n smoothwall-2.0-metro.iso [Enter]

D0AB11311B866B2332E92479906F2FF9 

Via a graphical user interface "GUI"

mst MD5


Download MST MD5


Once installed, launch it, a small GUI will open prompting you to:

"Simply drag the file on this window to see the MD5 checksum"


That's it. You have nothing else to do but wait (less than a minute at most, depending on the size of the file).

WinMD5


Download WinMD5
  • Select the file to be checked,
  • Click on [Calculate]
  • Copy the key that was provided into the comparaison field.
  • Click [Compare] to compare the different values.
  • The result is displayed in a window confirming the authenticity of the file scanned.

Other software


GNU/Linux

In console mode


The md5sum usually comes (by default) with most distribution. If, however,it is not present, refer to the following address to download a compressed archive:

Under GNU/Linux, all you have to do is to go to the directory containing your file to verify and type the following command:
  • $md5sum filename [Enter]. 


The result should appear after a few seconds as follows (same as in Windows):
  • D0AB11311B866B2332E92479906F2FF9 filename 



If you don't want to go to the directory containing the file to be checked, you can also specify a path like this:
  • $md5sum /home/user/download/filename [Enter]  


Note that:
Remember to use the "completion" (press the TAB key) to complete your command lines.

Via a Graphical User Interface


There is a project called Parano offering a GUI for the creation/editing/checking MD5 or SHA-1 under Gnome.

The project seems to be discontinued, but still it may be helpful

Generate a MD5 sum


For Windows and GNU/Linux

To generate an MD5 sum, you must simply perform the same operation as the verification, namely:

md5sum filename [Enter]

Note:
The filename can be any type of file (archive, images, text, iso, executable, etc.. etc..).

On Windows, the command is not always present natively.

If you want to create a text file (my_file_md5sum.txt), you must redirect the output of the md5sum command to the text file itself instead of standard output, namely the screen. Use the redirector ">", common to Windows and GNU/Linux.

filename md5sum> my_file_md5sum.txt [Enter]



Original FAQ by jipicy on CCM!
For unlimited offline reading, you can download this article for free in PDF format:
Md5sum-check-integrity-of-downloads.pdf

See also

In the same category

md5sum: Verificar la integridad de las descargas
By Carlos-vialfa on April 17, 2008
MD5Sum - Verificar a integridade do download
By ninha25 on August 13, 2009
Original article published by jipicy. Translated by jak58. - Latest update by jad05
This document entitled « md5sum - Check integrity of downloads  » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.