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