#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
string generatePassword(int minLen, int maxLen) {
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
int length = minLen + (rand() % (maxLen - minLen + 1));
string password = "";
for (int i = 0; i < length; i++) {
password += chars[rand() % chars.size()];
}
return password;
}
int main() {
srand(time(0));
// كلمة المرور الصحيحة التي تعطيها أنت
string target;
cout << "ادخل كلمة المرور الصحيحة: ";
cin >> target;
const int minLength = 12;
const int maxLength = 16;
long long attempts = 0;
string guess;
while (true) {
attempts++;
guess = generatePassword(minLength, maxLength);
if (guess == target) {
cout << "تم العثور على كلمة المرور!" << endl;
cout << "كلمة المرور هي: " << guess << endl;
cout << "عدد المحاولات: " << attempts << endl;
break;
}
// لعرض بعض التخمينات (اختياري)
if (attempts % 1000000 == 0) {
cout << "عدد المحاولات حتى الآن: " << attempts << endl;
}
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: