1
I need to generate a salt, but I need all characters to be part of a list of numbers and letters.
string usedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
Gero the 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;
}
Function can be changed to specify characters to be used?
Why limit the
salt
? Or on the other hand, you could not use a random byte for use in passwords and their representation in Base64 to store and carry?– Jefferson Quesado