des.pod 4.7 KB
Newer Older
1 2 3 4
=pod

=head1 NAME

5
des - encrypt or decrypt data using Data Encryption Standard
6 7 8 9

=head1 SYNOPSIS

B<des>
10
(
11
B<-e>
12
|
13
B<-E>
14
) | (
15
B<-d>
16
|
17
B<-D>
18
) | (
19
B<->[B<cC>][B<ckname>]
20 21
) |
[
22
B<-b3hfs>
23
] [
24 25
B<-k>
I<key>
26 27
]
] [
28
B<-u>[I<uuname>]
29
[
30
I<input-file>
31
[
32
I<output-file>
33
] ]
34 35 36 37 38 39 40 41 42

=head1 NOTE

This page describes the B<des> stand-alone program, not the B<openssl des>
command.

=head1 DESCRIPTION

B<des>
43 44 45
encrypts and decrypts data using the
Data Encryption Standard algorithm.
One of
46
B<-e>, B<-E>
47
(for encrypt) or
48
B<-d>, B<-D>
49 50
(for decrypt) must be specified.
It is also possible to use
51
B<-c>
52
or
53
B<-C>
54 55
in conjunction or instead of the a encrypt/decrypt option to generate
a 16 character hexadecimal checksum, generated via the
56 57
I<des_cbc_cksum>.

58
Two standard encryption modes are supported by the
59
B<des>
60 61
program, Cipher Block Chaining (the default) and Electronic Code Book
(specified with
62 63
B<-b>).

64 65
The key used for the DES
algorithm is obtained by prompting the user unless the
66 67
B<-k>
I<key>
68 69
option is given.
If the key is an argument to the
70
B<des>
71
command, it is potentially visible to users executing
72
ps(1)
73
or a derivative.  To minimise this possibility,
74
B<des>
75 76 77
takes care to destroy the key argument immediately upon entry.
If your shell keeps a history file be careful to make sure it is not
world readable.
78 79

Since this program attempts to maintain compatibility with sunOS's
80 81 82
des(1) command, there are 2 different methods used to convert the user
supplied key to a des key.
Whenever and one or more of
83
B<-E>, B<-D>, B<-C>
84
or
85
B<-3>
86 87 88
options are used, the key conversion procedure will not be compatible
with the sunOS des(1) version but will use all the user supplied
character to generate the des key.
89
B<des>
90
command reads from standard input unless
91
I<input-file>
92
is specified and writes to standard output unless
93
I<output-file>
94
is given.
95 96 97 98 99 100 101

=head1 OPTIONS

=over 4

=item B<-b>

102 103
Select ECB
(eight bytes at a time) encryption mode.
104 105 106

=item B<-3>

107 108
Encrypt using triple encryption.
By default triple cbc encryption is used but if the
109 110
B<-b>
option is used then triple ECB encryption is performed.
111
If the key is less than 8 characters long, the flag has no effect.
112 113 114

=item B<-e>

115 116
Encrypt data using an 8 byte key in a manner compatible with sunOS
des(1).
117 118 119

=item B<-E>

120 121
Encrypt data using a key of nearly unlimited length (1024 bytes).
This will product a more secure encryption.
122 123 124 125 126 127 128 129 130 131 132

=item B<-d>

Decrypt data that was encrypted with the B<-e> option.

=item B<-D>

Decrypt data that was encrypted with the B<-E> option.

=item B<-c>

133 134 135
Generate a 16 character hexadecimal cbc checksum and output this to
stderr.
If a filename was specified after the
136
B<-c>
137 138 139
option, the checksum is output to that file.
The checksum is generated using a key generated in a sunOS compatible
manner.
140 141 142

=item B<-C>

143
A cbc checksum is generated in the same manner as described for the
144
B<-c>
145
option but the DES key is generated in the same manner as used for the
146
B<-E>
147
and
148
B<-D>
149
options
150 151 152

=item B<-f>

153
Does nothing - allowed for compatibility with sunOS des(1) command.
154 155 156

=item B<-s>

157
Does nothing - allowed for compatibility with sunOS des(1) command.
158 159 160

=item B<-k> I<key>

161
Use the encryption 
162
I<key>
163
specified.
164 165 166

=item B<-h>

167
The
168
I<key>
169 170
is assumed to be a 16 character hexadecimal number.
If the
171
B<-3>
172 173
option is used the key is assumed to be a 32 character hexadecimal
number.
174 175 176

=item B<-u>

177 178
This flag is used to read and write uuencoded files.  If decrypting,
the input file is assumed to contain uuencoded, DES encrypted data.
179
If encrypting, the characters following the B<-u> are used as the name of
180
the uuencoded file to embed in the begin line of the uuencoded
181
output.  If there is no name specified after the B<-u>, the name text.des
182
will be embedded in the header.
183 184 185 186 187 188 189 190

=head1 SEE ALSO

ps(1),
L<des_crypt(3)|des_crypt(3)>

=head1 BUGS

191
The problem with using the
192
B<-e>
193 194 195 196 197 198
option is the short key length.
It would be better to use a real 56-bit key rather than an
ASCII-based 56-bit pattern.  Knowing that the key was derived from ASCII
radically reduces the time necessary for a brute-force cryptographic attack.
My attempt to remove this problem is to add an alternative text-key to
DES-key function.  This alternative function (accessed via
199
B<-E>, B<-D>, B<-S>
200
and
201
B<-3>)
202
uses DES to help generate the key.
203 204 205 206

Be carefully when using the B<-u> option.  Doing B<des -ud> I<filename> will
not decrypt filename (the B<-u> option will gobble the B<-d> option).

207 208
The VMS operating system operates in a world where files are always a
multiple of 512 bytes.  This causes problems when encrypted data is
209 210
send from Unix to VMS since a 88 byte file will suddenly be padded
with 424 null bytes.  To get around this problem, use the B<-u> option
211
to uuencode the data before it is send to the VMS system.
212 213 214

=head1 AUTHOR

215
Eric Young (eay@cryptsoft.com)
216 217

=cut