1.\" $FreeBSD$ 2.Dd June 6, 2004 3.Dt MD5 1 4.Os 5.Sh NAME 6.Nm md5 , sha1 , rmd160 7.Nd calculate a message-digest fingerprint (checksum) for a file 8.Sh SYNOPSIS 9.Nm md5 10.Op Fl pqrtx 11.Op Fl s Ar string 12.Op Ar 13.Nm sha1 14.Op Fl pqrtx 15.Op Fl s Ar string 16.Op Ar 17.Nm rmd160 18.Op Fl pqrtx 19.Op Fl s Ar string 20.Op Ar 21.Sh DESCRIPTION 22The 23.Nm md5 , sha1 24and 25.Nm rmd160 26utilities take as input a message of arbitrary length and produce as 27output a 28.Dq fingerprint 29or 30.Dq message digest 31of the input. 32It is conjectured that it is computationally infeasible to 33produce two messages having the same message digest, or to produce any 34message having a given prespecified target message digest. 35The 36.Tn MD5 , SHA-1 37and 38.Tn RIPEMD-160 39algorithms are intended for digital signature applications, where a 40large file must be 41.Dq compressed 42in a secure manner before being encrypted with a private 43(secret) 44key under a public-key cryptosystem such as 45.Tn RSA . 46.Pp 47.Tn MD5 48has not yet (2001-09-03) been broken, but sufficient attacks have been 49made that its security is in some doubt. 50The attacks on 51.Tn MD5 52are in the nature of finding 53.Dq collisions 54\(em that is, multiple 55inputs which hash to the same value; it is still unlikely for an attacker 56to be able to determine the exact original input given a hash value. 57.Pp 58The following options may be used in any combination and must 59precede any files named on the command line. 60The hexadecimal checksum of each file listed on the command line is printed 61after the options are processed. 62.Bl -tag -width indent 63.It Fl s Ar string 64Print a checksum of the given 65.Ar string . 66.It Fl p 67Echo stdin to stdout and append the checksum to stdout. 68.It Fl q 69Quiet mode - only the checksum is printed out. 70Overrides the 71.Fl r 72option. 73.It Fl r 74Reverses the format of the output. 75This helps with visual diffs. 76Does nothing 77when combined with the 78.Fl ptx 79options. 80.It Fl t 81Run a built-in time trial. 82.It Fl x 83Run a built-in test script. 84.El 85.Sh DIAGNOSTICS 86The 87.Nm md5 , sha1 88and 89.Nm rmd160 90utilities exit 0 on success, 91and 1 if at least one of the input files could not be read. 92.Sh SEE ALSO 93.Xr cksum 1 , 94.Xr md5 3 , 95.Xr ripemd 3 , 96.Xr sha 3 97.Rs 98.%A R. Rivest 99.%T The MD5 Message-Digest Algorithm 100.%O RFC1321 101.Re 102.Rs 103.%A J. Burrows 104.%T The Secure Hash Standard 105.%O FIPS PUB 180-1 106.Re 107.Rs 108.%A D. Eastlake and P. Jones 109.%T US Secure Hash Algorithm 1 110.%O RFC 3174 111.Re 112.Pp 113RIPEMD-160 is part of the ISO draft standard 114.Qq ISO/IEC DIS 10118-3 115on dedicated hash functions. 116.Pp 117Secure Hash Standard (SHS): 118.Pa http://csrc.nist.gov/cryptval/shs.html . 119.Pp 120The RIPEMD-160 page: 121.Pa http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html . 122.Sh ACKNOWLEDGMENTS 123This program is placed in the public domain for free general use by 124RSA Data Security. 125.Pp 126Support for SHA-1 and RIPEMD-160 has been added by 127.An Oliver Eikemeier Aq eik@FreeBSD.org . 128