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