Annotation of 43BSDReno/foreign/man/crypt.0, revision 1.1.1.1

1.1       root        1: 
                      2: 
                      3: 
                      4: CRYPT(3)                     1986                       CRYPT(3)
                      5: 
                      6: 
                      7: 
                      8: NNAAMMEE
                      9:      crypt, setkey, encrypt - DES encryption
                     10: 
                     11: SSYYNNOOPPSSIISS
                     12:      cchhaarr **ccrryypptt((kkeeyy,, ssaalltt))
                     13:      cchhaarr **kkeeyy,, **ssaalltt;;
                     14: 
                     15:      sseettkkeeyy((kkeeyy))
                     16:      cchhaarr **kkeeyy;;
                     17: 
                     18:      eennccrryypptt((bblloocckk,, eeddffllaagg))
                     19:      cchhaarr **bblloocckk;;
                     20: 
                     21: DDEESSCCRRIIPPTTIIOONN
                     22:      _C_r_y_p_t is the password encryption routine.       It is based on
                     23:      the NBS Data Encryption Standard, with variations intended
                     24:      (among other things) to frustrate use of hardware implemen-
                     25:      tations of the DES for key search.
                     26: 
                     27:      The first argument to _c_r_y_p_t is normally a user's typed pass-
                     28:      word.  The second is a 2-character string chosen from the
                     29:      set [a-zA-Z0-9./].  The _s_a_l_t string is used to perturb the
                     30:      DES algorithm in one of 4096 different ways, after which the
                     31:      password is used as the key to encrypt repeatedly a constant
                     32:      string.  The returned value points to the encrypted pass-
                     33:      word, in the same alphabet as the salt.  The first two char-
                     34:      acters are the salt itself.
                     35: 
                     36:      The other entries provide (rather primitive) access to the
                     37:      actual DES algorithm.  The argument of _s_e_t_k_e_y is a character
                     38:      array of length 64 containing only the characters with
                     39:      numerical value 0 and 1.  If this string is divided into
                     40:      groups of 8, the low-order bit in each group is ignored,
                     41:      leading to a 56-bit key which is set into the machine.
                     42: 
                     43:      The argument to the _e_n_c_r_y_p_t entry is likewise a character
                     44:      array of length 64 containing 0's and 1's.  The argument
                     45:      array is modified in place to a similar array representing
                     46:      the bits of the argument after having been subjected to the
                     47:      DES algorithm using the key set by _s_e_t_k_e_y. The _e_d_f_l_a_g flag
                     48:      is ignored; the argument can only be encrypted.
                     49: 
                     50: SSEEEE AALLSSOO
                     51:      passwd(1), passwd(5), login(1), getpass(3)
                     52: 
                     53: BBUUGGSS
                     54:      The return value points to static data whose content is
                     55:      overwritten by each call.
                     56: 
                     57: 
                     58: 
                     59: 
                     60: 
                     61: 
                     62: 
                     63: Printed 10/21/90            August                             1
                     64: 
                     65: 
                     66: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.