我自己用的两个方法:
'加密
function encode(soStr)
for i=1 to len(soStr)'加密方法1
TempNum=hex(asc(mid(soStr,i,1)))
if len(TempNum)=4 then
encode=encode & "%"& left(cstr(TempNum),2) & "%"& right(cstr(TempNum),2)
else
Randomize
encode=encode &"%"& chr(72+int(rnd*18))& chr(72+int(rnd*18)) & "%" & cstr(TempNum)
end if
next
end function
'function encodeTWO(soStr)
'for i = 1 to len(soStr)'加密方法2
' x = asc(mid(soStr,i,1))
'if x < 0 or x > 255 then
'y = x xor 010101
'else
'y = x xor 010
'end if
'encodeTWO =encodeTWO&chr(y)
'next
'end function
'解密:
function decode(x)
x=replace(x,"%","")'解密方法1
for i=1 to len(x)
if asc(mid(x,i,1))>=72 then
x=replace(x,mid(x,i,1),"0")
end if
next
for i=1 to len(x) step 4
decode=decode& chr(int("&H" & mid(x,i,4)))
next
end function
'function decode(x)
'for k=1 to len(x)'解密方法2
'i = asc(mid(x,k,1))
'if i < 0 or i > 255 then
'w = i xor 010101
'else
'w = i xor 010
'end if
'decode=decode&chr(w)
'next
'end function