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