How to verify MD5 or SHA-1 digests
security | rafacas | (2)
MD5 and SHA-1 are cryptographic hash functions. They are deterministic procedures that take an arbitrary block of data as input and return a fixed-size bit string, the hash value (called message digest or fingerprint as well).
Verifying MD5 or SHA-1 digest is highly recommended when you download new software for your system.
In most of Linux distros the md5sum and sha1sum commands are available:
$ md5sum ubuntu-9.04-desktop-i386.iso
66fa77789c7b8ff63130e5d5a272d67b ubuntu-9.04-desktop-i386.iso
$ sha1sum ubuntu-9.04-desktop-i386.iso
19aabf327fdbde9e66db54dc04e3a83b92f70280 ubuntu-9.04-desktop-i386.iso
Solaris (even version 10) doesn’t ship either with md5sum or sha1sum installed. However you can use digest:
% /usr/bin/digest -a md5 GNUgcc.3.4.4.SPARC.64bit.Solaris.10.pkg.tgz
498c344fe2839631bb7cf4b869b7b830
% /usr/bin/digest -a sha1 GNUgcc.3.4.4.SPARC.64bit.Solaris.10.pkg.tgz
a8da8247900dd06a7000fd0e6d41f834d6ab3e40
And in Mac OS X, ...