PostPassword Generator

Posts 1–12 of 12 · Page 1 of 1
Password Generator
Just a simple little password generator
Code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;

static const char alphabet_Numbers[] =
"0123456789"
"!@#$&"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int size = sizeof(alphabet_Numbers) - 1;

int main()
{
    system("color a");
    //password length
    int length = 8;

    srand(time(0));
    for (int i = 0; i < length; i++)
    {
        cout << alphabet_Numbers[rand() % size];
    }
    return 0;
    }
Pretty good, you should make it so that it allows the user to enter the length of their wanted password.
Quote Originally Posted by NUKE99X View Post
Pretty good, you should make it so that it allows the user to enter the length of their wanted password.

Beautiful avatar of itachi.
Quote Originally Posted by DaniielSanchez View Post
Beautiful avatar of itachi.


/2shorttt
Quote Originally Posted by NUKE99X View Post
Pretty good, you should make it so that it allows the user to enter the length of their wanted password.
Code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;

static const char alphabet_Numbers[] =
"0123456789"
"!@#$&"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int size = sizeof(alphabet_Numbers) - 1;

int main()
{
    system("color a");
    //password length
    cout<<"enter your desired length \n";
    cin>>length;
    srand(time(0));
    for (int i = 0; i < length; i++)
    {
        cout << alphabet_Numbers[rand() % size];
    }
    return 0;
    }
Quote Originally Posted by Hackinet View Post
Code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;

static const char alphabet_Numbers[] =
"0123456789"
"!@#$&"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int size = sizeof(alphabet_Numbers) - 1;

int main()
{
    system("color a");
    //password length
    cout<<"enter your desired length \n";
    cin>>length;
    srand(time(0));
    for (int i = 0; i < length; i++)
    {
        cout << alphabet_Numbers[rand() % size];
    }
    return 0;
    }
You forgot to declare length (int length; ), other than that, it looks good.
It's not ACTUALLY random, it's pseudo-random
Quote Originally Posted by Copperhorse View Post
It's not ACTUALLY random, it's pseudo-random
pc can't do 'random'
Where are the passwords from ? is it just loads of passwords you entered ?
Quote Originally Posted by Ogma. View Post
Where are the passwords from ? is it just loads of passwords you entered ?
The passwords is made up randomly from the chars in the array, doing this makes it harder to brute-force the password using a dictionary attack, however the actual program is only allotting 8 characters to be used in the password which wont take long using a normal brute-force attack, although with the added difficulty of numbers, special chars and uppercase letters, this will make it harder to crack.
Nice Good Work
or you could just use keepass 2 and generate 256bit strong passwords
Posts 1–12 of 12 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us