Advertisement
Guest User

c++ brute-force code unfinish

a guest
Dec 18th, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     string password;
  9.     cout << "Enter a string password = ";
  10.     cin >> password;
  11.     string alphabetslow = "abcdefghijklmnopqrstuvwxyz" ;
  12.     string alphabetsup = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  13.     string numerics = "123456789" ;
  14.     string bruted;
  15.     int counts = 0;
  16.     int i;
  17.  
  18.  
  19.         do {
  20.         cout << "Brute-forcing... \n";
  21.         for ( i = 0; i < 26; i++) {
  22.             if (password[counts] == alphabetsup[i]) {
  23.                 bruted += alphabetsup[i];
  24.                 counts++;
  25.             } else if (password[counts] == alphabetslow[i]) {
  26.                 bruted += alphabetslow[i];
  27.                 counts++;
  28.             }
  29.         }
  30.  
  31.  
  32.     } while (password != bruted);
  33.  
  34.  
  35.  
  36.     cout << "Brute-Forced password is = ";
  37.     cout << bruted << endl;
  38.  
  39.  
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement