Esempio n. 1
0
 private static byte[] GetSK(int seed)
 {
     var random = new AscRandom(seed);
     var randomKey = new byte[32];
     for (var i = 0; i < randomKey.Length; i++)
     {
         randomKey[i] = (byte)random.Next(byte.MaxValue);
     }
     return randomKey;
 }
Esempio n. 2
0
 public static string GeneratePassword(int length)
 {
     const string noise = "1234567890mnbasdflkjqwerpoiqweyuvcxnzhdkqpsdk";
     var random = new AscRandom();
     var pwd = string.Empty;
     while (0 < length--) pwd += noise[random.Next(noise.Length)];
     return pwd;
 }