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