How to verify the integrity of a large downloaded file
In Category Command Line Microsoft Windows
There are some algorithms like MD5 and SHA1 which generate unique digest for any given input. Basic idea is to find the MD5 or SHA1 digest of the file which is going to be downloaded and cross check the same after calculating digest after downloading the file locally. There are command line utilities “md5sum” and “sha1sum” to compute digest using MD5 and SHA1 algorithms respectively.
Typically the servers place a special file “MD5SUM” or “md5sum.txt” or “SHA1SUM” (file name may vary) in the same directory from where you are trying to download the large file. This “MD5SUM” contains digests of all files in that directory. So download “MD5SUM” as well along with the original file. Then run the Linux command line utility “md5sum” on the file and cross check the vale with the one provided in “MD5SUM” file. If both digests match, that means the file is downloaded properly. Otherwise you may have to download the file again.
Basic usage of “sha1sum” is shown below against a Fedora 10 DVD file downloaded from Internet. The Fedora project provides SHA1 digests for all files in a file “SHA1SUM“. The usage of “md5sum” is also similar.
[liz@techpulp ~]# sha1sum Fedora-10-i386-DVD.iso 086fd570518ac58d3966c43c1b6d146e38919d8d [liz@techpulp ~]# cat SHA1SUM -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 086fd570518ac58d3966c43c1b6d146e38919d8d *Fedora-10-i386-DVD.iso 7ee299d78814cf8338bae3e6b7c1b2b878bb2099 *Fedora-10-i386-disc1.iso 6fb1c47a7fedcba9bee51af33635566c9be285b5 *Fedora-10-i386-disc2.iso af58bcdaac05b9b31ce0d87f2766aac53480008e *Fedora-10-i386-disc3.iso 5b559d2f7c0d375e2a5ccf48a42f9db8d6a09646 *Fedora-10-i386-disc4.iso 09c8d7da134f983e93137ef71885002fe19add3d *Fedora-10-i386-disc5.iso 8b9d2e43c8b8e19d34a55d2ab65733d987853bb6 *Fedora-10-i386-disc6.iso 8f34cf6b8996c2a49578928aa437244f357ab0c2 *Fedora-10-i386-netinst.iso -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFJJZ73vyJvzE6/wnMRAqMKAJ9DqTnCfeh5Z9ZkLD8NCZmTveEM1QCglh2L jn2Dxoks6CtgGtqW3m0LiyE= =5dmW -----END PGP SIGNATURE----- [liz@techpulp ~]#
These commands are also available for Microsoft Windows on Internet.