Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ crypt(3) — Ultrix-11 3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

login(1)

passwd(1)

getpass(3)

passwd(5)

crypt(3)

NAME

crypt, encrypt, setkey − a one way hashing encryption algorithm

SYNTAX

char *crypt(key, salt)
char *key, *salt;

void setkey(key)
char *key;

void encrypt(block, edflag)
char *block;
int edflag;

DESCRIPTION

The crypt subroutine is the password encryption routine.  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

The key is a user’s typed password.  The salt is a two-character string chosen from the set [a-zA-Z0-9./] and 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 setkey and encrypt subroutines provide (rather primitive) access to the actual DES algorithm.  The setkey 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 above mentioned algorithm to encrypt or decrypt the string block with the function encrypt. 

The block 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 DES algorithm using the key set by setkey.  If edflag is zero, the argument is encrypted; if non-zero, it is decrypted. 

RESTRICTIONS

The return value points to static data whose content is overwritten by each call. 

SEE ALSO

login(1), passwd(1), getpass(3), passwd(5)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026