Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <cmath>
  5. #include "md5.h"
  6.  
  7. using namespace std;
  8.  
  9. vector<string> randpgen(vector<string> &a, vector<string> &b) {
  10. char alphabet[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
  11.  
  12. vector<string>::iterator iterb = b.begin();
  13. for (auto itera = a.begin(); itera < a.end(); ++itera) {
  14. for (int i = 0; i < 26; i++) {
  15. *iterb = *itera + alphabet[i];
  16. ++iterb;
  17. }
  18. }
  19.  
  20. return b;
  21. }
  22.  
  23. int main() {
  24. vector<string> randp1{"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
  25. vector<string> randp2(pow(26, 2)), randp3(pow(26, 3)), randp4(pow(26, 4)), randp5(pow(26, 5)), randp6(pow(26, 6));
  26.  
  27. randp2 = randpgen(randp1, randp2);
  28. randp3 = randpgen(randp2, randp3);
  29. randp4 = randpgen(randp3, randp4);
  30. randp5 = randpgen(randp4, randp5);
  31. //randp6 = randpgen(randp5, randp6);
  32.  
  33. for (auto j = randp5.begin(); j != randp5.end(); ++j) {
  34. cout << *j << ' ';
  35. }
  36.  
  37. cout << endl;
  38.  
  39. cout << "Size 5 character passwords: " << randp5.size() << endl;
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement