个人工具

UbuntuHelp:HowToMD5SUM

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 13:56的版本 (New page: {{From|https://help.ubuntu.com/community/HowToMD5SUM}} {{Languages|php5}} The computer program md5sum is designed to verify data integrity using the MD5 (Message-Digest algorithm 5) 128-...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索


The computer program md5sum is designed to verify data integrity using the MD5 (Message-Digest algorithm 5) 128-bit cryptographic hash. When used properly, MD5 sums can confirm both file integrity and authenticity.

In terms of integrity, an MD5 sum detects changes in files that would cause errors. The possibility of changes(errors) is proportional to the size of the file, as the file becomes larger, the possibility of errors increases. When you have a file like an OS install CD that has to be 100% correct, it is a very good idea to run an MD5 check on it.

In terms of security, cryptographic hashes such as MD5 allow for authentication of data obtained from insecure mirrors. The MD5 sum, however, must come from an HTTPS page (or other secure source) of an organization you trust. While security flaws in the MD5 algorithm have been uncovered, MD5 sums are generally sufficient for casual use. For a list of all Ubuntu MD5 hashes, please refer to the secure UbuntuHashes page.


MD5SUM on Linux

Most Linux distributions come with the md5sum utility, so there is usually no need to install it. To check an iso file, first go the correct directory:

cd download_directory

Then from within the download directory, run the following command.

md5sum ubuntu-6.10-desktop-i386.iso

After scanning the file, md5sum should print out a single line:

b950a4d7cf3151e5f213843e2ad77fe3  ubuntu-6.10-desktop-i386.iso

Compare the hash (string on left) that your machine calculated, with the corresponding hash at UbuntuHashes. If they match, you're good to go. If they don't, try re-downloading the image file from another mirror.

MD5SUM on Mac OS X

Follow the instructions for Linux, except type "md5" instead of "md5sum".

digest(1) on Solaris

Use the Solaris digest(1) command, specifying the md5 algorithm with the -a flag. For instance:

$ digest -a md5 ubuntu-6.10-server-sparc.iso
4971edddbfc667e0effbc0f6b4f7e7e0


MD5SUM on Windows

Windows does not come with an md5sum utility. You must download one from another location, and preferably a location that you trust. There are command line utilities (md5sum.exe) that work similarly to the Unix utility; one public domain version with source is available from Fourmilab. Alternatively, there are graphical tools. A walk-through for one is provided below.

 1. Download and install winMD5Sum, a free and open source hash verification program.
 1. Right-click the ISO file.
 1. Click Send To, then `winMD5Sum`.
 1. Wait for `winMD5Sum` to load and finish the checksum (this may take a significant amount of time depending on your computer's performance).
 1. Copy the corresponding hash from UbuntuHashes into the bottom text box.
 1. Click "Compare"
   attachment:winMD5Sum.png
 1. A message box will say "MD5 Check Sums are the same" if the hashes are equal.

MD5SUM on CD

There is a way to see if your Ubuntu CD was corrupted accidentally. First mount the CD, if not already mounted.

sudo mount /dev/hda /cdrom

Then use the supplied md5sum file on the CD

cd /cdrom
md5sum -c md5sum.txt | grep -v 'OK$'

If the command outputs any errors, you'll know either the burn was bad or the .iso is bad. However, .iso files can easily be tampered with in such a way that this method shows no errors. To avoid this, please check the md5 of the iso file itself (before making a CD) against that file's sum at UbuntuHashes, a secure page.

External Links


CategoryDocumentation