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