#include #include #include using namespace std; int main() { char * pass; char * crypted1, * crypted2; cout << endl; pass = getpass("What is the password? "); cout << "The password is \"" << pass <<"\"" << endl; cout << endl; crypted1 = strdup(crypt("dan", "DB")); cout << "\"dan\" crypted with \"DB\" is " << crypted1 << endl; crypted2 = strdup(crypt(pass, crypted1)); cout << "\"" << pass << "\" crypted with \"" << crypted1 << "\" is " << crypted2 << endl; cout << endl; if (strcmp(crypted1, crypted2) == 0) { cout << "You win!" << endl; } else { cout << "Rats, you lose! " << endl; } cout << endl; return 0; }