#include #include #include using namespace std; const string SALT_BASE {"$6$"}; const string PASSWORD {"bob"}; int main() { string password; string saltExtra; string salt; string hash; string rehash; while (1) { cout << "Enter a salt " << endl; cin >> saltExtra; salt = SALT_BASE + saltExtra + "$"; cout << "The encrypted password is: " << endl ; hash = crypt(password.c_str(), salt.c_str()); cout << '\t' << hash << endl; rehash = crypt(password.c_str(), hash.c_str()); cout << '\t' << rehash << endl; } return 0; }