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