/* (C) 2002 Marcello Barnaba */ #include #include #include #include #include #include int main(void) { char encrypted[14]; char salt[3]; char *ascii = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; srand(time(NULL)); salt[0] = ascii[rand() % strlen(ascii)]; salt[1] = ascii[rand() % strlen(ascii)]; salt[2] = '\0'; strcpy(encrypted, crypt(getpass("Password: "), salt)); fprintf(stdout, "%s\n", encrypted); return 0; }