]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/des/des.pod
"#if 0" removal: header files
[thirdparty/openssl.git] / crypto / des / des.pod
CommitLineData
50c16ed3
UM
1=pod
2
3=head1 NAME
4
d02b48c6 5des - encrypt or decrypt data using Data Encryption Standard
50c16ed3
UM
6
7=head1 SYNOPSIS
8
9B<des>
d02b48c6 10(
50c16ed3 11B<-e>
d02b48c6 12|
50c16ed3 13B<-E>
d02b48c6 14) | (
50c16ed3 15B<-d>
d02b48c6 16|
50c16ed3 17B<-D>
d02b48c6 18) | (
50c16ed3 19B<->[B<cC>][B<ckname>]
d02b48c6
RE
20) |
21[
50c16ed3 22B<-b3hfs>
d02b48c6 23] [
50c16ed3
UM
24B<-k>
25I<key>
d02b48c6
RE
26]
27] [
50c16ed3 28B<-u>[I<uuname>]
d02b48c6 29[
50c16ed3 30I<input-file>
d02b48c6 31[
50c16ed3 32I<output-file>
d02b48c6 33] ]
50c16ed3
UM
34
35=head1 NOTE
36
37This page describes the B<des> stand-alone program, not the B<openssl des>
38command.
39
40=head1 DESCRIPTION
41
42B<des>
d02b48c6
RE
43encrypts and decrypts data using the
44Data Encryption Standard algorithm.
45One of
50c16ed3 46B<-e>, B<-E>
d02b48c6 47(for encrypt) or
50c16ed3 48B<-d>, B<-D>
d02b48c6
RE
49(for decrypt) must be specified.
50It is also possible to use
50c16ed3 51B<-c>
d02b48c6 52or
50c16ed3 53B<-C>
d02b48c6
RE
54in conjunction or instead of the a encrypt/decrypt option to generate
55a 16 character hexadecimal checksum, generated via the
50c16ed3
UM
56I<des_cbc_cksum>.
57
d02b48c6 58Two standard encryption modes are supported by the
50c16ed3 59B<des>
d02b48c6
RE
60program, Cipher Block Chaining (the default) and Electronic Code Book
61(specified with
50c16ed3
UM
62B<-b>).
63
d02b48c6
RE
64The key used for the DES
65algorithm is obtained by prompting the user unless the
50c16ed3
UM
66B<-k>
67I<key>
d02b48c6
RE
68option is given.
69If the key is an argument to the
50c16ed3 70B<des>
d02b48c6 71command, it is potentially visible to users executing
50c16ed3 72ps(1)
d02b48c6 73or a derivative. To minimise this possibility,
50c16ed3 74B<des>
d02b48c6
RE
75takes care to destroy the key argument immediately upon entry.
76If your shell keeps a history file be careful to make sure it is not
77world readable.
50c16ed3
UM
78
79Since this program attempts to maintain compatibility with sunOS's
d02b48c6
RE
80des(1) command, there are 2 different methods used to convert the user
81supplied key to a des key.
82Whenever and one or more of
50c16ed3 83B<-E>, B<-D>, B<-C>
d02b48c6 84or
50c16ed3 85B<-3>
d02b48c6
RE
86options are used, the key conversion procedure will not be compatible
87with the sunOS des(1) version but will use all the user supplied
88character to generate the des key.
50c16ed3 89B<des>
d02b48c6 90command reads from standard input unless
50c16ed3 91I<input-file>
d02b48c6 92is specified and writes to standard output unless
50c16ed3 93I<output-file>
d02b48c6 94is given.
50c16ed3
UM
95
96=head1 OPTIONS
97
98=over 4
99
100=item B<-b>
101
d02b48c6
RE
102Select ECB
103(eight bytes at a time) encryption mode.
50c16ed3
UM
104
105=item B<-3>
106
d02b48c6
RE
107Encrypt using triple encryption.
108By default triple cbc encryption is used but if the
50c16ed3
UM
109B<-b>
110option is used then triple ECB encryption is performed.
d02b48c6 111If the key is less than 8 characters long, the flag has no effect.
50c16ed3
UM
112
113=item B<-e>
114
d02b48c6
RE
115Encrypt data using an 8 byte key in a manner compatible with sunOS
116des(1).
50c16ed3
UM
117
118=item B<-E>
119
d02b48c6
RE
120Encrypt data using a key of nearly unlimited length (1024 bytes).
121This will product a more secure encryption.
50c16ed3
UM
122
123=item B<-d>
124
125Decrypt data that was encrypted with the B<-e> option.
126
127=item B<-D>
128
129Decrypt data that was encrypted with the B<-E> option.
130
131=item B<-c>
132
d02b48c6
RE
133Generate a 16 character hexadecimal cbc checksum and output this to
134stderr.
135If a filename was specified after the
50c16ed3 136B<-c>
d02b48c6
RE
137option, the checksum is output to that file.
138The checksum is generated using a key generated in a sunOS compatible
139manner.
50c16ed3
UM
140
141=item B<-C>
142
d02b48c6 143A cbc checksum is generated in the same manner as described for the
50c16ed3 144B<-c>
d02b48c6 145option but the DES key is generated in the same manner as used for the
50c16ed3 146B<-E>
d02b48c6 147and
50c16ed3 148B<-D>
d02b48c6 149options
50c16ed3
UM
150
151=item B<-f>
152
d02b48c6 153Does nothing - allowed for compatibility with sunOS des(1) command.
50c16ed3
UM
154
155=item B<-s>
156
d02b48c6 157Does nothing - allowed for compatibility with sunOS des(1) command.
50c16ed3
UM
158
159=item B<-k> I<key>
160
d02b48c6 161Use the encryption
50c16ed3 162I<key>
d02b48c6 163specified.
50c16ed3
UM
164
165=item B<-h>
166
d02b48c6 167The
50c16ed3 168I<key>
d02b48c6
RE
169is assumed to be a 16 character hexadecimal number.
170If the
50c16ed3 171B<-3>
d02b48c6
RE
172option is used the key is assumed to be a 32 character hexadecimal
173number.
50c16ed3
UM
174
175=item B<-u>
176
d02b48c6
RE
177This flag is used to read and write uuencoded files. If decrypting,
178the input file is assumed to contain uuencoded, DES encrypted data.
50c16ed3 179If encrypting, the characters following the B<-u> are used as the name of
d02b48c6 180the uuencoded file to embed in the begin line of the uuencoded
50c16ed3 181output. If there is no name specified after the B<-u>, the name text.des
d02b48c6 182will be embedded in the header.
50c16ed3 183
ed77017b
LR
184=back
185
50c16ed3
UM
186=head1 SEE ALSO
187
188ps(1),
189L<des_crypt(3)|des_crypt(3)>
190
191=head1 BUGS
192
d02b48c6 193The problem with using the
50c16ed3 194B<-e>
d02b48c6
RE
195option is the short key length.
196It would be better to use a real 56-bit key rather than an
197ASCII-based 56-bit pattern. Knowing that the key was derived from ASCII
198radically reduces the time necessary for a brute-force cryptographic attack.
199My attempt to remove this problem is to add an alternative text-key to
200DES-key function. This alternative function (accessed via
50c16ed3 201B<-E>, B<-D>, B<-S>
d02b48c6 202and
50c16ed3 203B<-3>)
d02b48c6 204uses DES to help generate the key.
50c16ed3
UM
205
206Be carefully when using the B<-u> option. Doing B<des -ud> I<filename> will
207not decrypt filename (the B<-u> option will gobble the B<-d> option).
208
d02b48c6
RE
209The VMS operating system operates in a world where files are always a
210multiple of 512 bytes. This causes problems when encrypted data is
50c16ed3
UM
211send from Unix to VMS since a 88 byte file will suddenly be padded
212with 424 null bytes. To get around this problem, use the B<-u> option
d02b48c6 213to uuencode the data before it is send to the VMS system.
50c16ed3
UM
214
215=head1 AUTHOR
216
d02b48c6 217Eric Young (eay@cryptsoft.com)
50c16ed3
UM
218
219=cut