搜索文章:

首页  |  Java技术  |  Asp.net  |  Asp编程  |  VC/C++  |  Delphi  |  VB编程

ASP可逆算法

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

()

相关文章:
© 2006   www.java-asp.net