md5 crypt and ncsa_auth

Martijn van Oosterhout kleptog at
Wed Feb 26 19:14:06 EST 2003

On Wed, Feb 26, 2003 at 05:31:42PM +1100, Joel Pearson wrote:
> Hi,
> Does anyone know what sort of encryption/hashing RedHat 8 uses for the
> shadow password file?  From what I could find it seems as though it would
> probably be md5 crypt.

Probably md5 yes.

> Now on the 2nd  part of the question, how hard would it be to change the
> attached code ncsa_auth.c to support md5 crypt as opposed to just crypt?
> (assuming it is md5 crypt I'm looking for)
> I just want to be able to import passwords from the shadow password file for
> use with ncsa_auth.
> My knowledge of C is very limited, but it seems as though it probably would
> be a very simple change.

Did you try it? The stuff in the passwd file is by definition what is
supported by crypt. This line:

        } else if (strcmp(u->passwd, (char *) crypt(passwd, u->passwd))) {

should work just the same for normal crypt as well as md5 crypt. See using

$ perl -e 'print crypt("flyy","dSFDHrYvVN2rI"),"\n"'
$ perl -e 'print crypt("flyy",q[$1$dkhDSe$Qt9W/3OZvczbCzqo1jwNN1] ),"\n"'

Hope this helps,
Martijn van Oosterhout   <kleptog at>
> Support bacteria! They're the only culture some people have.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url :

More information about the linux mailing list