示例#1
0
 public static void GenerateRandomPassphrase(int length)
 {
     if (length >= 4 && length <= 20)
     {
         char[] passphrase = PasswordGenerator.GenerateRandomPassphrase(length, true, true);
         Console.WriteLine(passphrase);
         Utilities.ZeroArray(passphrase);
     }
     else
     {
         Console.WriteLine("Error: Invalid number of words. Randomly generated passphrases must be between 4-20 words.");
     }
 }
示例#2
0
 public static void GenerateRandomPassword(int length)
 {
     if (length >= 8 && length <= 128)
     {
         char[] password = PasswordGenerator.GenerateRandomPassword(length, true, true, true, true);
         Console.WriteLine(password);
         Utilities.ZeroArray(password);
     }
     else
     {
         Console.WriteLine("Error: Invalid length. Randomly generated passwords must be between 8-128 characters.");
     }
 }