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

热门教程

asp 仿md5加密算法

时间:2022-07-02 23:08:58 编辑:袖梨 来源:一聚教程网


function 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

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
   response.Write(texts)
   response.End()
 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

Function EnPas(CodeStr)

 Dim CodeLen
 Dim CodeSpace
 Dim NewCode,cecr,cecb,cec
 
 CodeLen = 30
 CodeSpace = CodeLen - Len(CodeStr)
 
 If Not CodeSpace < 1 Then
 For cecr = 1 To CodeSpace
 CodeStr = CodeStr & Chr(21)
 Next
 End If
 
 NewCode = 1

 Dim Been
 For cecb = 1 To CodeLen
 Been = CodeLen + Asc(Mid(CodeStr,cecb,1)) * cecb
 NewCode = NewCode * Been
 Next

 CodeStr = NewCode
 NewCode = Empty

 For cec = 1 To Len(CodeStr)
 NewCode = NewCode & CfsCode(Mid(CodeStr,cec,3))
 Next

 For cec = 20 To Len(NewCode) - 18 Step 2
 EnPas = EnPas & Mid(NewCode,cec,1)
 Next

End Function

Function CfsCode(Word)
 dim cc
 For cc = 1 To Len(Word)
 CfsCode = CfsCode & Asc(Mid(Word,cc,1))
 Next
 CfsCode = Hex(CfsCode)
End Function

热门栏目