import cyrus-sasl-2.1.23
[cyrus-sasl.git] / mac / libdes / src / des.man
1 .TH DES 1 \r.SH NAME\rdes - encrypt or decrypt data using Data Encryption Standard\r.SH SYNOPSIS\r.B des\r(\r.B \-e\r|\r.B \-E\r) | (\r.B \-d\r|\r.B \-D\r) | (\r.B \-\fR[\fPcC\fR][\fPckname\fR]\fP\r) |\r[\r.B \-b3hfs\r] [\r.B \-k\r.I key\r]\r] [\r.B \-u\fR[\fIuuname\fR]\r[\r.I input-file\r[\r.I output-file\r] ]\r.SH DESCRIPTION\r.B des\rencrypts and decrypts data using the\rData Encryption Standard algorithm.\rOne of\r.B \-e, \-E\r(for encrypt) or\r.B \-d, \-D\r(for decrypt) must be specified.\rIt is also possible to use\r.B \-c\ror\r.B \-C\rin conjunction or instead of the a encrypt/decrypt option to generate\ra 16 character hexadecimal checksum, generated via the\r.I des_cbc_cksum.\r.LP\rTwo standard encryption modes are supported by the\r.B des\rprogram, Cipher Block Chaining (the default) and Electronic Code Book\r(specified with\r.B \-b\r).\r.LP\rThe key used for the DES\ralgorithm is obtained by prompting the user unless the\r.B `\-k\r.I key'\roption is given.\rIf the key is an argument to the\r.B des\rcommand, it is potentially visible to users executing\r.BR ps (1)\ror a derivative.  To minimise this possibility,\r.B des\rtakes care to destroy the key argument immediately upon entry.\rIf your shell keeps a history file be careful to make sure it is not\rworld readable.\r.LP\rSince this program attempts to maintain compatability with sunOS's\rdes(1) command, there are 2 different methods used to convert the user\rsupplied key to a des key.\rWhenever and one or more of\r.B \-E, \-D, \-C\ror\r.B \-3\roptions are used, the key conversion procedure will not be compatible\rwith the sunOS des(1) version but will use all the user supplied\rcharacter to generate the des key.\r.B des\rcommand reads from standard input unless\r.I input-file\ris specified and writes to standard output unless\r.I output-file\ris given.\r.SH OPTIONS\r.TP\r.B \-b\rSelect ECB\r(eight bytes at a time) encryption mode.\r.TP\r.B \-3\rEncrypt using triple encryption.\rBy default triple cbc encryption is used but if the\r.B \-b\roption is used then triple ecb encryption is performed.\rIf the key is less than 8 characters long, the flag has no effect.\r.TP\r.B \-e\rEncrypt data using an 8 byte key in a manner compatible with sunOS\rdes(1).\r.TP\r.B \-E\rEncrypt data using a key of nearly unlimited length (1024 bytes).\rThis will product a more secure encryption.\r.TP\r.B \-d\rDecrypt data that was encrypted with the \-e option.\r.TP\r.B \-D\rDecrypt data that was encrypted with the \-E option.\r.TP\r.B \-c\rGenerate a 16 character hexadecimal cbc checksum and output this to\rstderr.\rIf a filename was specified after the\r.B \-c\roption, the checksum is output to that file.\rThe checksum is generated using a key generated in a sunOS compatible\rmanner.\r.TP\r.B \-C\rA cbc checksum is generated in the same manner as described for the\r.B \-c\roption but the DES key is generated in the same manner as used for the\r.B \-E\rand\r.B \-D\roptions\r.TP\r.B \-f\rDoes nothing - allowed for compatibility with sunOS des(1) command.\r.TP\r.B \-s\rDoes nothing - allowed for compatibility with sunOS des(1) command.\r.TP\r.B "\-k \fIkey\fP"\rUse the encryption \r.I key\rspecified.\r.TP\r.B "\-h"\rThe\r.I key\ris assumed to be a 16 character hexadecimal number.\rIf the\r.B "\-3"\roption is used the key is assumed to be a 32 character hexadecimal\rnumber.\r.TP\r.B \-u\rThis flag is used to read and write uuencoded files.  If decrypting,\rthe input file is assumed to contain uuencoded, DES encrypted data.\rIf encrypting, the characters following the -u are used as the name of\rthe uuencoded file to embed in the begin line of the uuencoded\routput.  If there is no name specified after the -u, the name text.des\rwill be embedded in the header.\r.SH SEE ALSO\r.B ps (1)\r.B des_crypt(3)\r.SH BUGS\r.LP\rThe problem with using the\r.B -e\roption is the short key length.\rIt would be better to use a real 56-bit key rather than an\rASCII-based 56-bit pattern.  Knowing that the key was derived from ASCII\rradically reduces the time necessary for a brute-force cryptographic attack.\rMy attempt to remove this problem is to add an alternative text-key to\rDES-key function.  This alternative function (accessed via\r.B -E, -D, -S\rand\r.B -3\r)\ruses DES to help generate the key.\r.LP\rBe carefully when using the -u option.  Doing des -ud <filename> will\rnot decrypt filename (the -u option will gobble the d option).\r.LP\rThe VMS operating system operates in a world where files are always a\rmultiple of 512 bytes.  This causes problems when encrypted data is\rsend from unix to VMS since a 88 byte file will suddenly be padded\rwith 424 null bytes.  To get around this problem, use the -u option\rto uuencode the data before it is send to the VMS system.\r.SH AUTHOR\r.LP\rEric Young (eay@mincom.oz.au or eay@psych.psy.uq.oz.au)\r