#include
#include
#include
Void very_easy_password (int);
Void very_easy2_password (int);
Void Easy_Password (int);
Void Medium_password (int);
Void hard_password (int);
Void hard2_password (int);
Void Very_hard_password (int);
Void Extreme_Password (int);
Int main (void)
{
Printf ("" PWGEN.EXE, Password Generator, Copyright (C) 2004 Scorpius ");
Printf ("/ N / NPWGEN.EXE IS Free Software; You Can Redistribute IT and / Or Modify");
Printf ("/ Nit Under The Terms of The GNU General Public License As Published BY");
Printf ("/ Nthe Free Software Foundation; Either Version 2 of the license.");
Printf ("/ N / NPWgen.exe IS Distributed in the Hope That IT Will BE Uses);
Printf ("/ NBUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF");
Printf ("/ Nmerchantability Or Fitness for a particular purpose. See the");
Printf ("/ NGNU General Public License for More Details.");
Printf ("/ N / NYOU SHOULD HAVE RECEIVED A COPY OF THE GNU General Public License";
Printf ("/ nalong with this program; if not, write to the free software);"); ");" / NALONG WITH THIS PROGRAM;
Printf ("/ NFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA 0211-1307 USA / N / N");
CHAR AGAIN = 'Y';
While (again == 'y' || again == 'y')
{
INT Password_length = 0;
INT choice = 0;
Printf ("/ n1: (a-z) / t / t / t / t / Tvery Easy Password");
Printf ("/ N2: (a-z) / t / t / t / t / tvery easy password");
Printf ("/ N3: (A-Z, A-Z) / T / T / T / T / TEASIPORD");
Printf ("/ N4: (A-Z, 0-9) / T / T / T / T / TMEDIUM Password");
Printf ("/ N5: (A-Z, A-Z, 0-9) / T / T / T / Thard Password");
Printf ("/ N6: (AZ, 0-9, //] [^ _) / T / T / Thard password"); Printf ("/ N7: (! # $% '(*) , - . /, AZ, 0-9) / Tvery Hard Password ");
Printf ("/ N8: Full Keyboard Characters (Except Space), Almost Impossible To CRACK / N / N");
While (choice <1 || choice> 8)
{
Printf ("Enter the Characterset you wish to use:");
Scanf ("% d", & choice);
}
While ((Password_length <1) || (Password_length> 256))
{
Printf ("Enter The Length of The Password (MAX 256):");
Scanf ("% d", & password_length;
IF (Password_Length <8)
{
Printf ("/ n / nchoosen password is only% D Characters Long!", Password_Length);
Printf ("/ Nremember, a Password IS AS AS LENGTH!");
Printf ("/ NThe Above Gradations Only Apply with a minimal password length of 8./N");
}
}
Printf ("/ NYOUR Password IS:");
Switch (choice)
{
Case 1:
Very_easy_password (Password_length);
Break;
Case 2:
Very_easy2_password (password_length);
Break;
Case 3:
Easy_Password (Password_length);
Break;
Case 4:
Medium_password (Password_length);
Break;
Case 5:
HARD_PASSWORD (Password_length);
Break;
Case 6:
HARD2_Password (Password_length);
Break;
Case 7:
Very_hard_password (Password_length);
Break;
Case 8:
Extreme_password (Password_length);
Break;
DEFAULT:
Break;
}
Printf ("/ nwant to generate another password (y / n)?");
Again = getCH ();
Printf ("/ n / n");
}
Printf ("Thank you for using my program, for qustctions / comments contact me at");
Printf ("/ nscorpius_unknown@yahoo.com");
Printf ("/ npress any key to exit");
Char any = getCH ();
Return 0;
}
/ * (a-z) Very Easy Password * /
Void very_easy_password (length)
{
SRAND (Time (null);
While (Length> 0)
{
int CHA;
Cha = rand ()% 128;
IF ((CHA> = 97 && cha <= 122))
{
Printf ("% C", cha);
Length -;
}
}
}
/ * (A-z) Also Very Easy Password * /
Void very_easy2_password (length)
{
SRAND (Time (null);
While (Length> 0)
{
int CHA;
Cha = rand ()% 128;
IF ((cha> = 65 && cha <= 90)))
{
Printf ("% C", cha);
Length -;
}
}
}
/ * (A-Z, A-Z), easy password * /
Void Easy_Password (Length)
{
SRAND (Time (null);
While (Length> 0)
{
int CHA;
Cha = rand ()% 128;
IF ((cha> = 65 && cha <= 90) || (cha> = 97 && cha <= 122))
{
Printf ("% C", cha);
Length -;
}
}
}
/ * (a-z, 0-9) Medium password * /
Void Medium_Password (Length)
{
SRAND (Time (null);
While (Length> 0)
{
int CHA;
Cha = rand ()% 128;
IF ((cha> = 48 && cha <= 57) || (cha> = 97 && cha <= 122))
{
Printf ("% C", cha);
Length -;
}
}
}
/ * (A-Z, A-Z, 0-9) HARD Password * /
Void hard_password (length)
{
SRAND (Time (null);
While (Length> 0)
{
int CHA;
Cha = rand ()% 128;
IF ((cha> = 48 && cha <= 57) || (cha> = 65 && cha <= 90) || (cha> = 97 && cha <= 122)))
{
Printf ("% C", cha);
Length -;
}
}
}
/ * (A-Z, 0-9, /] [^ _) HARD Password * /
Void Hard2_Password (Length)
{
SRAND (Time (null);
While (Length> 0)
{
int CHA;
Cha = rand ()% 128;
IF ((cha> = 48 && cha <= 57) || (cha> = 91 && cha <= 95) || (CHA> = 97 && cha <= 122)))
{
Printf ("% C", cha);
Length -;
}
}
}
/ * (! "# $% '(*) , -. /, A-z, 0-9) Very Hard Password * /
Void Very_hard_password (length) {
SRAND (Time (null);
While (Length> 0)
{
int CHA;
Cha = rand ()% 128;
IF ((cha> = 48 && cha <= 57) || (cha> = 65 && cha <= 90) || (cha> = 97 && cha <= 122)))
{
Printf ("% C", cha);
Length -;
}
}
}
/ * Full Keyboard Characters (Except Space), Almost Impossible To CRACK * /
Void Extreme_Password (Length)
{
SRAND (Time (null);
While (Length> 0)
{
int CHA;
Cha = rand ()% 128;
IF ((CHA> = 33 && cha <= 126))
{
Printf ("% C", cha);
Length -;
}
}
}