数据库是SQL ,里面的用户名和密码字段已经使用EncryptText(Val1,"a23","op#")加密,请问老师下面代码如何对已经加密的两个字段进行解密?(由于里面使用了“让登录变得更安全”例子代码,所以两次加密解密有点蒙圈)
If e.PostValues.ContainsKey("username") AndAlso e.PostValues.ContainsKey("password") Then
Dim Verified As Boolean '用于标记用户是否通过了身份验证
UserName = e.PostValues("username")
Password = e.PostValues("password")
Dim dr1 As DataRow = DataTables("Table_User").SQLFind("UseName='" & UserName & "'")
If dr1 IsNot Nothing Then
If dr1("UserPWd") = Password Then
Verified = True
End If
End If
If Verified Then
UserID = Rand.NextString(16) '生成随机用户ID
UserName = EncryptText(UserName,"whblq","whblq") '将用户名加密.
Dim dr As DataRow = UserTable.Find("UserName = '" & UserName & "'")
If dr IsNot Nothing Then '如果是重复登录,删除以前的登录信息
dr.Delete()
End If
dr = UserTable.AddNew()
dr("UserName") = UserName
dr("UserID") = UserId
dr("ActiveTime") = Date.Now '记录登录时间
wb.AppendCookie("username",UserName) '将用户名和密码写入cookie
wb.AppendCookie("userid",UserID)
wb.InsertHTML("<meta http-equiv='Refresh' c>") '直接跳转到首页
e.WriteString(wb.Build) '生成网页
Return '必须的
End If
End If