Pascii – Password Generator
Downloads:
Description:
Pascii (pronounced Pass Key), uses a Private Key+User Name combo to generate unique strong passwords, It also serves to replace a traditional password vault applications (sort of), as it will always generate the same password for a given user name, as long as the same private key is used. The private key, is generated the first time you run the application, the key can be automatically, or manually updated via the configuration screen.
Future developments for this project, if any will be to
- develop a encryption method for the storage of private keys.
- more organic looking password output.
Screen Shot(s):
|
|
|
|
Notable Code:
The code below is how the key and user input are used to produce the seed that creates the password, the second set of code below is the functions file used to generate the passwords.
Random strRand = new Random( Functions.str2int(PassGen.Properties.Settings.Default.PrivateKey) - Functions.str2int(userInput) ); txtPassword.Text = Functions.GenPassword(strRand);
public static class Functions
{
public static int str2int(string str)
{
int seed = 0;
/*turn the key phrase into an int and use it as seed*/
char[] tmp = str.ToCharArray();
foreach (char x in tmp)
{
seed += (int)x;
}
return seed;
}
}
public static string GetRandomString(Random rnd, int length, string chars)
{
if (chars == null)
{
/*set default values to upper/lower alphanumeric and special*/
chars = PassGen.Properties.Settings.Default.PassChars.ToString()+
PassGen.Properties.Settings.Default.ForcedSpecials.ToString();
}
StringBuilder rs = new StringBuilder();
while (length > 0)
{
rs.Append(chars[(int)(rnd.NextDouble() * chars.Length)]);
length--;
}
return rs.ToString();
}
public static string GenPassword(Random rnd)
{
string password = "";
int passLen = PassGen.Properties.Settings.Default.DefaultLength;
if (PassGen.Properties.Settings.Default.IncludeSpecials == true)
{
password = Functions.GetRandomString(rnd, passLen, null);
}
else
{
string Chars = PassGen.Properties.Settings.Default.PassChars;
password = Functions.GetRandomString(rnd, passLen, Chars);
}
if (PassGen.Properties.Settings.Default.ForceSpecial == true)
{
string specChars = PassGen.Properties.Settings.Default.ForcedSpecials;
/*adds special char to start and end of password*/
password =
Functions.GetRandomString(rnd, 1, specChars) +
password +
Functions.GetRandomString(rnd, 1, specChars);
}
return password;
}



