home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 509.lha / DES / des.3 < prev    next >
Text File  |  1991-05-06  |  2KB  |  59 lines

  1. DES 3  "24 March 1987"
  2.  
  3. desinit, setkey, endes, dedes, desdone - DES encryption
  4. SYNOPSIS
  5.  
  6. desinit(mode)
  7. int mode;
  8.  
  9. setkey(key)
  10. char *key;
  11.  
  12. endes(block)
  13. char *block;
  14.  
  15. dedes(block)
  16. char *block;
  17.  
  18. desdone()
  19. DESCRIPTION
  20. These routines implement both standard and modified forms of the NBS Data
  21. Encryption Standard (DES). The user must first call
  22. desinit
  23. with one of three operating modes:
  24.  
  25. 0 - Standard, vanilla DES.
  26.  
  27. 1 - DES with the initial and final permutations removed.
  28. As these permutations do not strengthen the algorithm,
  29. they are widely regarded as having no purpose other than to slow
  30. down software implementations.
  31. Removing them speeds it up but of course the algorithm is no longer standard
  32. and it will not be compatible with hardware DES chips.
  33.    
  34. 2 - DES with the initial and final permutations removed, and with independent
  35. 48-bit subkeys for each of the 16 rounds. Needless to say this is even
  36. less standard than mode 1, but if properly used (randomize ALL key bytes --
  37. no padding!) it should strengthen the algorithm.
  38.    
  39. After calling desinit the user next calls setkey.
  40. In modes 0 and 1, 8 key bytes are expected, with the low order bit of
  41. each key byte ignored (parity is not checked). This gives a 56-bit key.
  42. In mode 2, 128 key bytes are expected; the high order 2 bits of each byte are
  43. ignored, giving a 768 bit key.
  44. In this mode, the first 8 bytes will be used in the first round, the
  45. second 8 bytes in the second round, and so on.
  46.    
  47. Once the key is set, the user may perform in-place encryption and decryption
  48. of 8-byte blocks of data with calls to endes and dedes.
  49.    
  50. To free up memory dynamically allocated by desinit the user may call desdone.
  51. If further encryption or decryption is to be done, desinit and setkey must be
  52. called again.
  53.  
  54. AUTHOR
  55. Phil Karn, KA9Q, building heavily on the earlier public domain code
  56. by Jim Gillogly.
  57.  
  58.  
  59.