asp加密(求asp 中文加密、解密的函数)
求asp 中文加密、解密的函数?
网友:沉默的哀伤 提问
求asp 中文加密、解密的函数
五星知识达人网友:空山清雨 解答于 2022-04-02 20:47
asp加密解密函数decrypt,具体参考例子如下:
“>111111111
1楼网友:酒者煙囻 解答于 2022-04-02 21:11
base64
BASE_64_MAP_INIT 是密钥~最后几行是例子..多个地方用最好写成ASP文件INCLUDE..追问大哥,这玩意,可以加密,但是无法解密啊!追答base64Decode(encode)追问没用啊,你这个和上面的不一样吗?还是解密不了!追答Function UrlDecode(encodestr)
newstr=”” havechar=false lastchar=”” for i=1 to len(encodestr) char_c=mid(encodestr,i,1) if char_c=”+” then newstr=newstr & ” ” elseif char_c=”%” then next_1_c=mid(encodestr,i+1,2) next_1_num=cint(“&h” & next_1_c)
if havechar then havechar=false newstr=newstr & chr(cint(“&h” & lastchar & next_1_c)) else if abs(next_1_num)<=127 then newstr=newstr & chr(next_1_num) else havechar=true lastchar=next_1_c end if end if i=i+2 else newstr=newstr & char_c end if
next UrlDecode=newstr End Function
inp = “你好” inp=server.UrlEncode(inp) encode = base64Encode(inp) decode= base64Decode(encode)
response.write “urlE = ” & inp & nl response.write “Encoded value = “https://mip.wujinjixie.net/ask/& encode & nl response.write “Decoded value = “https://mip.wujinjixie.net/ask/& decode & nl response.write “Decoded value = “https://mip.wujinjixie.net/ask/& UrlDecode(decode) & nl
不好意思 再个加个函数..步骤:把汉字转成URLCODE 再BASE64加密然后BASE64解密 最后 在URLDECODE
注意UrlEncode是ASP的SERVER对象提供的.DECODE是用我上面的函数
亲测,结果:urlE = %C4%E3%BA%C3Encoded value = https://mip.wujinjixie.net/ask/JUM0JUUzJUJBJUMzDecoded value = https://mip.wujinjixie.net/ask/%C4%E3%BA%C3Decoded value = https://mip.wujinjixie.net/ask/你好
本文地址:https://www.cubemovie.cn/hetong/58388.html