ITPub博客

首页 > 应用开发 > IT综合 > ASP可逆算法 (转)

ASP可逆算法 (转)

原创 IT综合 作者:gugu99 时间:2007-11-05 09:17:00 0 删除 编辑
ASP可逆算法 (转)[@more@]unction encrypt(ecode)
Dim texts
dim i
for i=1 to len(ecode)
texts=texts & chr(asc(mid(ecode,i,1))+i)
next
  encrypt = texts
end function
function decrypt(dcode)
  dim texts
dim i
for i=1 to len(dcode)
texts=texts & chr(asc(mid(dcode,i,1))-i)
next
decrypt=texts
end function
function mistake(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
  mistake = dist
end function

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10748419/viewspace-980826/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    3122
  • 访问量
    2223727