ASP代碼加密
更新時(shí)間:2007年01月13日 00:00:00 作者:
ASP代碼一般是明文,很少有加密的,MS有個(gè)工具Script Encoder可以加密,這個(gè)東東可以微軟官方網(wǎng)站免費(fèi)下載,而且還有詳細(xì)使用說(shuō)明,但是經(jīng)過(guò)它加密后的文件會(huì)有<%@ language = vbscript.encode %>,管理員看到這句話(huà)就知道這個(gè)asp文件被加密了。而且也有相關(guān)的解密文件。
本文提供一種簡(jiǎn)單的方法,可以加密ASP代碼,主要思路是將代碼做些運(yùn)算,比如將全部代碼移動(dòng)一位,基本上就算加密了,主要的加解密函數(shù)如下:
function UnEncode(temp)
but=1
for i =1 to len(temp)
if mid(temp,i,1)<>"湯" then
pk=asc(mid(temp,i,1))-but
if pk>126 then
pk=pk-95
elseif pk<32 then
pk=pk+95
end if
a=a&chr(pk)
else
a=a&vbcrlf
end if
next
UnEncode=a
end function
function Encode(temp)
but=1
cc=replace(temp,vbcrlf,"湯")
for i= 1 to len(cc)
if mid(cc,i,1)<>"湯" then
pk=asc(mid(cc,i,1))+but
if pk>126 then
pk=pk-95
elseif pk<32 then
pk=pk+95
end if
a=a&chr(pk)
else
a=a&"湯"
end if
next
a=replace(a,"""","""""")
Encode=a
end function
在開(kāi)發(fā)的時(shí)候,通常將關(guān)鍵ASP代碼Encode,再使用Excute(Uncode(ipaddr))執(zhí)行就可以了。這樣管理員一般不能直接看到關(guān)鍵代碼,一般在程序里不要帶上Encode函數(shù),只在開(kāi)發(fā)的時(shí)候使用,此外,UnEncode也可以改成其它函數(shù)名。
這種方式加密比較簡(jiǎn)單,解密也很容易。
本文提供一種簡(jiǎn)單的方法,可以加密ASP代碼,主要思路是將代碼做些運(yùn)算,比如將全部代碼移動(dòng)一位,基本上就算加密了,主要的加解密函數(shù)如下:
function UnEncode(temp)
but=1
for i =1 to len(temp)
if mid(temp,i,1)<>"湯" then
pk=asc(mid(temp,i,1))-but
if pk>126 then
pk=pk-95
elseif pk<32 then
pk=pk+95
end if
a=a&chr(pk)
else
a=a&vbcrlf
end if
next
UnEncode=a
end function
function Encode(temp)
but=1
cc=replace(temp,vbcrlf,"湯")
for i= 1 to len(cc)
if mid(cc,i,1)<>"湯" then
pk=asc(mid(cc,i,1))+but
if pk>126 then
pk=pk-95
elseif pk<32 then
pk=pk+95
end if
a=a&chr(pk)
else
a=a&"湯"
end if
next
a=replace(a,"""","""""")
Encode=a
end function
在開(kāi)發(fā)的時(shí)候,通常將關(guān)鍵ASP代碼Encode,再使用Excute(Uncode(ipaddr))執(zhí)行就可以了。這樣管理員一般不能直接看到關(guān)鍵代碼,一般在程序里不要帶上Encode函數(shù),只在開(kāi)發(fā)的時(shí)候使用,此外,UnEncode也可以改成其它函數(shù)名。
這種方式加密比較簡(jiǎn)單,解密也很容易。
相關(guān)文章
關(guān)于加密解密 Base64 and URL and Hex Encoding and Decoding
關(guān)于加密解密 Base64 and URL and Hex Encoding and Decoding...2007-03-03JScript.Encode 腳本在線(xiàn)解密 代碼
JScript.Encode 腳本在線(xiàn)解密 代碼...2007-03-03RC4加密關(guān)鍵變量及算法特點(diǎn)原理詳解
這篇文章主要為大家介紹了RC4加密關(guān)鍵變量及算法特點(diǎn)原理詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-10-10網(wǎng)絡(luò)程序員伴侶Lshdic--腳本加解密器
網(wǎng)絡(luò)程序員伴侶Lshdic--腳本加解密器...2007-03-03