I am looking for a function to provide me with md5 encoding. Is there anything in the standard C libraries to do this? (I haven't used C for some years so I am a little rusty!)
project, as it includes MD5 hash capabilities and more importantly has good documentation.
On the other hand, the code that Salem has pointed to is extremely well exampled, and could be easily modified to do MD5 password comparing suitable for Linux or LDAP password authentication.
Not to beat a dead horse, but since many people may actually want to do passwd file auth under Linux specifically - crypt() will handle the special case of salted MD5 as well as traditional crypt. Strangely my system's shadow file has both traditional and SMD5. Here's a code sample from I ended up using:
+++snip+++
char *userlogin; // From function call
char *userpassword; // From function call
char shadowpass[1024] = "";
char buffer[1024] = "";
char usrSalt[100] = "";
char *saltmine = NULL;
int saltlen = 0;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.