Encrypt your ASP page--script encoder exploration

Source: Internet
Author: User
Tags command line object model
encode| Encryption | page


I. 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:
Since ASP pages are stored as plain text, all programming logic can be easily seen 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 either encrypt the client Side script or the server Side
Script encryption.
  
Ii. use of the introduction
The Script encoder is a command-line tool that executes the file as SCRENC.EXE. It's very simple to operate
Single:

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 script selected in Script encoder encryption
Statement
Scripts that do not contain this scripting language attribute 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. The default state,
Script
Encoder can identify ASA,ASP,CDX,HTM,HTML,JS,SCT and VBS
File.
  

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, huh?
' 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. Use simple, encrypted script shipped
Rows are also relatively stable. But this thing just stops you from looking at the script's original code, estimating the corresponding decryption
The tools will come out soon. So if it's possible, let's take some time to learn the component technology, I think
Must be able to combine these two to use. As Microsoft's documentation says: Setting an engine to deal
With encoded the script are only one side of the equation. How did you
Encode your
Script? 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/scripting/vbscript/download/x86/sce10en.exe

Windows Script Engine 5.0
Windows & Windows NT 4.0-chs Chinese version download address:
Http://www.microsoft.com/msdownload/vbscript/scripting.asp?
Msid=32186&plat=x86
&lang=chinese/simplified




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.