I need to generate a salt, but I need all the characters to be part of a list of numbers and letters.
string usedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
I generate salt with this function:
public static byte[] GenerateSalt(int SaltByteLength)
{
System.Text.Encoding enc = System.Text.Encoding.ASCII;
RNGCryptoServiceProvider rncCsp = new RNGCryptoServiceProvider();
byte[] salt = new byte[SaltByteLength];
rncCsp.GetBytes(salt);
return salt;
}
Is it possible to change the function to indicate the characters to use?