1.\" $FreeBSD$ 2.Dd July 9, 2018 3.Dt MD5 1 4.Os 5.Sh NAME 6.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512 , sha512t256 , rmd160 , 7.Nm skein256 , skein512 , skein1024 8.Nd calculate a message-digest fingerprint (checksum) for a file 9.Sh SYNOPSIS 10.Nm 11.Op Fl pqrtx 12.Op Fl c Ar string 13.Op Fl s Ar string 14.Op Ar 15.Pp 16(All other hashes have the same options and usage.) 17.Sh DESCRIPTION 18The 19.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512, sha512t256, rmd160, 20.Nm skein256, skein512, 21and 22.Nm skein1024 23utilities take as input a message of arbitrary length and produce as 24output a 25.Dq fingerprint 26or 27.Dq message digest 28of the input. 29It is conjectured that it is computationally infeasible to 30produce two messages having the same message digest, or to produce any 31message having a given prespecified target message digest. 32The 33.Tn SHA-224 , SHA-256 , SHA-384 , SHA-512, RIPEMD-160, 34and 35.Tn SKEIN 36algorithms are intended for digital signature applications, where a 37large file must be 38.Dq compressed 39in a secure manner before being encrypted with a private 40(secret) 41key under a public-key cryptosystem such as 42.Tn RSA . 43.Pp 44The 45.Tn MD5 46and 47.Tn SHA-1 48algorithms have been proven to be vulnerable to practical collision 49attacks and should not be relied upon to produce unique outputs, 50.Em nor should they be used as part of a cryptographic signature scheme. 51As of 2017-03-02, there is no publicly known method to 52.Em reverse 53either algorithm, i.e. to find an input that produces a specific 54output. 55.Pp 56.Tn SHA-512t256 57is a version of 58.Tn SHA-512 59truncated to only 256 bits. 60On 64-bit hardware, this algorithm is approximately 50% faster than 61.Tn SHA-256 62but with the same level of security. 63The hashes are not interchangeable. 64.Pp 65It is recommended that all new applications use 66.Tn SHA-512 67or 68.Tn SKEIN-512 69instead of one of the other hash functions. 70.Pp 71The following options may be used in any combination and must 72precede any files named on the command line. 73The hexadecimal checksum of each file listed on the command line is printed 74after the options are processed. 75.Bl -tag -width indent 76.It Fl c Ar string 77Compare the digest of the file against this string. 78.Pq Note that this option is not yet useful if multiple files are specified. 79.It Fl s Ar string 80Print a checksum of the given 81.Ar string . 82.It Fl p 83Echo stdin to stdout and append the checksum to stdout. 84.It Fl q 85Quiet mode \(em only the checksum is printed out. 86Overrides the 87.Fl r 88option. 89.It Fl r 90Reverses the format of the output. 91This helps with visual diffs. 92Does nothing 93when combined with the 94.Fl ptx 95options. 96.It Fl t 97Run a built-in time trial. 98.It Fl x 99Run a built-in test script. 100.El 101.Sh EXIT STATUS 102The 103.Nm md5 , sha1 , sha224 , sha256 , sha512 , sha512t256 , rmd160 , 104.Nm skein256 , skein512, 105and 106.Nm skein1024 107utilities exit 0 on success, 1081 if at least one of the input files could not be read, 109and 2 if at least one file does not have the same hash as the 110.Fl c 111option. 112.Sh SEE ALSO 113.Xr cksum 1 , 114.Xr md5 3 , 115.Xr ripemd 3 , 116.Xr sha 3 , 117.Xr sha224 3 , 118.Xr sha256 3 , 119.Xr sha384 3 , 120.Xr sha512 3 , 121.Xr skein 3 122.Rs 123.%A R. Rivest 124.%T The MD5 Message-Digest Algorithm 125.%O RFC1321 126.Re 127.Rs 128.%A J. Burrows 129.%T The Secure Hash Standard 130.%O FIPS PUB 180-2 131.Re 132.Rs 133.%A D. Eastlake and P. Jones 134.%T US Secure Hash Algorithm 1 135.%O RFC 3174 136.Re 137.Pp 138RIPEMD-160 is part of the ISO draft standard 139.Qq ISO/IEC DIS 10118-3 140on dedicated hash functions. 141.Pp 142Secure Hash Standard (SHS): 143.Pa http://csrc.nist.gov/cryptval/shs.html . 144.Pp 145The RIPEMD-160 page: 146.Pa http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html . 147.Sh ACKNOWLEDGMENTS 148This program is placed in the public domain for free general use by 149RSA Data Security. 150.Pp 151Support for SHA-1 and RIPEMD-160 has been added by 152.An Oliver Eikemeier Aq Mt eik@FreeBSD.org . 153