estoy generando sal y valores hash de mis contraseñas mediante el uso,[Servidor Sql] ¿qué tipo de datos usar para los valores de sal y hash de la contraseña y qué longitud?
string salt = CreateSalt(TxtPassword.Text.Length);
string hash = CreatePasswordHash(TxtPassword.Text, salt);
private static string CreateSalt(int size)
{
//Generate a cryptographic random number.
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
byte[] buff = new byte[size];
rng.GetBytes(buff);
// Return a Base64 string representation of the random number.
return Convert.ToBase64String(buff);
}
private static string CreatePasswordHash(string pwd, string salt)
{
string saltAndPwd = String.Concat(pwd, salt);
string hashedPwd =
FormsAuthentication.HashPasswordForStoringInConfigFile(
saltAndPwd, "sha1");
return hashedPwd;
}
Qué tipo de datos que sugiere para almacenar estos valores en SQL Server? Cualquier sugerencia ...
Sal: 9GsPWpFD
Hash: E778AF0DC5F2953A00B35B35D80F6262CDBB8567
+ buena pregunta. –