Make salt length and password length static values so can be easier to change.

This commit is contained in:
Tim Young 2017-08-01 17:20:27 -05:00
parent b674c521ba
commit 5654cba0d9
2 changed files with 13 additions and 2 deletions

View File

@ -309,6 +309,8 @@ namespace EduNetworkBuilder
public static int WirelessReconnectDistance = 70; //Try to find a closer AP if we are this far out.
public static int UntaggedVLAN = -1; //If the packet is not tagged.
public static int MaxPacketsBeforeOptimizing = 50;
public static int DefaultPasswordLen = 6;
public static int DefaultSaltLen = 50;
public static string AllowedPasswordCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=!~@#$%^&*()_+{}[]/?<>,.";
public static string AllowedUsernameCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890._";

View File

@ -137,12 +137,21 @@ namespace EduNetworkBuilder
public static string GenSalt(Random RanGen)
{
return GenCharString(RanGen, 50);
return GenSalt(RanGen, NB.DefaultSaltLen);
}
public static string GenSalt(Random RanGen, int length)
{
return GenCharString(RanGen, length);
}
public static string GenUserPW(Random RanGen)
{
return GenCharString(RanGen, 6);
return GenUserPW(RanGen, NB.DefaultPasswordLen);
}
public static string GenUserPW(Random RanGen, int length)
{
return GenCharString(RanGen, length);
}
public static TripleDES GenKey(string password, string salt)