Hash a password
#include <unistd.h> char * crypt( const char * key, const char * salt );
liblogin
Use the -l login option to qcc to link against this library.
The crypt() function hashes a password. It's based on the Data Encryption Standard algorithm, and also includes code to deter key search attempts.
The algorithm obtains a 56-bit key by taking the lowest 7 bits of the first eight characters of key. The 56-bit key is used to repeatedly hash a constant string (usually all zeroes).
For license information, see the Third Party License Terms List at http://licensing.qnx.com/third-party-terms/.
A pointer to the 13-character hashed value, or NULL on failure. The first two characters of the hashed value are the salt itself.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | No |