You can use the MD5 hash of a file you download to check it's integrity. From Wikipedia:
- In cryptography, MD5 (Message-Digest algorithm 5) is a widely-used cryptographic hash function with a 128-bit hash value. As an Internet standard (RFC 1321), MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of files.
Just typing md5sum <filename> will give you the MD5 hash of that file which you can then visually check against another copy, perhaps on a website. An easier way of doing things though is to use the --check option. For example, let's say I just downloaded the centOS ISOs and I want to verify I have correct copies. If I also have a copy of the MD5 hash called MD5SUM-CDS (which I have to trust is correct) I can do the following:
$ md5sum --check MD5SUM-CDS CentOS-4.0-x86_64-bin1of4.iso: OK CentOS-4.0-x86_64-bin2of4.iso: OK CentOS-4.0-x86_64-bin3of4.iso: OK CentOS-4.0-x86_64-bin4of4.iso: OK
Much easier than scanning the hashes visually.
You can also do this with SHA1SUM. Eg. sha1sum --check SHA1SUM
To generate an MD5 of a string, see GenerateMd5.
