OpenBSD manual page server

Manual Page Search Parameters

MD5(1) General Commands Manual MD5(1)

md5calculate a message-digest fingerprint (checksum) for a file

md5 [-bpqrtx] [-c [checklist ...]] [-s string] [file ...]

md5 takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. It was conjectured that it would be computationally infeasible to produce two messages having the same message digest (a collision), or to produce any message having a given prespecified target message digest. However, collisions have now been produced for MD5, so the use of other message digest functions, such as sha256(1), is now preferred.

The MD5 algorithm is intended for digital signature applications, where a large file must be "compressed" in a secure manner before being encrypted with a private (secret) key under a public-key cryptosystem such as .

The options are as follows:

Output checksums in base64 notation, not hexadecimal.
[checklist ...]
Compares all checksums contained in the file checklist with newly computed checksums for the corresponding files. Output consists of the digest used, the file name, and an OK or FAILED for the result of the comparison. This will validate any of the supported checksums (see cksum(1)). If no file is given, stdin is used.
Echoes stdin to stdout and appends the MD5 sum to stdout.
Only print the checksum (quiet mode).
Reverse the format of the hash algorithm output, making it match the output format used by cksum(1).
string
Prints a checksum of the given string.
Runs a built-in time trial. Specifying -t multiple times results in the number of rounds being multiplied by 10 for each additional flag.
Runs a built-in test script.

The MD5 sum of each file listed on the command line is printed after the options are processed.

The md5 utility exits 0 on success, and >0 if an error occurs.

cksum(1), sha1(1), sha256(1)

R. Rivest, The MD5 Message-Digest Algorithm, RFC 1321, April 1992.

Since collisions have been found for MD5, the use of sha256(1) is recommended instead.

September 22, 2012 OpenBSD-5.4