09-23-04 10:54 PM
Carsten Maul <carsten_maul@gmx.de> writes:
>I want to generate an MD5 checksum with crypt.h, installed OS Debian Woody.
>Unfortunately I only get DES hashes with
>strncpy(salt, row[0], 12);
>salt[12] = '\0';
>encryptedPass = crypt(passwd, salt);
>free(salt);
Typical use is:
crypt(passwd, row[0]);
i.e., pass the entire encrypted password in as salt.
That makes your code portable to different algorithms.
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
[ Post a follow-up to this message ]
|