
			DES Implementation 2.0


                                       _
Copyright (c) 1990,1991,1992,1993 Stig Ostholm.
All Rights Reserved


The author takes no responsibility of actions caused by the use of this
software and does not guarantee the correctness of the functions.

This software may be freely distributed an modified for non-commercial use
as long as the copyright notice is kept. If you modify any of the files in
this release, you must add a comment in the modified file indicating who
modified it and what is modified.

If you find any bugs or porting problems, please inform me about the problem
and send the modifications (if there are any).

Additional restrictions due to national laws governing the use, import or
export of cryptographic software is the responsibility of the software user,
importer or exporter to follow.


This software is an implementation of the Data Encryption Standard (DES) as
described in "Federal Information Processing Standards Publication 46",
1977 January 15. The trippel DES encryption described in "ANSI X9.17-1985"
has also been added.

The implementation contains a general purpose DES library and user programs
for file encryption/decryption. The library is compatible with the DES
library from MIT (Massachusetts Institute of Technology) at function call
level, as described in the manual DES_CRYPT(3). There are also functions
available in this implementation that are not a part of the MIT library.


The header file "des.h" contains ANSI C function prototypes for all library
functions.

This library has only been compared against the MIT library through the
manual page due to export restrictions of the MIT library outside the US.


Changes from the MIT library:

	* Encryption methods using an initialization vector may return
	  a modified vector from the last iteration, making it possible
	  to chain calls to an encryption/decryption function into an
	  unbroken sequence.

	* Support for multiple algorithms in the `des_string_to_key'
	  routine (see above). The MIT algorithm and my own algorithm
	  are supported. The default is to use the MIT algorithm.
	  My own should be considerd as obsolete.

	* Additional functions not in the MIT library are:

		des_dea		    - Identical to des_ecb_encrypt.
		des_dea3	    - Trippel DES encryption.
		des_sched	    - Same as des_key_sched without any parity
				      or weak-key test.
		des_ecb2_encrypt    - The Electronic Code Book mode of
				      encryption/decryption on a user
				      specified number of bytes.
		des_cfb8_encrypt    - The 8-bit Cipher FeedBack mode of
				      encryption/decryption on a user
				      specified number of bytes.
		des_ofb8_encrypt    - The 8-bit Output FeedBack mode of
				      encryption/decryption on a user
				      specified number of bytes.
		des_is_weak_key	    - Tests if the key is weak.
		des_is_semiweak_key - Tests if the key is semi-weak.
		des_no_key_schedule - Returns the number of different keys
				      in a key schedule.
		des_set_string_mode - Sets alogorithm used by the
				      `des_string_to_key' routine.
		des_random_cblock   - Generates a random value in a 64-bit
				      block.
		des_hex_to_cblock   - returns the value of a string with a
				      64-bit hexadecimal number in a 64-bit
				      block.
		des_print_cblock    - Prints a 64-bits block as a 64-bit
				      hexadecimal value on stdout.
		des_read_hexkey	    - Similar to des_read_password but
				      accepts only 64-bit hexadecimal
				      numbers.

		encrypt		    - Encryption/decryption function 
				      described in X/Open Portability
				      Guide (December 1988).
		setkey		    - Key handling function described
				      in X/Open Portability

	* The `quad_cksum' routine is not a part for this release but
	  are separately available and easy to install in the package.
	  See the file QUAD_CKSUM for more information.

User programs:

	* descrypt	- General purpose file encryption/decryption
			  program.

	* deskey	- Show the actual DES key generated from a string,
			  or returns a random key.

	* destest	- A simple test of the DES algorithm, useful when
			  modifying or optimizing the code. This program
			  does NOT verify that the implementation follows
			  the DES description.

	* desbench	- Simple benchmark program for the base DES
			  algorithm and key schedule generation.

	* desvrfy	- Simple verification program for the base DES
			  algorithm.

	* desvrfy3	- Simple verification program for the tripple DES
			  algorithm.



The implementation has been tested, with "prog/verify.sh", on the following
systems:

	-- IBM RT/PC,		AOS 4.3
	-- IBM RS/6000,		AIX 3.1.5
	SUN 4,			SUN OS 4.1.1
	-- SUN 3,			SUN OS 4.1.1

					     _
					Stig Ostholm
					Department of Computer Engineering
					Chalmers University of Technology
					----------------------------------
					Email: ostholm@ce.chalmers.se
					Phone: +46 31 7721703
					Fax:   +46 31 7723663
