![]() |
![]() |
![]() |
![]() |
![]() |
This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Encrypt a password
#include <unistd.h> char * crypt( const char * key, const char * salt );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
![]() |
This function is in libc.a, but not in libc.so (in order to save space). |
The crypt() function performs password encryption. It's based on the Data Encryption Standard algorithm, and also includes code to deter key search attempts.
![]() |
This function checks only the first eight characters of key. |
You can obtain a 56-bit key by taking the lowest 7 bits of key. The 56-bit key is used to repeatedly encrypt a constant string (usually all zeroes).
A pointer to the 13-character encrypted value, or NULL on failure. The first two characters of the encrypted value are the salt itself.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | No |
The return value points to static data that's overwritten by each call to crypt().
encrypt(), getpass(), qnx_crypt(), setkey()
login in the Utilities Reference
Copyright © MINIX Operating System
![]() |
![]() |
![]() |
![]() |