I have a method for creating a hashed password. However, it falls on salt. CopyTo (pwd, 0); Says that target byte [] is too small. How to solve the problem?
public static byte[] CreateHashedPassword(string password, byte[] salt)
{
SHA1 sha1 = SHA1.Create();
byte[] pwd = CustomHelpers.StringToByteArray(password);
salt.CopyTo(pwd, 0);
sha1.ComputeHash(pwd);
return pwd;
}
source
share