#include "iostream.h"
#include "stdio.h"
#include "stdlib.h" // rand()
Code:
int main()
{
int i, c, d, num_chars, num_passwds;
static char *letters[] = { "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" };
char FileName[30];
cout << "\n How many Chars? : ";
cin >> num_chars;
cout << " How many Passwords? : ";
cin >> num_passwds;
cout << " Output File : ";
cin >> FileName;
FILE *wordfile;
wordfile = fopen(FileName,"w");
d = 1;
fflush(wordfile);
while(d <= num_passwds)
{
d++;
c = 1;
while(c <= num_chars)
{
c++;
i = rand() % 26;
fprintf(wordfile, "%s", letters[i]);
}
fputs("\n", wordfile);
}
fclose(wordfile);
return 0;
}
Yes, i know.. this is some wierd'ed-out code(not clean looking). I didn't spend much time on it, and its very simple stuff.
Heres an Idea.
----
I just thought about this ...
Instead of programming a "random" password generator(because there is already enough out there), why not program a "real" word generator? Heres how it could work.
----
Pass an actual document on something familiar(maybe a real dictionary)through the program, then have it split up everyword and check for repeats of the same word ... this way, you would have real words, and not random characters. And if You know what your victim is into, what he or she likes, but you don't know what words to use, pass a document on whatever they like and you would have "real" words on that subject without ever knowing anything on it.
Would go something like this
----
- Get a file that talks about something
- Split everyword up and write it to a file
- Read-in the file that you wrote to, and check for repeats - if any repeats, take them out and re-write
kinda interesting ...