title: ASP.net This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms
body: <p>Hey all i am getting this error when trying to compare a password in my database using my ASP.net page.</p>
  
  <p><strong>This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.</strong></p>
  
  <p>The code looks like this:</p>
  
  <pre><code>Public Shared Function UserAuthentication(ByVal user As String, ByVal pass As String) As WebUserSession
    Dim strSQL As String = ""
    Dim strForEncryption As String = pass
    Dim result As Byte()
    Dim sHA1Managed As SHA1 = New SHA1Managed()
    Dim encryptedString As New System.Text.StringBuilder()
  
    result = sHA1Managed.ComputeHash(ASCIIEncoding.ASCII.GetBytes(pass))
  
    For Each outputByte As Byte In result
      'convert each byte to a Hexadecimal upper case string
      encryptedString.Append(outputByte.ToString("x2").ToUpper())
    Next
  
    strSQL &amp;= "SELECT email, name, id, permission_id, username FROM (user) INNER JOIN user_per ON user.id = user_per.user_id "
    strSQL &amp;= "WHERE(username = '" &amp; user &amp; "' And password = '" &amp; encryptedString.ToString() &amp; "')"
  </code></pre>
  
  <p>We recently had to update/lock down our server to be compliance with security holes and the like. But doing so caused this error for one of the websites we are hosting on the same server. Prior to all these security settings the web site worked just fine.</p>
  
  <p><strong>The odd part is that i am able to run the website local (debug mode) within VS 2010 and it does just fine. No errors at all.</strong></p>
  
  <p>Would anyone have any tips on how to go around this to make the website work again as it did before we added all these security settings to be complaint? We simply can not just disable it because that would cause our other websites to go out of compliance.</p>
  
  <p>I've already tried the suggestions on these pages:
  <a href="http://blogs.msdn.com/b/brijs/archive/2010/08/10/issue-getting-this-implementation-is-not-part-of-the-windows-platform-fips-validated-cryptographic-algorithms-exception-while-building-outlook-vsto-add-in-in-vs-2010.aspx" rel="nofollow">http://blogs.msdn.com/b/brijs/archive/2010/08/10/issue-getting-this-implementation-is-not-part-of-the-windows-platform-fips-validated-cryptographic-algorithms-exception-while-building-outlook-vsto-add-in-in-vs-2010.aspx</a></p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en/clr/thread/7a62c936-b3cc-4493-a3cd-cc5fd18b6b2a" rel="nofollow">http://social.msdn.microsoft.com/Forums/en/clr/thread/7a62c936-b3cc-4493-a3cd-cc5fd18b6b2a</a></p>
  
  <p><a href="http://support.microsoft.com/kb/935434" rel="nofollow">http://support.microsoft.com/kb/935434</a></p>
  
  <p><a href="http://blogs.iis.net/webtopics/archive/2009/07/20/parser-error-message-this-implementation-is-not-part-of-the-windows-platform-fips-validated-cryptographic-algorithms-when-net-page-has-debug-true.aspx" rel="nofollow">http://blogs.iis.net/webtopics/archive/2009/07/20/parser-error-message-this-implementation-is-not-part-of-the-windows-platform-fips-validated-cryptographic-algorithms-when-net-page-has-debug-true.aspx</a></p>
  
  <p><a href="http://blog.aggregatedintelligence.com/2007/10/fips-validated-cryptographic-algorithms.html" rel="nofollow">http://blog.aggregatedintelligence.com/2007/10/fips-validated-cryptographic-algorithms.html</a></p>
  
  <p>Thanks.</p>
  
  <p><strong>Tried using this code as well</strong></p>
  
  <pre><code>Dim p As String = Password.Text.ToString
  Dim data(p) As Byte
  Dim result() As Byte
  Dim sha As New SHA1CryptoServiceProvider()
  
  result = sha.ComputeHash(data)
  </code></pre>
  
  <p>The error is:</p>
  
  <p><strong>Conversion from string "S51998Dg5" to type 'Integer' is not valid.</strong></p>
  
  <p>And that error is on the line: <strong>Dim data(p) As Byte</strong></p>