I am looking for a SHA256 implementation in C# that is FIPS compliant. It turns out that SHA1CryptoServiceProvider works. But why does SHA256CryptoServiceProvider trip the
{"This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms."}
error? Seems like it should just work.
var sha = System.Security.Cryptography.SHA256CryptoServiceProvider.Create(); // not FIPS
In this case I am using .NET 4.5, but the same thing happens in 3.5 and 4.0. I thought SHA256CryptoServiceProvider was the FIPS-compliant alternative to SHA256Managed. SHA256Cng throws the same error.
Update. I think I needed to make a "new SHA256CryptoServiceProvider" instead of using Create()