Difference between HMACSHA256 and HMACSHA512
问题 We are using the below code to generate a HMac hash against a sensitive value in C# public string GenerateHMac(string key, string message) { var decodedKey = Convert.FromBase64String(key); var hasher = new HMACSHA256(decodedKey); var messageBytes = Encoding.Default.GetBytes(message); var hash = hasher.ComputeHash(messageBytes); return Convert.ToBase64String(hash); } The key passed in is a 256 bit base 64 encoded string. A question was raised as to whether we should be using HMACSHA256,