JScript.Encode

{{Short description|Javascript encoding method developed by Microsoft}}

JScript.Encode is a method created by Microsoft used to obfuscate both server and Client-side JavaScript or VB Script source code in order to protect the source code from copying.{{cite web|url=http://www.microsoft.com/mind/0899/scriptengine/scriptengine.asp |title=Script Encoding with the Microsoft Script Engine Version 5.0 |date=Aug 1999 |publisher=Microsoft |first=Andrew |last=Clinick |work=Script Engine |url-status=dead |archive-date=2002-12-14 |archive-url=https://web.archive.org/web/20021214024403/http://www.microsoft.com/mind/0899/scriptengine/scriptengine.asp }} JavaScript code is used for creating dynamic web content on many websites, with the source code easily viewable, so this was meant to protect the code.

The encoding is a simple polyalphabetic substitution using three alphabets.{{cite web|url=http://virtualconspiracy.com/content/articles/breaking-screnc |title=Breaking the Windows Script Decoder |website=Virtual Conspiracy |url-status=dead |archive-date=2013-12-08 |archive-url=https://web.archive.org/web/20131208110057/http://virtualconspiracy.com/content/articles/breaking-screnc |quote=Security by obscurity is a bad, bad idea. Instead of encouraging that approach, Microsoft should educate programmers to find other ways to store their passwords and sensitive data, and tell them that an algorithm or any other piece of code that needs to be 'hidden', is just bad design }}

How to use

A command line script encoder can be used to encode scripts.{{cite web|url=http://www.microsoft.com/mind/0899/code/Clinick0899.exe |title=Clinick0899.exe |format=program |date=Aug 1999 |publisher=Microsoft |first=Andrew |last=Clinick |url-status=dead |archive-date=2002-12-14 |archive-url=https://web.archive.org/web/20021214024403/http://www.microsoft.com/mind/0899/code/Clinick0899.exe |quote=The command-line script encoder (screnc.exe) provides a simple mechanism for encoding HTML, ASP, SCT, VBScript, and JScript files. The Microsoft Script group developed it as an easy-to-use command-line tool that can be easily built into your existing deployment batch files }} To encode a HTML web-page file called {{mono|default.htm}}, use the following command:

screnc.exe default.htm defaultenc.htm

It would output to a file called {{mono|defaultenc.htm}}.

Weaknesses

It has been reverse engineered and many websites provide an on-the-fly decoder.{{cite web |url= https://gist.github.com/bcse/1834878 |date= Feb 15, 2012 |title= Windows Script Decoder |first= Grey |last= Lee |website= GitHub |quote= Decoding JScript.Encoded }}

References

{{reflist}}