Hello. I have been trying to encrypt password and found a code which is working with Access fine but as i have changed to SQL it is not decoding the encrypted text.. it amazes me..
this SQl code is not letting me log on..
Dim objConn As New SqlConnection(ConfigurationManager.ConnectionStrings("myconn").ConnectionString)
Dim objCmd As SqlCommand
Dim objDR As SqlDataReader
Function CheckCredentials(Username As String, Password As String) As Boolean
objConn.Open()
objCmd = New SqlCommand("SELECT Salt, Pass FROM Users WHERE Username=@givenUsername", objConn)
objCmd.Parameters.AddWithValue("@givenUsername", Username)
objDR = objCmd.ExecuteReader()
If Not objDR.Read() Then
Return False
Else
Dim strSalt As String = objDR("Salt")
Dim strStoredPassword As String = objDR("Pass")
Dim strGivenPassword As String = FormsAuthentication.HashPasswor ...
Go to the complete details ...