The md5sum command can be used to calculate an MD5 message digest (MD5 is an abbreviation for "Message-Digest algorithm 5"), which is a cryptographic hash function. The md5sum program is commonly found on Linux systems and programs which the provide the same functionality are also available for Microsoft Windows systems, e.g. digestIT 2004. But, if such a program isn't present on a system, e.g. an OS X system, but OpenSSL is present, you can use the
opensslcommand to obtain message digests, which can allow you to verify that a file, such as an executable file, was not changed since it was released by the originator.
If you issue the command
openssl dgst filename,
openssl will, by default, provide the MD5 checksum for the file. You can
also use other cryptographic hash functions, such as
MD2, or you
can specify MD5.
$ openssl dgst images.zip MD5(images.zip)= 796faa884fb0125eda60cd5e8aa8daa1 $ openssl md5 images.zip MD5(images.zip)= 796faa884fb0125eda60cd5e8aa8daa1 $ openssl sha1 images.zip SHA1(images.zip)= 3070ac89b7a4327e217045b1cac790c1dc048d8f $ openssl sha images.zip SHA(images.zip)= 021e35f63c55e22355bea99f73df885659a46d15 $ openssl md2 images.zip MD2(images.zip)= 47bd3f0cc33710997f2fe57b1f7cc2c5
The available message digest options include the following:
MESSAGE DIGEST COMMANDS md2 MD2 Digest md5 MD5 Digest mdc2 MDC2 Digest rmd160 RMD-160 Digest sha SHA Digest sha1 SHA-1 Digest sha224 SHA-224 Digest sha256 SHA-256 Digest sha384 SHA-384 Digest sha512 SHA-512 Digest