Advertisement
Guest User

Untitled

a guest
Dec 18th, 2016
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.      
  7.      std::string charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  8.      
  9.      std::string password, bruted;
  10.      
  11.      std::cout << "Enter a string password = ";
  12.      
  13.      std::cin >> password;
  14.      
  15.      int charset_len = charset.length();
  16.      
  17.      int pass_len = password.length();
  18.      
  19.      for(int a = 0; a < pass_len; a++) {            
  20.          
  21.           for(int b = 0; b < charset_len; b++) {
  22.                
  23.                if(password[a] == charset[b]) {
  24.                    
  25.                     bruted += charset[b];
  26.                    
  27.                     break;
  28.                    
  29.                }
  30.                
  31.           }
  32.          
  33.      }
  34.      
  35.      std::cout << std::endl << "Brute-Forced password is = " << bruted << std::endl;    
  36.      
  37.      return(0);
  38.      
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement