PDA

View Full Version : [tut] Password generator..



Mogh
12-19-2007, 11:00 PM
If you make c++ programs and are dumb with passwords, make an generator!

Code:


// program
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
#include <string>
using std::cout; // make all absolutely right ;)
using std::cin;
using std::endl;

int main()
{
string password;
srand(time(0));
int num, a, b, c = 8; // c muuttujan arvo == how long password is
for(a = 0; a < c; a ++)
{
b = rand() % 10; // This generate what chrt is coming)
if(b < 3)
{
password[a] = '0' + rand() % 9;
}
if(b > 2 && b < 7)
{
passu[a] = 'a' + rand() % 26;
}
if(b > 6)
{
passu[a] = 'A' + rand() % 26;
}
cout << password[a];
}
return 0;
}


Wuaaah, i was bored and writed some tutorials here..

andy105
12-19-2007, 11:39 PM
Cool ,my noob side (What Dose It Do)

DutchHelFire
12-21-2007, 10:30 AM
i kinda think i know what it does if ur n00b and make ur password welcome cus ur too stupid to think of one this generates one for you as long as ur smart enought to keep it

but How to use? just in a new form or what?

Dxt-Credzis
12-29-2007, 11:02 AM
using std::cout; // make all absolutely right ;)
using std::cin;
using std::endl;


to make your app bigger ???



using namespace std;