]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - sbin/md5/md5.1
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / sbin / md5 / md5.1
1 .\" $FreeBSD$
2 .Dd September 7, 2008
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 c Ar string
12 .Op Fl s Ar string
13 .Op Ar
14 .Nm sha1
15 .Op Fl pqrtx
16 .Op Fl c Ar string
17 .Op Fl s Ar string
18 .Op Ar
19 .Nm sha256
20 .Op Fl pqrtx
21 .Op Fl c Ar string
22 .Op Fl s Ar string
23 .Op Ar
24 .Nm rmd160
25 .Op Fl pqrtx
26 .Op Fl c Ar string
27 .Op Fl s Ar string
28 .Op Ar
29 .Sh DESCRIPTION
30 The
31 .Nm md5 , sha1 , sha256
32 and
33 .Nm rmd160
34 utilities take as input a message of arbitrary length and produce as
35 output a
36 .Dq fingerprint
37 or
38 .Dq message digest
39 of the input.
40 It is conjectured that it is computationally infeasible to
41 produce two messages having the same message digest, or to produce any
42 message having a given prespecified target message digest.
43 The
44 .Tn MD5 , SHA-1 , SHA-256
45 and
46 .Tn RIPEMD-160
47 algorithms are intended for digital signature applications, where a
48 large file must be
49 .Dq compressed
50 in a secure manner before being encrypted with a private
51 (secret)
52 key under a public-key cryptosystem such as
53 .Tn RSA .
54 .Pp
55 .Tn MD5
56 has been completely broken as far as finding collisions is
57 concerned, and should not be relied upon to produce unique outputs.
58 This also means that
59 .Tn MD5
60 should not be used as part of a cryptographic signature scheme.
61 At the current time (2009-01-06) there is no publicly known method to
62 .Dq reverse
63 MD5, i.e., to find an input given a hash value.
64 .Pp
65 .Tn SHA-1
66 currently (2009-01-06) has no known collisions, but an attack has been
67 found which is faster than a brute-force search, placing the security of
68 .Tn SHA-1
69 in doubt.
70 .Pp
71 It is recommended that all new applications use
72 .Tn SHA-256
73 instead of one of the other hash functions.
74 .Pp
75 The following options may be used in any combination and must
76 precede any files named on the command line.
77 The hexadecimal checksum of each file listed on the command line is printed
78 after the options are processed.
79 .Bl -tag -width indent
80 .It Fl c Ar string
81 Compare files to this md5 string.
82 (Note that this option is not yet useful if multiple files are specified.)
83 .It Fl s Ar string
84 Print a checksum of the given
85 .Ar string .
86 .It Fl p
87 Echo stdin to stdout and append the checksum to stdout.
88 .It Fl q
89 Quiet mode - only the checksum is printed out.
90 Overrides the
91 .Fl r
92 option.
93 .It Fl r
94 Reverses the format of the output.
95 This helps with visual diffs.
96 Does nothing
97 when combined with the
98 .Fl ptx
99 options.
100 .It Fl t
101 Run a built-in time trial.
102 .It Fl x
103 Run a built-in test script.
104 .El
105 .Sh EXIT STATUS
106 The
107 .Nm md5 , sha1 , sha256
108 and
109 .Nm rmd160
110 utilities exit 0 on success,
111 1 if at least one of the input files could not be read,
112 and 2 if at least one file does not have the same hash as the -c option.
113 .Sh SEE ALSO
114 .Xr cksum 1 ,
115 .Xr md5 3 ,
116 .Xr ripemd 3 ,
117 .Xr sha 3 ,
118 .Xr sha256 3
119 .Rs
120 .%A R. Rivest
121 .%T The MD5 Message-Digest Algorithm
122 .%O RFC1321
123 .Re
124 .Rs
125 .%A J. Burrows
126 .%T The Secure Hash Standard
127 .%O FIPS PUB 180-2
128 .Re
129 .Rs
130 .%A D. Eastlake and P. Jones
131 .%T US Secure Hash Algorithm 1
132 .%O RFC 3174
133 .Re
134 .Pp
135 RIPEMD-160 is part of the ISO draft standard
136 .Qq ISO/IEC DIS 10118-3
137 on dedicated hash functions.
138 .Pp
139 Secure Hash Standard (SHS):
140 .Pa http://csrc.nist.gov/cryptval/shs.html .
141 .Pp
142 The RIPEMD-160 page:
143 .Pa http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html .
144 .Sh ACKNOWLEDGMENTS
145 This program is placed in the public domain for free general use by
146 RSA Data Security.
147 .Pp
148 Support for SHA-1 and RIPEMD-160 has been added by
149 .An Oliver Eikemeier Aq eik@FreeBSD.org .