private static void TestRandomNumberGenerator()
 {
     for (var i = 0; i < 10; i++)
     {
         Console.WriteLine($"Random Number {i}: {Convert.ToBase64String(RNGCryptoServiceProviderRandomGenerator.GenerateRandomNumber(32))}");
     }
 }
        public static byte[] GenerateSalt()
        {
            // The salt will be of length 32 bytes => 256 bits
            const int saltLength = 32;

            return(RNGCryptoServiceProviderRandomGenerator.GenerateRandomNumber(saltLength));
        }
 public byte[] GenerateRandomNumber(int length)
 {
     return(RNGCryptoServiceProviderRandomGenerator.GenerateRandomNumber(length));
 }
 public static byte[] GenerateSalt()
 {
     return(RNGCryptoServiceProviderRandomGenerator.GenerateRandomNumber(32));
 }
 public static byte[] GenerateKey()
 {
     return(RNGCryptoServiceProviderRandomGenerator.GenerateRandomNumber(keySize));
 }