嘿,我試圖比較我的數據庫中的密碼,使用我的ASP.net頁面時,我收到此錯誤。ASP.net此實現不是Windows平臺FIPS驗證的加密算法的一部分
此實現不是Windows平臺FIPS驗證的加密算法的一部分。
的代碼看起來是這樣的:
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 &= "SELECT email, name, id, permission_id, username FROM (user) INNER JOIN user_per ON user.id = user_per.user_id "
strSQL &= "WHERE(username = '" & user & "' And password = '" & encryptedString.ToString() & "')"
我們最近不得不更新/鎖定我們的服務器是符合安全漏洞等。但是這樣做會導致我們在同一臺服務器上託管的其中一個網站出現此錯誤。在所有這些安全設置之前,網站工作得很好。
奇怪的是,我能夠在VS 2010中運行本地網站(調試模式),它沒有問題。根本沒有錯誤。
有沒有人有關於如何解決這個問題的任何提示,以使網站再次運行,就像我們在添加所有這些安全設置之前所做的那樣。我們不能只是禁用它,因爲這會導致我們的其他網站不符合要求。
http://social.msdn.microsoft.com/Forums/en/clr/thread/7a62c936-b3cc-4493-a3cd-cc5fd18b6b2a
http://support.microsoft.com/kb/935434
http://blog.aggregatedintelligence.com/2007/10/fips-validated-cryptographic-algorithms.html
感謝。
從字符串 「S51998Dg5」 轉換到類型 '整數' 是無效的:
使用此代碼以及
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)
的錯誤是嘗試。
這誤差是就行:昏暗數據(P)作爲字節
debug = false在web.config? –
**應該永遠不可能解碼密碼**。密碼應該是散列的,而不是加密的。 – SLaks
糾錯@SLaks:解碼=比較。 – StealthRT