PWD Generator [+SOURCE]
Thanks to Hassan, for the main part of this program. Simple but effective password generator. 4 levels:
Only problem I found was if you type in a letter for the "how many characters should it be?" then it will keep repeating...I have no clue why. Anyways, I will be using this and it might be useful to others too so attached is the files,
has both 32 and 64 bit versions. Source code provided below:
very simple I know, but hey it works for what its made for...right? 
32 and 64 bit why? I have no clue, it's just cool, just yesterday I got it to compile 64-bit right so yeah lol.
Hassan's Edit: Removed attachment. Can't approve compiled stuff.
- low - upper and lower case letters
- med - upper and lower case letters with 0-9 numbers
- high - upper and lower case letters with 0-9 numbers with simple symbols
- super - upper and lower case letters with 0-9 numbers with all symbols
Only problem I found was if you type in a letter for the "how many characters should it be?" then it will keep repeating...I have no clue why. Anyways, I will be using this and it might be useful to others too so attached is the files,
Code:
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
int main(){
string cmd,pwd;
int lng = 0;
string low = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz";
string med = "Aa0Bb1Cc2Dd3Ee4Ff5Gg6Hh7Ii8Jj9KkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz";
string high = "Aa0Bb1Cc2Dd3Ee4Ff5Gg6Hh7Ii8Jj9Kk!Ll@Mm#Nn$Oo%Pp^Qq&Rr*Ss(Tt)Uu_Vv-Ww+Xx=YyZz";
string super = "[A!a@B#b$C^c%D&d*E(e)F{f}G`g~H:h;I'i|J<j>K,k.L/l?M\m=N+n-O_o1P2p3Q4q5R6r7S8s9T0tUuVvWwXxYyZz]";
gen:
cout << "how strong? low, med, high, or super? ";
cin >> cmd;
cout << "how many characters should it be? ";
cin >> lng;
if(cmd=="low"){
for(int i = 0; i < lng; ++i){
pwd += low[rand() % (low.length())];
}
cout << pwd.c_str() << endl;
cin.get();
}
if(cmd=="med"){
for(int i = 0; i < lng; ++i){
pwd += med[rand() % (med.length())];
}
cout << pwd.c_str() << endl;
cin.get();
}
if(cmd=="high"){
for(int i = 0; i < lng; ++i){
pwd += high[rand() % (high.length())];
}
cout << pwd.c_str() << endl;
cin.get();
}
if(cmd=="super"){
for(int i = 0; i < lng; ++i){
pwd += super[rand() % (super.length())];
}
cout << pwd.c_str() << endl;
cin.get();
}
if(cmd==""){
cout << "invalid input!" << endl;
}
pwd.clear();
goto gen;
return 0;
}

32 and 64 bit why? I have no clue, it's just cool, just yesterday I got it to compile 64-bit right so yeah lol.
Hassan's Edit: Removed attachment. Can't approve compiled stuff.


