温柔网

 找回密码
 注册

查看: 554|回复: 0

ASP可逆算法

[复制链接]
发表于 2004-4-23 04:17:55 | 显示全部楼层 |阅读模式
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)<>"&#39;"  then
      dist=dist+mid(texts,i,1)
      end if
     next
     mistake = dist
  end function


您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|温柔网 ( 浙ICP备13033583号-8 )

GMT+8, 2024-5-3 07:28 , Processed in 0.034103 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表