|
|
1.1 ! root 1: .\" @(#)crypt.3 6.1 (Berkeley) 5/15/85 ! 2: .\" ! 3: .TH CRYPT 3 "May 15, 1985" ! 4: .AT 3 ! 5: .SH NAME ! 6: crypt, setkey, encrypt \- DES encryption ! 7: .SH SYNOPSIS ! 8: .nf ! 9: .B char *crypt(key, salt) ! 10: .B char *key, *salt; ! 11: .PP ! 12: .B setkey(key) ! 13: .B char *key; ! 14: .PP ! 15: .B encrypt(block, edflag) ! 16: .B char *block; ! 17: .fi ! 18: .SH DESCRIPTION ! 19: .I Crypt ! 20: is the password encryption routine. ! 21: It is based on the NBS Data Encryption Standard, with ! 22: variations intended (among other things) to frustrate use of hardware ! 23: implementations of the DES for key search. ! 24: .PP ! 25: The first argument to ! 26: .I crypt ! 27: is normally a user's typed password. ! 28: The second is a 2-character string chosen from the ! 29: set [a-zA-Z0-9./]. ! 30: The ! 31: .I salt ! 32: string is used to perturb the DES algorithm in one of 4096 ! 33: different ways, after which the password ! 34: is used as the key to encrypt repeatedly a constant string. ! 35: The returned value points to the encrypted password, ! 36: in the same alphabet as the salt. ! 37: The first two characters are the salt itself. ! 38: .PP ! 39: The other entries provide (rather primitive) ! 40: access to the actual DES algorithm. ! 41: The argument of ! 42: .I setkey ! 43: is a character array of length 64 containing only the characters ! 44: with numerical value 0 and 1. ! 45: If this string is divided into groups of 8, ! 46: the low-order bit in each group is ignored, ! 47: leading to a 56-bit key which is set into the machine. ! 48: .PP ! 49: The argument to the ! 50: .I encrypt ! 51: entry is likewise a character array of length 64 ! 52: containing 0's and 1's. ! 53: The argument array is modified in place ! 54: to a similar array ! 55: representing the bits of the argument after having been ! 56: subjected to the DES algorithm using the key set by ! 57: .I setkey. ! 58: If ! 59: .I edflag ! 60: is 0, the argument is encrypted; ! 61: if non-zero, ! 62: it is decrypted. ! 63: .SH "SEE ALSO" ! 64: passwd(1), passwd(5), login(1), getpass(3) ! 65: .SH BUGS ! 66: The return value ! 67: points to static data whose content is overwritten ! 68: by each call.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.