Advertisement
daktarism

daktari's brute force key cracker

Mar 17th, 2014
8,950
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 28.83 KB | None | 0 0
  1. /**
  2.     @author
  3.  
  4.     Alias: daktari
  5.  
  6.     Name: Tolga Ay
  7.  
  8.     E-Mail: tolga-ay@outlook.com
  9.  
  10.     Contact :
  11.         facebook : https://www.facebook.com/daktarism/
  12.         steam : http://steamcommunity.com/id/daktar1/
  13.  
  14.     @file
  15.     Project name : daktari's brute force key cracker
  16.  
  17.     Cracking the password "d4Kt4R" with %13 CPU use of i7 3770k
  18.     took 82.6348 mins... -> http://puu.sh/7zfeo.png
  19.  
  20.  
  21.     ->How it works?
  22.  
  23.     Actually, it finds easy password  easier but harder password will be harder because it increases the difficulity level one by one to get the easy password easier.
  24.  
  25.     It starts with one character passwords, tries a simple number charset at first, then if it can't find it, it switches charset until it finds it.
  26.  
  27.     Charset switches like,
  28.  
  29.     1-only numbers (10 characters)
  30.     2-only lowercase characters (26 characters)
  31.     3-only uppercase characters (26 characters)
  32.     4-numbers and lowercase characters (36 characters)
  33.     5-numbers and uppercase characters (36 characters)
  34.     6-uppercase and lowercase characters (52 characters)
  35.     7-numbers, uppercase and lowercase characters (62 characters)
  36.  
  37.     (it wont test the 4/5/6/7 with one char length, and also wont test the 7 with two char length passwords.)
  38.  
  39.     If it still can't find it, the password length increases to 2. and it loops like this, until it finds the password.
  40.  
  41.  EXAMPLES
  42.     ---- some easy ones (probably faster than many brute force password crackers):
  43.     Z : http://puu.sh/7zfpW.png
  44.     i7 : http://puu.sh/7zfmR.png
  45.     123 : http://puu.sh/7zewE.png
  46.     asdf : http://puu.sh/7zeYP.png
  47.     v4Af : http://puu.sh/7zeSG.png   -   http://puu.sh/7zePF.png
  48.     dktri : http://puu.sh/7zf3V.png
  49.  
  50.  
  51.     ---HARD ONE:
  52.     some screenshots of it while cracking the d4Kt4R: (Every dot equals 2,500,000 attempts)
  53.     http://puu.sh/7z8SI.png
  54.     http://puu.sh/7z92e.png
  55.     http://puu.sh/7z94q.png
  56.     http://puu.sh/7z96P.png
  57.     http://puu.sh/7z9KL.png
  58.     *couple pages with full of dots here*
  59.     *happy ending after 82.6348 mins*
  60.     http://puu.sh/7zdsB.png
  61. */
  62.  
  63. #include <iostream>
  64. #include <ctime>
  65. using namespace std;
  66. string crackPassword(string pass);
  67. long long int attempt;
  68. clock_t start_t, end_t;
  69.  
  70. int main(){
  71.     string password;
  72.  
  73.     cout << "Enter the password to crack : ";
  74.     cin >> password;
  75.  
  76.     cout << endl << endl << endl << ">>>>>>>>>>>>>>>>>>>>>>>>>>>\n>> CRACKED THE PASSWORD! >>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl <<  endl <<"The password : " << crackPassword(password) << endl;
  77.     cout << "The number of attempts : " << attempt << endl;
  78.     cout << "The time duration  passed : " << (double)(end_t - start_t)/1000 << " seconds" << endl << endl;
  79.     return 0;
  80. }
  81.  
  82. string crackPassword(string pass){
  83.     int digit[7],alphabetSet=1,passwordLength=1;
  84.     start_t = clock();
  85.  
  86.     string test,alphabet = "1337 also daktari is pro";
  87.     while(1){
  88.  
  89.  
  90.             switch(passwordLength){
  91.                 case 1:
  92.                     while(alphabetSet<4){
  93.                     switch(alphabetSet){
  94.                         case 1 : alphabet = "-0123456789";
  95.                                  cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait";  break;
  96.                         case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
  97.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
  98.                         case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  99.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
  100.                         }
  101.  
  102.                     for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
  103.                                                     attempt++;
  104.                                                     if(attempt%2500000==0) cout << ".";
  105.                                                     test=alphabet[digit[0]];
  106.                                                     for(int i=1;i<passwordLength;i++)
  107.                                                         if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
  108.                                                     if(pass.compare(test)==0){end_t = clock(); return test;}
  109.                                                     }
  110.                                                     alphabetSet++;
  111.                     }
  112.                     break;
  113.                 case 2:
  114.                     alphabetSet=1;
  115.                     while(alphabetSet<6){
  116.                     switch(alphabetSet){
  117.                         case 1 : alphabet = "-0123456789";
  118.                                  cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait";  break;
  119.                         case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
  120.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
  121.                         case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  122.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
  123.                         case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
  124.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
  125.                         case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  126.                         }
  127.  
  128.  
  129.                          for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
  130.                              for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
  131.                                                     attempt++;
  132.                                                     if(attempt%2500000==0) cout << ".";
  133.                                                     test=alphabet[digit[0]];
  134.                                                     for(int i=1;i<passwordLength;i++)
  135.                                                         if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
  136.                                                     if(pass.compare(test)==0){end_t = clock(); return test;}
  137.                                                     }
  138.                                                     alphabetSet++;
  139.                     }
  140.                     break;
  141.                 case 3:
  142.                     alphabetSet=1;
  143.                     while(alphabetSet<8){
  144.                     switch(alphabetSet){
  145.                         case 1 : alphabet = "-0123456789";
  146.                                  cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait";  break;
  147.                         case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
  148.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
  149.                         case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  150.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
  151.                         case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
  152.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
  153.                         case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  154.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
  155.                         case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  156.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
  157.                         case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  158.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
  159.                     }
  160.                                         for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
  161.                                             for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
  162.                                                 for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
  163.                                                     attempt++;
  164.                                                     if(attempt%2500000==0) cout << ".";
  165.                                                     test=alphabet[digit[0]];
  166.                                                     for(int i=1;i<passwordLength;i++)
  167.                                                         if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
  168.                                                     if(pass.compare(test)==0){end_t = clock(); return test;}
  169.                                                     }
  170.                                                     alphabetSet++;
  171.                     }
  172.                     break;
  173.                 case 4:
  174.                     alphabetSet=1;
  175.                     while(alphabetSet<8){
  176.                     switch(alphabetSet){
  177.                         case 1 : alphabet = "-0123456789";
  178.                                  cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait";  break;
  179.                         case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
  180.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
  181.                         case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  182.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
  183.                         case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
  184.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
  185.                         case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  186.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
  187.                         case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  188.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
  189.                         case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  190.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
  191.                     }
  192.  
  193.                                     for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
  194.                                         for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
  195.                                             for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
  196.                                                 for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
  197.                                                     attempt++;
  198.                                                     if(attempt%2500000==0) cout << ".";
  199.                                                     test=alphabet[digit[0]];
  200.                                                     for(int i=1;i<passwordLength;i++)
  201.                                                         if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
  202.                                                     if(pass.compare(test)==0){end_t = clock(); return test;}
  203.                                                     }
  204.                                                     alphabetSet++;
  205.                     }
  206.                     break;
  207.                 case 5:
  208.                     alphabetSet=1;
  209.                     while(alphabetSet<8){
  210.                     switch(alphabetSet){
  211.                         case 1 : alphabet = "-0123456789";
  212.                                  cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait";  break;
  213.                         case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
  214.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
  215.                         case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  216.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
  217.                         case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
  218.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
  219.                         case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  220.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
  221.                         case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  222.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
  223.                         case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  224.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
  225.                     }
  226.                                 for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
  227.                                     for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
  228.                                         for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
  229.                                             for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
  230.                                                 for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
  231.                                                     attempt++;
  232.                                                     if(attempt%2500000==0) cout << ".";
  233.                                                     test=alphabet[digit[0]];
  234.                                                     for(int i=1;i<passwordLength;i++)
  235.                                                         if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
  236.                                                     if(pass.compare(test)==0){end_t = clock(); return test;}
  237.                                                     }
  238.                                                     alphabetSet++;
  239.                     }
  240.                     break;
  241.                 case 6:
  242.                     alphabetSet=1;
  243.                     while(alphabetSet<8){
  244.                     switch(alphabetSet){
  245.                         case 1 : alphabet = "-0123456789";
  246.                                  cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait";  break;
  247.                         case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
  248.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
  249.                         case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  250.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
  251.                         case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
  252.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
  253.                         case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  254.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
  255.                         case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  256.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
  257.                         case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  258.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
  259.                     }
  260.                             for(digit[5]=0;digit[5]<alphabet.length();digit[5]++)
  261.                                 for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
  262.                                     for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
  263.                                         for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
  264.                                             for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
  265.                                                 for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
  266.                                                     attempt++;
  267.                                                     if(attempt%2500000==0) cout << ".";
  268.                                                     test=alphabet[digit[0]];
  269.                                                     for(int i=1;i<passwordLength;i++)
  270.                                                         if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
  271.                                                     if(pass.compare(test)==0){end_t = clock(); return test;}
  272.                                                     }
  273.                                                     alphabetSet++;
  274.                     }
  275.                     break;
  276.                 case 7:
  277.                     alphabetSet=1;
  278.                     while(alphabetSet<8){
  279.                     switch(alphabetSet){
  280.                         case 1 : alphabet = "-0123456789";
  281.                                  cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait";  break;
  282.                         case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
  283.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
  284.                         case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  285.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
  286.                         case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
  287.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
  288.                         case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  289.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
  290.                         case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  291.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
  292.                         case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  293.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
  294.                     }
  295.                         for(digit[6]=0;digit[6]<alphabet.length();digit[6]++)
  296.                             for(digit[5]=0;digit[5]<alphabet.length();digit[5]++)
  297.                                 for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
  298.                                     for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
  299.                                         for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
  300.                                             for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
  301.                                                 for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
  302.                                                     attempt++;
  303.                                                     if(attempt%2500000==0) cout << ".";
  304.                                                     test=alphabet[digit[0]];
  305.                                                     for(int i=1;i<passwordLength;i++)
  306.                                                         if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
  307.                                                     if(pass.compare(test)==0){end_t = clock(); return test;}
  308.                                                     }
  309.                                                     alphabetSet++;
  310.                     }
  311.                     break;
  312.                 case 8:
  313.                     alphabetSet=1;
  314.                     while(alphabetSet<8){
  315.                     switch(alphabetSet){
  316.                         case 1 : alphabet = "-0123456789";
  317.                                  cout << endl << endl <<"Testing only digits(0123456789) - 10 Characters, please wait";  break;
  318.                         case 2 : alphabet = "-abcdefghijklmnopqrstuvwxyz";
  319.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
  320.                         case 3 : alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  321.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
  322.                         case 4 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
  323.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
  324.                         case 5 : alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  325.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
  326.                         case 6 : alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  327.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
  328.                         case 7 : alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  329.                                  cout << endl << endl << "Couldn't find the password, increasing the searching level."<< endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
  330.                     }
  331.                     for(digit[7]=0;digit[7]<alphabet.length();digit[7]++)
  332.                         for(digit[6]=0;digit[6]<alphabet.length();digit[6]++)
  333.                             for(digit[5]=0;digit[5]<alphabet.length();digit[5]++)
  334.                                 for(digit[4]=0;digit[4]<alphabet.length();digit[4]++)
  335.                                     for(digit[3]=0;digit[3]<alphabet.length();digit[3]++)
  336.                                         for(digit[2]=0;digit[2]<alphabet.length();digit[2]++)
  337.                                             for(digit[1]=0;digit[1]<alphabet.length();digit[1]++)
  338.                                                 for(digit[0]=1;digit[0]<alphabet.length();digit[0]++){
  339.                                                     attempt++;
  340.                                                     if(attempt%2500000==0) cout << ".";
  341.                                                     test=alphabet[digit[0]];
  342.                                                     for(int i=1;i<passwordLength;i++)
  343.                                                         if(alphabet[digit[i]]!='-')test+=alphabet[digit[i]];
  344.                                                     if(pass.compare(test)==0){end_t = clock(); return test;}
  345.                                                     }
  346.                                                     alphabetSet++;
  347.                     }
  348.                     break;
  349.             }
  350.             cout  << endl << endl << endl << endl << "*************************************************************" << endl;
  351.             cout  << "*** Password length is not " << passwordLength <<  ". Increasing password length! ***";
  352.             cout  << endl << "*************************************************************" << endl << endl;
  353.             passwordLength++;
  354.     }
  355.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement