#include <iostream>
#include <string>
#include <ctime>
#include <limits>
usingnamespace std;
//-------------------------------------Declarations of Variables------------------------------------------------------//
_int64 password; // The input number
_int64 tryer = 0; // Even Numbers Bruteforce
_int64 tryer1 = 0; // +1
_int64 tryer2 = 0; // Odd Numbers Bruteforce
int indicator = 0; // Whether it has succeed or not.
//---------------------------Testing Bruteforce (Optional to speed up process) WARNING, can hog up computer-----//
_int64 tryer3 = 0; // +4 Bruteforce
_int64 tryer4 = 0; //+5 Bruteforce
_int64 tryer5 = 0; // +6 Bruteforce
_int64 tryer6 = 0; // +7 bruteforce
_int64 tryer7 = 0; //+8 Bruteforce
_int64 tryer8 = 0; //+9 Bruteforce
_int64 tryer9 = 0; // +10 bruteforce
_int64 timer = 0; // Timer!
//--------------------------------------------------------------------------------------------------------------------//
//--------------------------------------------Classes for functions---------------------------------------------------//
void AddNumbers(){ // Added to simplify and make things neater.
tryer1 += 1;
tryer += 2;
tryer2 += 3;
tryer3 += 4;
tryer4 += 5;
tryer5 += 6;
tryer6 += 7;
tryer7 += 8;
tryer8 += 9;
tryer9 += 10;
}
void SM(int x){ // Made to save time instead of typing them out one by one.
if(x == password){
indicator = 1;
cout << "Success! Your password have just been cracked and it is: " << x << endl;
}
}
void Check(){
if(password == 1){
cout << "Hey kiddo, this ain't no joke, if it was 1 it would have been already bypassed!" << endl;
system("PAUSE");
}
if(password >= 9223372036854775807){
cout << "Sorry, the password you have just entered has reached the maximum value." << endl;
}
}
//--------------------------------------------------------------------------------------------------------------------//
int main(){
cout << "Welcome to the program made by Darren Kok!\n" << endl;
cout << "Please enter the number you want cracked. Note: Try your best to enter 10 or less than that digits. " << endl;
cin >> password;
Check();
while(indicator != 1){ // bruteforce.
SM(tryer);
SM(tryer1);
SM(tryer2);
SM(tryer3);
SM(tryer4);
SM(tryer5);
SM(tryer6);
SM(tryer7);
SM(tryer8);
SM(tryer9);
AddNumbers();
}
system("PAUSE");
}
UPDATE: Final piece of work, how can I make the bruteforce faster?
Can someone please teach me how to make the bruteforce faster?
Bruteforce isn't fast.
Bruteforcing means checking all the possible solutions until you find the valid one. Its "speed" is determined by the hardware, and is degraded by how many possible solutions it has to go through.
1) You can gain speed by devising an algorithm which isn't bruteforce, that is to say it doesn't check through all possibilities. An example is a dictionary attack, where you have a database of "most common" numbers. http://en.wikipedia.org/wiki/Dictionary_attack