HP C/iX Library Reference Manual (30026-90004)
306 Chapter5
HP C/iX Library Function Descriptions
setkey
setkey
Defines the key used for encrypting blocks of text.
Syntax
void setkey (
key
)
char *
key
;
Parameters
key A pointer to a character string that contains the encryption key.
Return Values
None.
Description
The setkey function provides primitive access to the hashing algorithm used by crypt().
It is used in conjunction with encrypt to first prime the machine and then encrypt a block
of text.
The argument of setkey is an 8-byte character array treated as a 64-bit binary number.
The string is divided into groups of 8 bits, and the low-order bit in each group is ignored.
This gives a 56-bit key that is used to prime the NBS Data Encryption Standard
encryption algorithm. This is the key that is used with the hashing algorithm to encrypt
the string
block
with the encrypt function.
See Also
crypt(), encrypt()