char *crypt (PW, Salt)
const char * PW, * Salt;
void encrypt (Block, EdFlag)
char Block[64];
int EdFlag;
void setkey (Key)
const char * Key;
The crypt and encrypt subroutines encrypt or decrypt data. The crypt subroutine performs a one-way encryption of a fixed data array with the supplied PW parameter. The subroutine uses the Salt parameter to vary the encryption algorithm.
The encrypt subroutine encrypts or decrypts the data supplied in the Block parameter using the key supplied by an earlier call to the setkey subroutine. The data in the Block parameter on input must be an array of 64 characters. Each character must be an char 0 or char 1.
If you need to statically bind functions from libc.a for crypt do the following:
#! ___setkey ___encrypt ___crypt
-bI:YourFileName
where YourFileName is the name of the file you created in step 1. It should look like the following:
LDFLAGS=bnoautoimp -bI:/lib/syscalls.exp -bI:YourFileName -lc
The crypt subroutine returns a pointer to the encrypted password. The static area this pointer indicates may be overwritten by subsequent calls.
The encrypt subroutine
returns the following:
ENOSYS | The encrypt subroutine was called with the EdFlag parameter which was set to a nonzero value. Also, the /usr/lib/libdes.a file does not exist. |
These subroutines are part of Base Operating System (BOS) Runtime.
These subroutines are provided for compatibility with UNIX system implementations.
The newpass (newpass Subroutine) subroutine.
The login command, passwd command, su command.
List of Security and Auditing Subroutines and Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.