12345678910111213141516171819202122232425262728293031323334353637383940 |
- #define __FORCE_GLIBC
- #include <crypt.h>
- #include <unistd.h>
- extern char * __md5_crypt( const char *pw, const char *salt);
- extern char * __des_crypt( const char *pw, const char *salt);
- extern char * crypt(const char *key, const char *salt)
- {
-
- if (salt[0]=='$' && salt[1]=='1' && salt[2]=='$')
- return __md5_crypt(key, salt);
- else
- return __des_crypt(key, salt);
- }
|