public static string GeneratePasswordSalt()
{
// Create byte array to store salt
byte[] salt = new byte[32];
// Fill array using RNG
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
{
rng.GetBytes(salt);
}
// Return string representation
return Convert.ToBase64String(salt);
}