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