我个人现用的加密方法
发表于:2007-06-30来源:作者:点击数:
标签:
用时如下 例: 录入:rs.addnew rs(password)=encrypt(request(password)) rs.update 验证:ifrs(password)=encrypt(request(password)) then .... functionencrypt(preString) Dim texts Dim seed Dim i,length prestring = trim(preString) length = len(pr
用时如下
例: 录入:rs.addnew
rs("password")=encrypt(request("password"))
rs.update
验证:if rs("password")=encrypt(request("password")) then ....
function encrypt(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(94*rnd(-asc(mid(preString,i,1))-seed*asc(right(prestring,1)))+32)
texts = texts & chr(seed) & chr(int(94*rnd(-seed)+32))
next
dim dist
dist=""
for i = 1 to len(texts)
if mid(texts,i,1)<>"‘’" then
dist=dist+mid(texts,i,1)
end if
next
encrypt = dist
end function
原文转自:http://www.ltesting.net