霧隱雷藏 2008-11-2 11:48
密碼暴力破解器核心代碼
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
char chr[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
int a, chrlen = strlen(chr);
cout << "請輸入密碼長度: ";
cin >> a;
cout.setf(ios::fixed);
int (*b)[1] = new int[a][1];
for (int i=0;i<a;i++)
b[i][0] = 0;
for (int i=0;i<pow(chrlen,(float)a);i++)
{
for (int j=a-1;j>=0;j--)
{
if (b[j][0]>=chrlen && j>0)
{
b[j][0] = 0;
b[j-1][0]++;
}
cout << chr[b[j][0]];
}
cout << " ";
b[a-1][0]++;
}
delete b;
system("PAUSE");
return 0;
}
這個程式是不是不能破解密碼