home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / wizards / 5325 < prev    next >
Encoding:
Internet Message Format  |  1992-12-23  |  4.7 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!natinst.com!hrd769.brooks.af.mil!hrd769.brooks.af.mil!not-for-mail
  2. From: news@hrd769.brooks.af.mil (InterNet News)
  3. Newsgroups: comp.unix.wizards
  4. Subject: Re: crypt()/encrypt() functions ?
  5. Date: 23 Dec 1992 11:03:20 -0600
  6. Organization: Armstrong Lab MIS, Brooks AFB TX
  7. Lines: 97
  8. Message-ID: <1ha64oINNbnh@hrd769.brooks.af.mil>
  9. References: <4210@eastman.UUCP> <1967@enst.enst.fr> <1h8uhgINNded@usenet.INS.CWRU.Edu>
  10. NNTP-Posting-Host: hrd769.brooks.af.mil
  11.  
  12. I think I may have messed up the attributions here.  If so, I apologize:
  13. In article <1h8uhgINNded@usenet.INS.CWRU.Edu> cq377@cleveland.Freenet.Edu (David C. Williss) writes:
  14. >In a previous article, vec@alnitak.Kodak.COM (Vance Cochrane) says:
  15. >>In article <1967@enst.enst.fr>, meunier@quasar.enst.fr (Sylvain Meunier) writes:
  16. >>>Are crypt()/encrypt() functions sames for all UNIX ? If I crypt something
  17. >>>on a UNIX system A does it will be same on a other UNIX system B ?
  18. >>>    S. Meunier        E-Mail: meunier@inf.enst.fr
  19. >I believe the answer is "yes", but I'd have to try it to know for sure.
  20. >
  21.  
  22. If for no other reason than crypt export restrictions (which is the least of
  23. them)  crypt() and encrypt() are not guaranteed to be the same from machine to 
  24. machine. Any system that uses a DES encryption algorithm cannot be exported 
  25. from the U.S.  From there, many unixes use a non-DES algorithm for the 
  26. software they are shipping out of the country, and a DES algorithm for their 
  27. stateside distributions.  Others just stub the crypt algorithm to do a simple
  28. XOR encoding for all their products, and let everyone know where a better
  29. crypt() is.  Some use user supplied seeds, etc. 
  30.  
  31.   Mime assumes that a standard encrypt/decrypt is used, but I can't really
  32. see how that is going to work to make the mail more secure, if the crypt()
  33. is the same for every machine (since every crypt along the way will be able to
  34. read/write it), or how the mail at the other end will be able to decrypt it at 
  35. the other end without knowing about the crypt(), thus making it into a circle.
  36.  
  37.   For some set of computers/Unix Systems where the domain is all Unix Boxes
  38. in the Universe, crypt() will be the same.  If your A and B box are both
  39. members of this limited set, you are in luck.  If not, you may need to 
  40. supply a crypt function of your own to guarantee compatibility.  A lot
  41. depends on manufacturer and DES export restrictions. 
  42.  
  43.   I, personnally, do not necessarily want everyone on the planet to be
  44. able to decrypt my password file, as an example.  By using the features
  45. available using the crypt() function set, I can make it harder for
  46. people to break into my system.
  47.  
  48.   My man page (excerpt) looks like this:
  49.  
  50. CRYPT(3)                   UNIX Programmer's Manual                   CRYPT(3)
  51.  
  52. NAME
  53.      crypt, setkey, encrypt, des_setkey, des_cipher - DES encryption
  54.  
  55. SYNOPSIS
  56.      char
  57.      *crypt(const char *key, const char *setting)
  58.  
  59.      int
  60.      setkey(char *key)
  61.  
  62.      int
  63.      encrypt(char *block, int flag)
  64.  
  65.      int
  66.      des_setkey(const char *key)
  67.  
  68.      int
  69.      des_cipher(const char *in, char *out, long salt, int count)
  70.  
  71. DESCRIPTION
  72.      The crypt function performs password encryption.  It is derived from the
  73.      NBS Data Encryption Standard.  Additional code has been added to deter
  74.      key search attempts.  The first argument to crypt is a NUL-terminated
  75.      string (normally a password typed by a user).  The second is a character
  76.      array, 9 bytes in length, consisting of an underscore (``_'') followed by
  77.      4 bytes of iteration count and 4 bytes of salt.  Both the iteration count
  78.      and the salt are encoded with 6 bits per character, least significant
  79.      bits first.  The values 0 to 63 are encoded by the characters ``./0-9A-
  80.      Za-z'', respectively.
  81.  
  82.      For compatibility with historical versions of crypt(3),  the setting may
  83.      consist of 2 bytes of salt, encoded as above, in which case an iteration
  84.      count of 25 is used, fewer perturbations of DES are available, at most 8
  85.      characters of key are used, and the returned value is a NUL-terminated
  86.      string 13 bytes in length.
  87.  
  88. SEE ALSO
  89.      login(1),  passwd(1),  getpass(3),  passwd(5)
  90.  
  91.  
  92.      Wayne Patterson, Mathematical Cryptology for Computer Scientists and
  93.      Mathematicians, ISBN 0-8476-7438-X, 1987.
  94.  
  95.      R. Morris, and Ken Thompson, "Password Security: A Case History",
  96.      Communications of the ACM, vol. 22, pp. 594-597, Nov. 1979.
  97.  
  98.      M.E. Hellman, "DES will be Totally Insecure within Ten Years", IEEE
  99.      Spectrum, vol. 16, pp. 32-39, July 1979.
  100.  
  101. HISTORY
  102.      A rotor-based crypt() function appeared in Version 6 AT&T UNIX.  The cur-
  103.      rent style crypt() first appeared in Version 7 AT&T UNIX.
  104.  
  105.  
  106.   Hope that helps?
  107.  
  108. TSgt Dave Burgess
  109.