ASP code is usually plain text and rarely encrypted. MS has a tool, Script Encoder, which can be encrypted. This tool can be downloaded from the official Microsoft website for free and has detailed instructions for use, however, the encrypted file contains <% @ language = vbscript. encode %> the administrator can see this sentence and the asp file is encrypted. There are also related decryption files.
This article provides a simple method to encrypt ASP code. The main idea is to perform some operations on the Code. For example, if you move all the code one by one, it is encrypted, the main encryption and decryption functions are as follows:
Function UnEncode (temp)
But = 1
For I = 1 to len (temp)
If mid (temp, I, 1) <> "Tang" then
Pk = asc (mid (temp, I, 1)-
If pk> 126 then
Primary = pk-95
Elseif pk <32 then
Pk = pk + 95
End if
A = a & chr (pk)
Else
A = a & vbcrlf
End if
Next
UnEncode =
End function
Function Encode (temp)
But = 1
Cc = replace (temp, vbcrlf, "Tang ")
For I = 1 to len (cc)
If mid (cc, I, 1) <> "Tang" then
Pk = asc (mid (cc, I, 1) +
If pk> 126 then
Primary = pk-95
Elseif pk <32 then
Pk = pk + 95
End if
A = a & chr (pk)
Else
A = a & "Tang"
End if
Next
A = replace (,"""","""""")
Encode =
End function
During development, the key ASP code is usually Encode and can be executed with Excute (Uncode (ipaddr. In this way, administrators generally do not directly see the key code. Generally, they do not include the Encode function in the program and only use it during development. In addition, UnEncode can be changed to other function names.
This method is simple and easy to decrypt.