Encrypt your ASP page-script encoder exploration

Source: Internet
Author: User
Tags object command line object model client access
encode| Encryption | Page |encode| encryption one, overview

All along, the ASP technology has been more and more popular friends, the use of ASP to engage in web development are more and more people. ASP a very obvious feature is that the page is processed after the server is sent to the browser content in the standard HTML format, so that the effective protection of the original Code of the page program is not easily access by the client (of course, Ms Bugs are constantly that is another matter.) ^_^). But another common problem is that because ASP pages are stored as plain text, you can easily see all of the programming logic on the server side. This brings some difficulties to the application commercialization of ASP. The solution is generally to encapsulate programming logic into DLLs using component technology, but the problem is:

1, if each piece of code is a component of the workload is too large, it is not necessary.

2, there are many netizens (such as:-< like a prodigal son) simply will not write components. In this context, Microsoft has launched the script Encoder1.0. A command line script encryption tool.

The features of the Script encoder are:
It only encrypts the script code embedded in the page, and other parts, such as the HTML tag, remain intact. The encrypted portion of the processed file is read-only and any modifications to the encrypted portion will result in the entire encrypted file being used. The script encoder encrypted ASP files will also invalidate scripting debugging tools such as Script Debugger.
The script encoder can encrypt either the client Side script or the server Side script.

Ii. use of the introduction

The Script encoder is a command-line tool that executes the file as SCRENC.EXE. Its operation is very simple:

Screnc [/S] [f] [/XL] [/L deflanguage] [/e defextension] inputfile outputfile

/s optional. Let script encoder "quiet" work, that is, the execution process
There is no screen output. (I use the feeling to ignore it, the same no screen
Output. No use, too lazy. )
/f is optional. Specifies whether the output file overwrites an input file with the same name. Ignored, will
Overwrite is not performed.
/xl Optional. Whether to add the @language directive at the top of the. asp file. Ignore
will be added.
/l Deflanguage Optional. Specifies the default scripting language selected in Script Encoder encryption.
Scripts that do not contain this scripting language feature in the file will be script encoder
Ignore. For HTML and script files, JScript is the built-in default foot
The language. For ASP files, VBScript is the default scripting language. While
For files with the. vbs or. js extension, Script encoder is adaptive
Ability.
/e Defextension Optional. Specifies the file name extension of the file to be encrypted. In the default state, the Script
Encoder can identify ASA,ASP,CDX,HTM,HTML,JS,SCT and VBS files.


Iii. frequently asked questions and precautions

1, in joy ASP several times to see a netizen to use the Script encoder when the following error occurred:

"Script Encoder Object <" Scripting.encoder "> Not Found"

The reason for this is that using Script Encoder requires the support of scripts Engine 5.0 or more scripting engines.
There are two solutions, upgrade browsers to IE5 or install script Engine 5.0.

2. When encrypting the Global.asa, the access appears after the encryption completes:
Active Server Pages error ' ASP 0137 '

Invalid Generic Script

Global.asa, line 1

The Script block must be one of the allowed Global.asa procedures. The Script primitives in <%...% > are not
Allowed in the Global.asa file. The permissible process can only be application_onstart,
Application_OnEnd, Session_OnStart, or Session_OnEnd.

The encrypted Global.asa file is:
<%@ LANGUAGE = Vbscript.encode%><script language=vbscript.encode
Runat=server>#@~^naiaaa==@#@&?i~pzww^k1cybwu{}xjomdy@#@&@#@&bp</script>

<script Language=vbscript.encode Runat=server>#@~^ogeaaa==@#@&?i~pzww^k
1cybwu{}x3u9@#@&@#@&p,p?o~sbvr8ln^dpxpund7+. ;D +cor==^#~@</script>

<script Language=vbscript.encode Runat=server>#@~^dqmaaa==@#@&?i~pu+/kk
KU{}XJYMDO@#@&AMP;@#@&AMP;E~NNJ*PX~RCL1V+MJ@#@&AMP;3HF,? ' a@#@&fteaaa==^#~@</script>

<script Language=vbscript.encode Runat=server>#@~^wwiaaa==@#@&?i~pu+/kk
ku{}x3x9@#@& (6p?d/bwxvej{!/dmmg[jbp@!@*prcc^0+de~:tnx@#@&</script>

This error occurs because the top of the encrypted Global.asa file is written to
<%@ LANGUAGE = Vbscript.encode%>
The solution is to manually delete the line or use the/XL parameter encryption.

3, Script Encoder to remote scripting invalid.

Iv. Summary

According to my personal experience, the Script encoder is still quite good. The use of simple, encrypted script running is also relatively stable. But this thing just stops you from looking at the script's original code and estimates that the corresponding decryption tool will come out soon. So if possible, let's take some time to learn the component technology, I think we can combine the two. As Microsoft's documentation says: Setting an engine to deal with encoded script are only one side of the equation. How did you encode yourscript? There are two mechanisms to do this:a command-line script encoder and a com-based object model ...

Report:

Script Encoder Download Address:
Http://msdn.microsoft.com/scri

[1] [2] Next page



Related Article

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.