I am currently using SHA256Managed in ASP.NET Core 3.1 and to be more secure, I would like to use the Hash512.
The Managed postfix suggests that one is managed code where the other is not.
Can someone please explain any concerns that one would need to consider when using unmanaged vs managed? Does the unmanaged required any special deployment e.g. in a Docker container / or operating system requirements.
private string Hash512(string str) {
var message = Encoding.Unicode.GetBytes(str);
var hash = SHA512.Create();
var hashValue = hash.ComputeHash(message);
return Encoding.Unicode.GetString(hashValue);
}
public string Hash256(string str)
{
var message = Encoding.Unicode.GetBytes(str);
var hash = new SHA256Managed();
var hashValue = hash.ComputeHash(message);
return Encoding.Unicode.GetString(hashValue);
}