01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CRYPT (3C) (Domestic Version Only ) CRYPT (3C)<br />

NAME<br />

crypt, setkey, encrypt - generate DES encryption<br />

SYNOPSIS<br />

char *crypt (key, salt)<br />

char *key, *salt;<br />

void setkey (key)<br />

char *key;<br />

void encrypt (block, edflag)<br />

char *block;<br />

int edflag;<br />

DESCRIPTION<br />

This function is available only in the domestic (U.S.) version of<br />

the UNIX PC software.<br />

Crypt is the password encryption function. It is based on the NBS<br />

Data Encryption Standard (DES), with variations intended (among<br />

other things) to frustrate use of hardware implementations of the<br />

DES for key search.<br />

Key is a user's typed password. Salt is a two-character string<br />

chosen from the set [a- z A-Z 0-9 • /]; this string is used to perturb<br />

the DES algorithm in one of 4096 different ways, after which<br />

the password is used as the key to encrypt repeatedly a constant<br />

string. The returned value points to the encrypted password.<br />

The first two characters are the salt itself.<br />

The setkey and encrypt entries provide (rather primitive) access<br />

to the actual DES algorithm. The argument of setkey is a character<br />

array of length 64 containing only the characters with numerical<br />

value 0 and 1. If this string is divided into groups of 8, the<br />

low-order bit in each group is ignored; this gives a 56-bit key<br />

which is set into the machine. This is the key that will be used<br />

with the above mentioned algorithm to encrypt or decrypt the<br />

string block with the function encrypt.<br />

The argument to the encrypt entry is a character array of length<br />

64 containing only the characters with numerical value 0 and 1.<br />

The argument array is modified in place to a similar array<br />

representing the bits of the argument after having been subjected<br />

to the DES algorithm using the key set by setkey. If edflag ts<br />

zero, the argument is encrypted; if non-zero, it is decrypted.<br />

SEE ALSO<br />

login( 1M), passwd( 1), getpass(3C), passwd( 4).<br />

BUGS<br />

The return value points to static data that are overwritten by<br />

each call.<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!