ASP code encryption

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.