# 给出一个口令加密函数,谁能帮忙一下,编一个反加密的函数!望各位进来发表意见!!

davs 2004-08-10 05:31:33
'功能：对口令进行加密
function encodepwd(prestring)
Dim texts
Dim seed
Dim i,length
prestring = trim(preString)
length = len(preString)
seed = length
Randomize(length)
texts = ""
for i = 1 to length
seed = int(88*rnd(-asc(mid(preString,i,1))-seed*asc(right(prestring,1)))+32)
texts = texts & chr(seed) & chr(int(88*rnd(-seed)+32))
next

texts = Replace(texts,"'","")
texts = Replace(texts,"""","")

encodepwd = texts
end function
...全文
197 13 点赞 打赏 收藏 举报

13 条回复

wzhnet 2004-08-12

• 打赏
• 举报

davs 2004-08-12

• 打赏
• 举报

davs 2004-08-12

• 打赏
• 举报

davs 2004-08-12

• 打赏
• 举报

lordwudee 2004-08-10

• 打赏
• 举报

sunjiujiu 2004-08-10
function Encrypt(sStr,sFlag)
on error resume next
Dim objC2G,strPwd
if sStr = "" or isnull(sStr) then
Encrypt = ""
else
if sFlag then '动态Key加密
strPwd = FormatDate(date,"yyyymmdd","-") & Session("uYGBH")
else
strPwd = "B@K%LK" '默认Key
end if
Set objC2G = server.CreateObject("C2G.XOR.1")
Encrypt=objC2G.EncryptStringHex(sStr,strPwd)
Set objC2G = Nothing
end if
end function

function Decrypt(sStr,sFlag)
on error resume next
Dim objC2G,strPwd
if sStr = "" or isnull(sStr) then
Decrypt = ""
else
if sFlag then '动态Key加密
strPwd = FormatDate(date,"yyyymmdd","-") & Session("uYGBH")
else
strPwd = "B@K%LK" '默认Key
end if
Set objC2G = server.CreateObject("C2G.XOR.1")
Decrypt=objC2G.decryptStringHex(sStr,strPwd)
Set objC2G = Nothing
end if
end function

• 打赏
• 举报

lordwudee 2004-08-10

• 打赏
• 举报

lonkil 2004-08-10

• 打赏
• 举报

davs 2004-08-10

• 打赏
• 举报

celerylhl 2004-08-10

• 打赏
• 举报

cdsun 2004-08-10

• 打赏
• 举报

davs 2004-08-10

• 打赏
• 举报

bananasmiling 2004-08-10

• 打赏
• 举报

ASP

2.8w+

ASP即Active Server Pages，是Microsoft公司开发的服务器端脚本环境。

2004-08-10 05:31