加密|解密|中文 Relaxlife.net可加密/解密中文/英文的Asp代碼供大家下載,這可是機密,可用在代碼加密
可加密/解密中文/英文的Asp代碼供大家下載,這可是機密,可用在代碼加密
Function.asp
<%
Rem =================================================================
Rem = 函數檔案:Function.asp
Rem = 測試檔案:TestEncrypt.asp,Encryptpass.asp
Rem = 說明:Encrypt_PRO加密函數,Decrypt_PRO解密函數
Rem = Revision:1.01 Beta
Rem = 作者:熊氏英雄(cexo255),小奎
Rem = Date:2005/04/20 03:41:10
Rem = QQ:30133499,38377160
Rem = MySite:Http://www.Relaxlife.net
Rem = QQ群:4341998
Rem = 適用:對資料的加密,或對代碼的加密,可加密中文/英文等。完全解密,不會出現解密出現亂碼。
Rem = 下版本預計改進:代碼演算法需要重寫,可能知道的人多了就不太安全了。
Rem =================================================================
Public Const sDefaultWHEEL1 = "ABCDEFGHIJKLMNOPQRSTVUWXYZ_1234567890qwertyuiopasd!@#$%^&*(),. ~`-=\?/’""fghjklzxcvbnm<>;"
Public Const sDefaultWHEEL2 = "IWEHJKTLZVOPFG_1234567890qwerBNMQRYUASDXCfghjklzxc ~`-=\?/’""!@#$%^&*(),.vbnm<>;tyuiopasd"
Function Encrypt_PRO(sINPUT , sPASSWORD )
Dim sWHEEL1, sWHEEL2
Dim k, c, i
Dim sRESULT
sWHEEL1 = sDefaultWHEEL1: sWHEEL2 = sDefaultWHEEL2
ScrambleWheels sWHEEL1, sWHEEL2, sPASSWORD
sRESULT = ""
For i = 1 To Len(sINPUT)
c = Mid(sINPUT, i, 1)
k = InStr(1, sWHEEL1, c)
If k > 0 Then
sRESULT = sRESULT & Mid(sWHEEL2, k, 1)
Else
sRESULT = sRESULT & Addpass(c,sPASSWORD)
End If
sWHEEL1 = LeftShift(sWHEEL1): sWHEEL2 = RightShift(sWHEEL2)
Next
Encrypt_PRO = sRESULT
End Function
Function Decrypt_PRO(sINPUT , sPASSWORD )
Dim sWHEEL1, sWHEEL2
Dim k, i, c
Dim sRESULT
sWHEEL1 = sDefaultWHEEL1: sWHEEL2 = sDefaultWHEEL2
ScrambleWheels sWHEEL1, sWHEEL2, sPASSWORD
sRESULT = ""
For i = 1 To Len(sINPUT)
c = Mid(sINPUT, i, 1)
k = InStr(1, sWHEEL2, c, vbBinaryCompare)
If k > 0 Then
sRESULT = sRESULT & Mid(sWHEEL1, k, 1)
Else
sRESULT = sRESULT & Addpass(c,sPASSWORD)
&nbs