|
-
February 21st, 2018, 08:49 AM
#1
Brute force password cracker.
Hi
I am currently building a brute force password cracker, currently I have a program that allows the user to enter a password (Only in lowercase) and the program will run through all possible options for this password, for example a password of 5 characters is entered it will start with (aaaaa) then (aaaab) then (aaaac) and the so. However, I currently unsure of how to incorporate uppercase characters and special characters into this process so the user can enter a password with all 3 of these and the program will attempt to solve it.
Here is the code i currently have
Code:
#include "stdafx.h"
#include <iostream>
#include <limits>
using namespace std;
# include "string"
int main()
{
string password;
string programPass;
cout << "Please enter a password to test" << endl;
cin >> password;
char lowerDigitArray[] = { 'a' - 1,'a','a','a','a','a','a','a','a','a' };
while (password.compare(programPass) != 0) {
lowerDigitArray[0]++;
for (int x = 0; x <password.length(); x++) {
if (lowerDigitArray[x] == 'z' + 1)
{
lowerDigitArray[x] = 'a';
lowerDigitArray[x + 1]++;
}
}
// creating the string with those digits
programPass = lowerDigitArray[password.length() - 1]; // i set the first one here
for (int i = password.length() - 2; i >= 0; i--)
programPass += lowerDigitArray[i]; // now i add other digits to next to first digit
cout << programPass << endl; // i put it to test how it looks
}
cout << "This is your password " << programPass << endl; // gives the result
return 0;
}
Thanks for any help you offer.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|