用CFS编码对函式库进行加密
程序员文章站
2022-03-19 12:10:32
本文介绍一种用CFS编码对函式库进行加密的方法。
<%
'********************************************
'**
'*CFS Encode Function*
'**
'*Produced by ASP-Zon... 08-10-08...
本文介绍一种用cfs编码对函式库进行加密的方法。
<% '******************************************** '** '*cfs encode function* '** '*produced by asp-zone* '** '*main website is located at* '*http://asp.diy.com.tw/* '** '*e-mail:* '*thiefghost@games.com.tw* '** '*use this function:* '*<!--#include file="codefun.fun" -->* '** '*2001/8/3* '** '******************************************** 'encode function function cfsencode(codestr) dim codelen dim codespace dim newcode codelen = 30 codespace = codelen - len(codestr) if not codespace < 1 then for cecr = 1 to codespace codestr = codestr & chr(21) next end if newcode = 1 dim been for cecb = 1 to codelen been = codelen asc(mid(codestr,cecb,1)) * cecb newcode = newcode * been next codestr = newcode newcode = empty for cec = 1 to len(codestr) newcode = newcode & cfscode(mid(codestr,cec,3)) next for cec = 20 to len(newcode) - 18 step 2 cfsencode = cfsencode & mid(newcode,cec,1) next end function function cfscode(word) for cc = 1 to len(word) cfscode = cfscode & asc(mid(word,cc,1)) next cfscode = hex(cfscode) end function %>
<% '******************************************** '** '*cfs encode function* '** '*produced by asp-zone* '** '*main website is located at* '*http://asp.diy.com.tw/* '** '*e-mail:* '*thiefghost@games.com.tw* '** '*use this function:* '*<!--#include file="codefun.fun" -->* '** '*2001/8/3* '** '******************************************** 'encode function function cfsencode(codestr) dim codelen dim codespace dim newcode codelen = 30 codespace = codelen - len(codestr) if not codespace < 1 then for cecr = 1 to codespace codestr = codestr & chr(21) next end if newcode = 1 dim been for cecb = 1 to codelen been = codelen asc(mid(codestr,cecb,1)) * cecb newcode = newcode * been next codestr = newcode newcode = empty for cec = 1 to len(codestr) newcode = newcode & cfscode(mid(codestr,cec,3)) next for cec = 20 to len(newcode) - 18 step 2 cfsencode = cfsencode & mid(newcode,cec,1) next end function function cfscode(word) for cc = 1 to len(word) cfscode = cfscode & asc(mid(word,cc,1)) next cfscode = hex(cfscode) end function %>