一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

个人现用的加密方法

时间:2022-06-30 09:18:29 编辑:袖梨 来源:一聚教程网

用时如下
例: 录入: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

热门栏目