Compute a cryptographic message digest of a file or string.

Contributed by
Larry Philps
Obtained from
This program was released into the Public Domain by RSA Data Security
MD5 computes a crytographic checksum of either a string given it on the command line, or a set of files. In this respect it is similar to the Unix sum program. However, MD5 produces a 128-bit message digest (checksum) that is very sensitive to its input.

It is conjectured that the difficulty of coming up with two messages having the same message digest is on the order of 2^64 operations, and that the difficulty of coming up with any message having a given message digest is on the order of 2^128 operations.

Many people, CERT in particular, are starting to provide MD5 checksums for files they distribute. Once you obtain a copy you can compute the MD5 checksum of it, and if it matches, you can be very certain that the file has not been modified since it was created by the author.
The code for this program was taken bit for bit from RFC1321 which has been widely read and analyzed.
Work Planned
A manual page.
The Makefile contains an "rfc.test" target which will produce a set of message digest of known strings. Running "md5 -x" will compute the same message digests. If they match, the program works. The "make test" target will do all of this.