#include <iostream>
#include <vector>
using namespace std;

const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; // أساس 36

// تحويل رقم إلى كلمة مرور بطول معين
string numberToPassword(long long num, int length) {
    string pass(length, 'A');
    int base = chars.size();

    for (int i = length - 1; i >= 0; i--) {
        pass[i] = chars[num % base];
        num /= base;
    }
    return pass;
}

int main() {
    string target;
    cout << "ادخل كلمة المرور الصحيحة: ";
    cin >> target;

    int minLength = 12, maxLength = 16;
    long long attempts = 0;

    for (int len = minLength; len <= maxLength; len++) {
        long long maxNum = 1;
        for (int i = 0; i < len; i++) maxNum *= chars.size(); // 36^len

        cout << "جاري التجربة بطول " << len << " ..." << endl;

        for (long long num = 0; num < maxNum; num++) {
            attempts++;
            string guess = numberToPassword(num, len);

            if (guess == target) {
                cout << "تم العثور على كلمة المرور!" << endl;
                cout << "كلمة المرور هي: " << guess << endl;
                cout << "عدد المحاولات: " << attempts << endl;
                return 0;
            }

            if (attempts % 1000000 == 0) {
                cout << "عدد المحاولات حتى الآن: " << attempts << endl;
            }
        }
    }

    cout << "لم يتم العثور على كلمة المرور ضمن الطول المحدد." << endl;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: