home *** CD-ROM | disk | FTP | other *** search
-
-
-
- CCCCRRRRYYYYPPPPTTTT((((3333XXXX)))) CCCCRRRRYYYYPPPPTTTT((((3333XXXX))))
-
-
-
- NNNNAAAAMMMMEEEE
- crypt - password and file encryption functions
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- cccccccc [[[[ffffllllaaaagggg ............]]]] ffffiiiilllleeee ............ ----llllccccrrrryyyypppptttt
-
- cccchhhhaaaarrrr ****ccccrrrryyyypppptttt((((cccchhhhaaaarrrr ****kkkkeeeeyyyy,,,, cccchhhhaaaarrrr ****ssssaaaalllltttt))));;;;
-
- vvvvooooiiiidddd sssseeeettttkkkkeeeeyyyy((((cccchhhhaaaarrrr ****kkkkeeeeyyyy))));;;;
-
- vvvvooooiiiidddd eeeennnnccccrrrryyyypppptttt((((cccchhhhaaaarrrr ****bbbblllloooocccckkkk,,,, iiiinnnntttt ffffllllaaaagggg))));;;;
-
- cccchhhhaaaarrrr ****ddddeeeessss____ccccrrrryyyypppptttt((((cccchhhhaaaarrrr ****kkkkeeeeyyyy,,,, cccchhhhaaaarrrr ****ssssaaaalllltttt))));;;;
-
- vvvvooooiiiidddd ddddeeeessss____sssseeeettttkkkkeeeeyyyy((((cccchhhhaaaarrrr ****kkkkeeeeyyyy))));;;;
-
- vvvvooooiiiidddd ddddeeeessss____eeeennnnccccrrrryyyypppptttt((((cccchhhhaaaarrrr ****bbbblllloooocccckkkk,,,, iiiinnnntttt ffffllllaaaagggg))));;;;
-
- iiiinnnntttt rrrruuuunnnn____sssseeeettttkkkkeeeeyyyy((((iiiinnnntttt pppp[[[[2222]]]],,,, cccchhhhaaaarrrr ****kkkkeeeeyyyy))));;;;
-
- iiiinnnntttt rrrruuuunnnn____ccccrrrryyyypppptttt((((lllloooonnnngggg ooooffffffffsssseeeetttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt ccccoooouuuunnnntttt,,,, iiiinnnntttt pppp[[[[2222]]]]))));;;;
-
- iiiinnnntttt ccccrrrryyyypppptttt____cccclllloooosssseeee((((iiiinnnntttt pppp[[[[2222]]]]))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _d_e_s__c_r_y_p_t is the password encryption function. It is based on a one way
- hashing encryption algorithm with variations intended (among other
- things) to frustrate use of hardware implementations of a key search.
-
- _K_e_y is a user's typed password. _S_a_l_t is a two-character string chosen
- from the set [aaaa----zzzzAAAA----ZZZZ0000----9999....////]; this string is used to perturb the hashing
- algorithm in one of 4096 different ways, after which the password is used
- as the key to encrypt repeatedly a constant string. The returned value
- points to the encrypted password. The first two characters are the salt
- itself.
-
- The _d_e_s__s_e_t_k_e_y and _d_e_s__e_n_c_r_y_p_t entries provide (rather primitive) access
- to the actual hashing algorithm. The argument of _d_e_s__s_e_t_k_e_y is a
- character array of length 64 containing only the characters with
- numerical value 0 and 1. If this string is divided into groups of 8, the
- low-order bit in each group is ignored; this gives a 56-bit key which is
- set into the machine. This is the key that will be used with the hashing
- algorithm to encrypt the string _b_l_o_c_k with the function _d_e_s__e_n_c_r_y_p_t.
-
- The argument to the _d_e_s__e_n_c_r_y_p_t entry is a character array of length 64
- containing only the characters with numerical value 0 and 1. The
- argument array is modified in place to a similar array representing the
- bits of the argument after having been subjected to the hashing algorithm
- using the key set by _d_e_s__s_e_t_k_e_y. If _e_d_f_l_a_g is zero, the argument is
- encrypted; if non-zero, it is decrypted.
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- CCCCRRRRYYYYPPPPTTTT((((3333XXXX)))) CCCCRRRRYYYYPPPPTTTT((((3333XXXX))))
-
-
-
- Note that decryption is not provided in the international version of
- _c_r_y_p_t. The international version is part of the C Development Set, and
- the domestic version is part of the Encryption Utilities. If decryption
- is attempted with the international version of _d_e_s__e_n_c_r_y_p_t, an error
- message is printed.
-
- _C_r_y_p_t, _s_e_t_k_e_y, and _e_n_c_r_y_p_t are front-end routines that invoke _d_e_s__c_r_y_p_t,
- _d_e_s__s_e_t_k_e_y, and _d_e_s__e_n_c_r_y_p_t respectively.
-
- The routines _r_u_n__s_e_t_k_e_y and _r_u_n__c_r_y_p_t are designed for use by
- applications that need cryptographic capabilities [such as _e_d(1) and
- _v_i(1)] that must be compatible with the _c_r_y_p_t(1) user-level utility.
- _R_u_n__s_e_t_k_e_y establishes a two-way pipe connection with _c_r_y_p_t(1), using _k_e_y
- as the password argument. _R_u_n__c_r_y_p_t takes a block of characters and
- transforms the cleartext or ciphertext into their ciphertext or cleartext
- using _c_r_y_p_t(1). _O_f_f_s_e_t is the relative byte position from the beginning
- of the file that the block of text provided in _b_l_o_c_k is coming from.
- _C_o_u_n_t is the number of characters in _b_l_o_c_k, and _c_o_n_n_e_c_t_i_o_n is an array
- containing indices to a table of input and output file streams. When
- encryption is finished, _c_r_y_p_t__c_l_o_s_e is used to terminate the connection
- with _c_r_y_p_t(1).
-
- If a null key is passed to _r_u_n__s_e_t_k_e_y, 0 is returned. Otherwise, 1 is
- returned. _R_u_n__c_r_y_p_t returns -1 if it cannot write output or read input
- from the pipe attached to _c_r_y_p_t. Otherwise it returns 0.
-
- The routines above are found in the library ``libcrypt.a'', and are
- loaded if the option ``-lcrypt'' is used with _c_c(1) or _l_d(1).
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- crypt(1), login(1), passwd(1), getpass(3C), passwd(4).
-
- NNNNOOOOTTTTEEEESSSS
- In the international version of _c_r_y_p_t(3X), a flag argument of 1 to
- _e_n_c_r_y_p_t or _d_e_s__e_n_c_r_y_p_t is not accepted, and _e_r_r_n_o is set to _E_N_O_S_Y_S to
- indicate that the functionality is not available.
-
- The return value in _c_r_y_p_t points to static data that are overwritten by
- each call.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-