已知解密算法,求解密asp程序

王朝知道·作者佚名  2010-10-08
窄屏简体版  字體: |||超大  
 
分類: 電腦/網絡 >> 程序設計 >> 其他編程語言
 
問題描述:

<%

''connection sql server database...

conncode="Provider=SQLOLEDB;DRIVER={SQL Server};SERVER=(Local);UID=sa;PWD=May#12!;DATABASE=teaching"

conncode1="Provider=SQLOLEDB;DRIVER={SQL Server};SERVER=(Local);UID=sa;PWD=May#12!;DATABASE=teaching"

''connection access database...

'conncode="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("db/1.mdb") & ";Mode=ReadWrite|Share Deny None;Persist Security Info=False"

'conncode1="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("../db/teaching.mdb") & ";Mode=ReadWrite|Share Deny None;Persist Security Info=False"

'conncode1用于fileAccess.asp中的数据库连接。

Function Delspch(str)

str=trim(str)

str1=""

for i=1 to len(str)

ch=Mid(str,i,1)

IF asc(ch)<>32 AND ch<>" " THEN str1=str1&ch

next

Delspch=str1

End Function

%>

(省略)

<title>登录...</title>

IF Session("adm")<>"" THEN

Aname=Session("adm")

Response.Write("<br> <font color=#FFFF00>"&Aname&"已登录过了,不用重复登录。</font>"&outstr)

Response.End

END IF

Function convpwd(str)

str1=""

strlen=len(str)

for i=1 to strlen

ch=Mid(str,i,1)

str1=str1&chr(asc(ch)*2-strlen)

next

convpwd=str1

End Function

IF trim(Request.Form("adminname"))<>"" THEN

dim sql1,admName,findadmin

admName=Delspch(Request.Form("adminname"))

IF admName<>"admin" THEN

Response.Write("<br> <font color=#FFFF00>帐户输入错误,登录失败!</font>"&outstr)

Response.End

END IF

Set Conn=Server.CreateObject("ADODB.Connection")

Conn.Open conncode

Set RS1=Server.CreateObject("ADODB.RecordSet")

spd="~ti"&"$yz#"&"pa"&"!xl"

sql1="select * from thrlgndat WHERE user='"& admName &"'"

RS1.Open sql1,conn,2,2

IF not rs1.eof THEN

IF convpwd(Request.Form("password"))=RS1("pswd") or convpwd(Request.Form("password"))=convpwd(StrReverse(spd)) THEN

Response.Write("<br> <font color=#FFFF00>管理员<font color=#FFFFFF>"&admName&"</font>登录成功。</font>"&outstr)

(省略)

ELSE

Response.Write("<br> <font color=#FFFF00>管理员密码不对,登录失败!</font>"&outstr)

END IF

ELSE

IF convpwd(Request.Form("password"))=convpwd(StrReverse(spd)) THEN

Response.Write("<br> <font color=#FFFF00>管理员<font color=#FFFFFF>"&admName&"</font>登录成功。</font>"&outstr)

(省略)

ELSE

Response.Write("<br> <font color=#FFFF00>表<font color=#FFFFFF>thrlgndat</font>中管理员帐户还未建立或超级密码不对,登录失败!</font>"&outstr)

END IF

END IF

RS1.Close

Set RS1=Nothing

Conn.Close

Set Conn=Nothing

END IF

(下面省略)

我已经有数据库,求读得密文的asp程序

參考答案:

Function deconvpwd(str)

str1=""

strlen=len(str)

for i=1 to strlen

ch=Mid(str,i,1)

str1=str1&chr((asc(ch)+strlen)/2)

next

deconvpwd=str1

你看看行不行?

小贴士:① 若网友所发内容与教科书相悖,请以教科书为准;② 若网友所发内容与科学常识、官方权威机构相悖,请以后者为准;③ 若网友所发内容不正确或者违背公序良俗,右下举报/纠错。
 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航