ALP How to use encoded scripts
Support included in ALP version 1.0.5 and later

Microsoft Script Encoder can be used to "hide" the critical parts of the code of your ASP pages and raw scripts. In general MS Script Encoder (SE) allows encoded and plain script to be mixed. This allows different planning schemes for your software - you can choose to hide everything except a few configuration settings (for example placed in include file) or you can choose to implement most important things in include files and encode them but leave ASP pages readable.

The best choice depends on your needs. For example application that does not need changes and have only configuration settings will choose the first one and Application developed for clients that may need changes or not able to provide complete specification will choose the second - to have libraries and probably change their usage on the fly.

In the ASP case SE can be used in the same manner as in the IIS case - just encode your ASP page and leave encoder to add/change the @Language directive to VBScript.Encode or JScript.Encode. Advanced techniques such as encoding library include files will need a little manual work (in case of IIS too) - you may need to remove the automatically added @Language directive from the include file and to change manually @Languge directive in the ASP file not passed to the encoder.

The most important thing is that you must specify in your page @Language=VBScript.Encode (or JScript.Encode) if you are going to use encoded scirpt. Encode versions of the script engines support mixing of encoded and plain script text thus you just need to enable this option by chaging the scritp language name to its "encode" version.

SE command line keys are described in the Microsoft documentation. We will only recommend the easiest way to use the utility - Make copy of your site and process the files you want to "hide" using the /f options of the SE (replace the input file with the encoded one). If you choose to use advanced mixing of plain and encoded scripts make sure that all the settings are correct in all the filles - .Encode language names in the @Language directive of the ASP pages and no directives in the include files.

Example encoding of an ASP page:
screnc /f mypage.asp

A bit more specific are the raw scripts supported by the ScriptGen in ALP. You must use the SE options for plain script files encoding (such as WSH scripts). SE recognizes the script language using the file extensions. It recognizes only .js and .vbs extensions. There is an option /e that helps to pass to SE files with different extensions. Here is one example command line:

screnc /e js myrawscript.js-script myrawscript.jse-script

 /e option needs a parameter that is the standard file extension used for the script language used in the script file. By default ALP configuration processes as encoded scripts files with the following extensions:

jse-script - JScript.Encode
vbe-script - VBScript.Encode

Raw scripts depend on the application configuration for the include files. Therefore typically you will need to supply settings in the alp.application file of your application. You can configure another extension to be used if you need this. One example section that must be included in the ExecuteionMap section of your alp.application:

{ yourextension: (CG.newObjects.ScriptGen)
} yourextension;

You can mix encoded and plain scripts in raw scripts too. For example you can encode library files and leave other files human readable. But as in the ASP case you will need to use the "Encode" version of the script language.

newObjects Copyright 2001-2006 newObjects [ ]