man, this problem refuses to die...

        usage: char *crypt(const char *key, const char *salt);

from the man page:

       If  the salt starts with $1$ an MD5 based password hashing
       algoritm is applied. The salt should consist off $1$  fol-
       lowed with eight characters.

the program:

                #include<stdio.h>
                #include<crypt.h>
                int main(int argc, char *argv[])
                {
                        char salt1[] = "ab";
                        char salt2[] = "$1$12345678";
                        char key[] = "password";    /*   :-)   */
                        char *pass1 = crypt(salt1, key);
                        char *pass2 = crypt(salt2, key);
                        printf("DES: %s\nMD5: %s\n", pass1, pass2);
                        return(0);
                }

the compile:
                gcc -lcrypt -Wall -ansi -pedantic crypto.c

the output:

                # ./a.out
                DES: paWN9Y6oTBa/Q
                MD5: paWN9Y6oTBa/Q

i assume they're both DES.   help?

pete

Reply via email to