HowTo Verify a MD5 sum

From OFSET Wiki

Jump to: navigation, search

To understand what a MD5 sum is, you can visit Wikipedia.

This sum is computed from the sequence of bytes found in a file. As it is way shorter thant the file itself, there may be collisions : more than one file can have the same MD5 sum. However the probability of generating two different files with the same sum by random means is very very low. So the sum is readily used to verify that no random modification has occured when a file has been copied, up- or downloaded.

Provided you use GNU/Linux, the program md5sum is hopefully already installed, since it is intensively used by each distribution to check its consistency.

[edit] Checking an ISO file

When a file and its md5 sum are in the same directory, named as freeduc-x.y.iso and freeduc-x.y.iso.md5 for instance, the command to check their consistency is:

md5sum -c freeduc-x.y.iso

[edit] Checking the MD5 sum of a disk (CD-R, CD-RW, etc.)

The byte sequence of the disk is readable through a particular device file, for example it may be /dev/cdrom for your main CDROM drive. When you know the name of this device file, you may rebuild the MD5 sum from it (you need read access to this file).

Here is the command to build the MD5 sum from the disk in a main CDROM drive:

md5sum /dev/cdrom > /tmp/cdrom.md5

When this sum is computed, you may compare the text in the original MD5 sum and the new one : just watch at the contents of /tmp/cdrom.md5 and freeduc-x.y.iso.md5

[edit] Windows users

The utility md5sum has been ported to Windows, you can find it at www.md5summer.org under the license GPL.

Personal tools