求助!如何得到解密脚本!


<%   
function encrypt(text, password)
 if pEncryptionMethod="DES" then
  encrypt=DESEncrypt(text, password)
 else
  encrypt=RC4EnCryptASC(text, password)
 end if
end function

function decrypt(text, password)
 if pEncryptionMethod="DES" then
  decrypt=DESDecrypt(text, password)
 else
  decrypt=RC4DeCryptASC(text, password)
 end if
end function


 ' This script performs 'RC4' Stream Encryption (Based on what is widely thought to be RSA's RC4 algorithm. It produces output streams that are identical to the commercial products). This script is Copyright ?2007 by Mike Shaffer ALL RIGHTS RESERVED WORLDWIDE                             

   Dim sbox(255)
   Dim rc4Key(255)

   Sub RC4Initialize(strPwd)
  
   ' this routine called by EnDeCrypt function. Initializes the sbox and the key array

      dim tempSwap, a, b     
     
      ' get length of the key
      intLength = len(strPwd)
     
      ' iterate through all characters contained in key repeating number of characters is 255
      for a = 0 To 255
         ' load ANSI for each char contained in the key
         rc4Key(a)  = asc(mid(strpwd, (a mod intLength)+1, 1))
         ' load numbers from 0 to 255
         sbox(a) = a                      
      next

      b = 0
      ' iterate through arrays
      for a = 0 To 255
         b = (b + sbox(a) + rc4Key(a)) Mod 256        
         tempSwap = sbox(a)
         sbox(a) = sbox(b)
         sbox(b) = tempSwap
      Next
  
   End Sub
  
   function EnDeCrypt(plaintxt, psw)     

      dim temp, a, i, j, k, cipherby, cipher     

      i = 0
      j = 0

      RC4Initialize psw

      for a = 1 To Len(plaintxt)
         i  = (i + 1) Mod 256
         j  = (j + sbox(i)) Mod 256
         temp  = sbox(i)
         sbox(i)= sbox(j)
         sbox(j)= temp
  
         k  = sbox((sbox(i) + sbox(j)) Mod 256)

         cipherby  = Asc(Mid(plaintxt, a, 1)) Xor k
         cipher  = cipher & Chr(cipherby)        
      next

      enDeCrypt = cipher           
     
   end function
  
   function RC4EnCryptASC(plaintxt, psw)     

      dim temp, a, i, j, k, cipherby, cipher     

      i = 0
      j = 0

      RC4Initialize psw

      for a = 1 To Len(plaintxt)
         i  = (i + 1) Mod 256
         j  = (j + sbox(i)) Mod 256
         temp  = sbox(i)
         sbox(i)= sbox(j)
         sbox(j)= temp
  
         k   = sbox((sbox(i) + sbox(j)) Mod 256)

         cipherby  = Asc(Mid(plaintxt, a, 1)) Xor k        
         cipher  = cipher & "|"& cipherby        
      next           
     
      RC4EnCryptASC = cipher           
     
   end function
  
   function RC4DeCryptASC(plaintxt, psw)     

      plaintxt = transformToCHR(plaintxt)
     
      dim temp, a, i, j, k, cipherby, cipher     

      i = 0
      j = 0     
     
      dim arrayEncrypted           
     
      RC4Initialize psw        
     
       for a = 1 To Len(plaintxt)
         i  = (i + 1) Mod 256
         j  = (j + sbox(i)) Mod 256
         temp  = sbox(i)
         sbox(i)= sbox(j)
         sbox(j)= temp
  
         k  = sbox((sbox(i) + sbox(j)) Mod 256)

         cipherby  = Asc(Mid(plaintxt, a, 1)) Xor k
         cipher  = cipher & Chr(cipherby)        
      next

      RC4DeCryptASC = cipher                      
     
   end function
  
function transformToCHR(plaintxt)

      ' transform to CHR, insert into array
     
      dim returnText, arrayEncrypted
      arrayEncrypted = split(plaintxt, "|")           
     
      returnText=""           
     
      ' transform to CHR
      for a = 1 to ubound(arrayEncrypted)        
         returnText=returnText&CHR(arrayEncrypted(a))        
      next           
     
      transformToCHR = returnText
end function

%>

<%
dim fuck,shit,mima,cao
shit="www" '加密解密需要一个KEY
mima="heiye"
fuck=encrypt(mima,shit)
response.write fuck & "<br>"
cao=decrypt(fuck,shit)
response.write cao
%>

如何将加密后的数据解密...直接套用了函数失败了...谢谢...

 


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值