2000-03-18 17:55:09 +00:00
|
|
|
=pod
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
des - encrypt or decrypt data using Data Encryption Standard
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
B<des>
|
1998-12-21 10:52:47 +00:00
|
|
|
(
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-e>
|
1998-12-21 10:52:47 +00:00
|
|
|
|
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-E>
|
1998-12-21 10:52:47 +00:00
|
|
|
) | (
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-d>
|
1998-12-21 10:52:47 +00:00
|
|
|
|
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-D>
|
1998-12-21 10:52:47 +00:00
|
|
|
) | (
|
2000-03-18 17:55:09 +00:00
|
|
|
B<->[B<cC>][B<ckname>]
|
1998-12-21 10:52:47 +00:00
|
|
|
) |
|
|
|
|
[
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-b3hfs>
|
1998-12-21 10:52:47 +00:00
|
|
|
] [
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-k>
|
|
|
|
I<key>
|
1998-12-21 10:52:47 +00:00
|
|
|
]
|
|
|
|
] [
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-u>[I<uuname>]
|
1998-12-21 10:52:47 +00:00
|
|
|
[
|
2000-03-18 17:55:09 +00:00
|
|
|
I<input-file>
|
1998-12-21 10:52:47 +00:00
|
|
|
[
|
2000-03-18 17:55:09 +00:00
|
|
|
I<output-file>
|
1998-12-21 10:52:47 +00:00
|
|
|
] ]
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=head1 NOTE
|
|
|
|
|
|
|
|
This page describes the B<des> stand-alone program, not the B<openssl des>
|
|
|
|
command.
|
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
|
|
|
B<des>
|
1998-12-21 10:52:47 +00:00
|
|
|
encrypts and decrypts data using the
|
|
|
|
Data Encryption Standard algorithm.
|
|
|
|
One of
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-e>, B<-E>
|
1998-12-21 10:52:47 +00:00
|
|
|
(for encrypt) or
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-d>, B<-D>
|
1998-12-21 10:52:47 +00:00
|
|
|
(for decrypt) must be specified.
|
|
|
|
It is also possible to use
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-c>
|
1998-12-21 10:52:47 +00:00
|
|
|
or
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-C>
|
1998-12-21 10:52:47 +00:00
|
|
|
in conjunction or instead of the a encrypt/decrypt option to generate
|
|
|
|
a 16 character hexadecimal checksum, generated via the
|
2000-03-18 17:55:09 +00:00
|
|
|
I<des_cbc_cksum>.
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
Two standard encryption modes are supported by the
|
2000-03-18 17:55:09 +00:00
|
|
|
B<des>
|
1998-12-21 10:52:47 +00:00
|
|
|
program, Cipher Block Chaining (the default) and Electronic Code Book
|
|
|
|
(specified with
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-b>).
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
The key used for the DES
|
|
|
|
algorithm is obtained by prompting the user unless the
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-k>
|
|
|
|
I<key>
|
1998-12-21 10:52:47 +00:00
|
|
|
option is given.
|
|
|
|
If the key is an argument to the
|
2000-03-18 17:55:09 +00:00
|
|
|
B<des>
|
1998-12-21 10:52:47 +00:00
|
|
|
command, it is potentially visible to users executing
|
2000-03-18 17:55:09 +00:00
|
|
|
ps(1)
|
1998-12-21 10:52:47 +00:00
|
|
|
or a derivative. To minimise this possibility,
|
2000-03-18 17:55:09 +00:00
|
|
|
B<des>
|
1998-12-21 10:52:47 +00:00
|
|
|
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.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
Since this program attempts to maintain compatibility with sunOS's
|
1998-12-21 10:52:47 +00:00
|
|
|
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
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-E>, B<-D>, B<-C>
|
1998-12-21 10:52:47 +00:00
|
|
|
or
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-3>
|
1998-12-21 10:52:47 +00:00
|
|
|
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.
|
2000-03-18 17:55:09 +00:00
|
|
|
B<des>
|
1998-12-21 10:52:47 +00:00
|
|
|
command reads from standard input unless
|
2000-03-18 17:55:09 +00:00
|
|
|
I<input-file>
|
1998-12-21 10:52:47 +00:00
|
|
|
is specified and writes to standard output unless
|
2000-03-18 17:55:09 +00:00
|
|
|
I<output-file>
|
1998-12-21 10:52:47 +00:00
|
|
|
is given.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=head1 OPTIONS
|
|
|
|
|
|
|
|
=over 4
|
|
|
|
|
|
|
|
=item B<-b>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
Select ECB
|
|
|
|
(eight bytes at a time) encryption mode.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=item B<-3>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
Encrypt using triple encryption.
|
|
|
|
By default triple cbc encryption is used but if the
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-b>
|
|
|
|
option is used then triple ECB encryption is performed.
|
1998-12-21 10:52:47 +00:00
|
|
|
If the key is less than 8 characters long, the flag has no effect.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=item B<-e>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
Encrypt data using an 8 byte key in a manner compatible with sunOS
|
|
|
|
des(1).
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=item B<-E>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
Encrypt data using a key of nearly unlimited length (1024 bytes).
|
|
|
|
This will product a more secure encryption.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=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>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
Generate a 16 character hexadecimal cbc checksum and output this to
|
|
|
|
stderr.
|
|
|
|
If a filename was specified after the
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-c>
|
1998-12-21 10:52:47 +00:00
|
|
|
option, the checksum is output to that file.
|
|
|
|
The checksum is generated using a key generated in a sunOS compatible
|
|
|
|
manner.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=item B<-C>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
A cbc checksum is generated in the same manner as described for the
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-c>
|
1998-12-21 10:52:47 +00:00
|
|
|
option but the DES key is generated in the same manner as used for the
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-E>
|
1998-12-21 10:52:47 +00:00
|
|
|
and
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-D>
|
1998-12-21 10:52:47 +00:00
|
|
|
options
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=item B<-f>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
Does nothing - allowed for compatibility with sunOS des(1) command.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=item B<-s>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
Does nothing - allowed for compatibility with sunOS des(1) command.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=item B<-k> I<key>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
Use the encryption
|
2000-03-18 17:55:09 +00:00
|
|
|
I<key>
|
1998-12-21 10:52:47 +00:00
|
|
|
specified.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=item B<-h>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
The
|
2000-03-18 17:55:09 +00:00
|
|
|
I<key>
|
1998-12-21 10:52:47 +00:00
|
|
|
is assumed to be a 16 character hexadecimal number.
|
|
|
|
If the
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-3>
|
1998-12-21 10:52:47 +00:00
|
|
|
option is used the key is assumed to be a 32 character hexadecimal
|
|
|
|
number.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=item B<-u>
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
This flag is used to read and write uuencoded files. If decrypting,
|
|
|
|
the input file is assumed to contain uuencoded, DES encrypted data.
|
2000-03-18 17:55:09 +00:00
|
|
|
If encrypting, the characters following the B<-u> are used as the name of
|
1998-12-21 10:52:47 +00:00
|
|
|
the uuencoded file to embed in the begin line of the uuencoded
|
2000-03-18 17:55:09 +00:00
|
|
|
output. If there is no name specified after the B<-u>, the name text.des
|
1998-12-21 10:52:47 +00:00
|
|
|
will be embedded in the header.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
|
|
|
ps(1),
|
|
|
|
L<des_crypt(3)|des_crypt(3)>
|
|
|
|
|
|
|
|
=head1 BUGS
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
The problem with using the
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-e>
|
1998-12-21 10:52:47 +00:00
|
|
|
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
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-E>, B<-D>, B<-S>
|
1998-12-21 10:52:47 +00:00
|
|
|
and
|
2000-03-18 17:55:09 +00:00
|
|
|
B<-3>)
|
1998-12-21 10:52:47 +00:00
|
|
|
uses DES to help generate the key.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
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).
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
The VMS operating system operates in a world where files are always a
|
|
|
|
multiple of 512 bytes. This causes problems when encrypted data is
|
2000-03-18 17:55:09 +00:00
|
|
|
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
|
1998-12-21 10:52:47 +00:00
|
|
|
to uuencode the data before it is send to the VMS system.
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=head1 AUTHOR
|
|
|
|
|
1998-12-21 10:52:47 +00:00
|
|
|
Eric Young (eay@cryptsoft.com)
|
2000-03-18 17:55:09 +00:00
|
|
|
|
|
|
|
=cut
|