VBS加密解密问题

2024-12-27 19:10:24
推荐回答(1个)
回答1:

加密函数也就是ASCdata的作用就是将每个字符用asc函数转换为相应的ASCII码,并在后面加上逗号
我认为解密就是将这些ASCII码用chr函数转换为字符
Function Chrdata(Data)
Data = Split(Data, ",")
newdata=""
for x=0 to UBound(Data)
newdata = newdata & Chr(CInt(Data(x)))
next
Chrdata=newdata
End Function
如果是在网页中,可用下面的方式调用
document.write Chrdata("32,32,32,32,-24156,-24156,-24156,32,-24156,-24156,-23635,32,-24156,-23635,-23635,-23635,-23635,32,-24156,32,-23635,-23635,-23635,-23635,-24156,32,-24156,-24156,-24156,-24156,-24156,32,-24156,-24156,-24156,-23635,-23635,32,-23635,-24156,-24156,-24156,32,-24156,-24156,-24156,-24156,-23635,32,-23635,-23635,-23635,-23635,-23635,32,-23635,-23635,-23635,-23635,-24156,32,-24156,-24156,-24156,-24156,-24156,32,-23635,-23635,-24156,-24156,-24156,32,-24156,-23635,-23635,-23635,-23635,32,-24156,-24156,-24156,-23635,-23635,32,-23635,-24156,-24156,32,-23635,-23635,-24156,-24156,-24156,32,-24156,-24156,-24156,-24156,-23635,32,-23635,-24156,-24156,-24156,-24156,32,-23635,-24156,-24156,-24156,-24156,32,-24156,-23635,-23635,-23635,-23635,32,-23635,-24156,-24156,32,-23635,-24156,-24156,32,-24156,-24156,-23635,-23635,-23635,32,-23635,-24156,-24156,-24156,-24156,32,-23635,-24156,-24156,32,-23635,-23635,-24156,-24156,-24156,32,-24156,-24156,-23635,-24156,32,-24156,-24156,-23635,-23635,-23635,32,-24156,-24156,-23635,-24156,32,-24156,-24156,-24156,-23635,-23635,32,-24156,-23635,32,-23635,-23635,-23635,-23635,-24156,32,-23635,-24156,-24156,-24156,-24156,32")
在网页中显示的结果是
··· ··- ·---- · ----· ····· ···-- -··· ····- ----- ----· ····· --··· ·---- ···-- -·· --··· ····- -···· -···· ·---- -·· -·· ··--- -···· -·· --··· ··-· ··--- ··-· ···-- ·- ----· -····

ASCII为32的字符是空格,最前面四个空格和最后一个空格没有显示出来