您能否告诉我以下是否是安全散列密码以存储在数据库中的好方法:
public string CreateStrongHash(string textToHash) {
byte[] salt =System.Text.Encoding.ASCII.GetBytes("TeStSaLt");
Rfc2898DeriveBytes k1 = new Rfc2898DeriveBytes(textToHash, salt, 1000);
var encryptor = SHA512.Create();
var hash = encryptor.ComputeHash(k1.GetBytes(16));
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hash.Length; i++) {
sb.Append(hash[i].ToString("x2"));
}
return sb.ToString();
}
提前谢谢了。