#include #include #include #include #include "Timer.h" using namespace std; int main() { char * pass; char * crypted1, * crypted2; string word = "abcdefghi"; long long i = 0; crypted1 = strdup(crypt("ihgfedcba", "DB")); TimerStart(); while (next_permutation(word.begin(), word.end())) { // crypted2 = strdup(crypt(word.c_str(), crypted1)); crypted2 = crypt(word.c_str(), crypted1); if (strcmp(crypted1, crypted2) == 0) { cout << "Got it " << word << endl; } i++; } TimerReport(); cout << "Tried " << i << " passwords " << endl; cout << endl; return 0; }