Initial JavaScript code obfuscation

Source: Internet
Author: User

JS front-end Code Some encrypted JS such as JScript. encode has been cracked for a long time because it must be parsed in IE plain text. There are also some encryption methods, through complex transformations, to change the source code, but eventually all escape the final trial, such as Unescape, document. Write, Eval statement to restore. The best way to protect JavaScript code is obfuscation. The goal of obfuscation is to make it easier to read and write code than to write code directly. obfuscation is not non-cracking, but increases the cracking cost, java and C # encryption adopts obfuscation. In this way, obfuscation of very core code cannot protect the code, but does JS have such code? Ben Program The principle of compilation is not used. The idea of Word Segmentation analysis is based on mechiland (http://www.jzchen.net) code highlighting program.

<Textarea id = "runcode2344"> <meta content = "mshtml 6.00.2800.1528" name = "generator"> <meta content = "" name = "author"> <meta content = "" name = "keywords"> <meta content = "" name = "Description"> <textarea id = "code" rows = "12" Cols = "100"> <br/> /* <br/> This is a class <br/> */<br/> function XX (Num, str) <br/>{< br/> // description <br/> var A = num; <br/> This. AA = A; <br/> This. BB = function () {alert (STR) ;}< br/> This. cc = function () {for (VAR I = 0; I <br/> <input onclick = "Go () "type =" button "value =" go "> <textarea id =" display "rows =" 12 "Cols =" 100 "> </textarea>
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.