Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an alternate hashing algorithm to MD5 for FIPS-enabled systems?

Tags:

Whenever I try to use MD5 on a Windows XP machine that has FIPS enabled, I am getting a System.InvalidOperationException.

Is there an alternate algorithm that I should use instead of MD5 on FIPS?

like image 208
qazwsx Avatar asked Feb 03 '11 23:02

qazwsx


2 Answers

MD5 is not FIPS compliant. You can use instead of the MD5 one of the following hashing algorithms:

  • HMACSHA1
  • MACTripleDES
  • SHA1CryptoServiceProvider
like image 157
Borja Avatar answered Sep 29 '22 11:09

Borja


When you enforce FIPS compliance in the Windows security policy settings, you're asserting that you are only going to use FIPS-certified encryption and hashing algorithms. MD5 is not one of these approved hashing algorithms, and that's why the exception is being thrown.

The workaround is simple: choose a different hashing algorithm. The .NET Framework provides plenty of other options in the System.Security.Cryptography namespace. Select one of the SHA family of algorithms. I can't imagine any reason you would have to use MD5 as opposed to one of the alternatives.

like image 27
Cody Gray Avatar answered Sep 29 '22 13:09

Cody Gray