Please check the class bellow. Here i am doing password hash then comparing this password hash. Now my question is is it best practice to store user password securely? Please advice and you can add better implementation on my class. Thanks in advance
public class myCrypto
{
public static string MakeHash(string value)
{
return Convert.ToBase64String(SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(value)));
}
public static bool CompareHash(string plainString, string hashString)
{
if (MakeHash(plainString)==hashString)
{
return true;
}
else
{
return false;
}
}
}