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