Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

JavaScript code obfuscation method of custom obfuscation scheme

A code obfuscation and self-definition technology, which is applied in the field of JavaScript code obfuscation, can solve the problems of low confidentiality and complex JavaScript code confidentiality, etc., and achieve the effect of strong confidentiality, multiple verification steps, and strong user operability

Active Publication Date: 2020-03-17
CHENGDU DBAPP SECURITY
View PDF6 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Based on solving the problem that the JavaScript code has only one-time operation and the confidentiality is not strong, the present invention proposes a JavaScript code obfuscation method with a self-defined obfuscation scheme. The user selects an obfuscation scheme through self-definition, and has multiple verification steps to realize the JavaScript code obfuscation method. The code is more complex and confidential, and the user operation is stronger

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • JavaScript code obfuscation method of custom obfuscation scheme
  • JavaScript code obfuscation method of custom obfuscation scheme

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0039] A custom obfuscation scheme, this embodiment is described based on scheme 1, such as figure 1 and figure 2 As shown, the scheme 1 is implemented based on JavaScript syntax parser, obfuscator and syntax tree parser in the following steps:

[0040] Step S1.1 removes redundant codes in the initial JavaScript code;

[0041] Step S1.2 uses the JavaScript parser to split the initial JavaScript code into independent word blocks, and generates a syntax tree whose root node is the window variable according to the split independent word blocks;

[0042] Step S1.3 passes the syntax tree generated in step S1.2 into the obfuscator; the obfuscator performs full tree traversal on the generated syntax tree, and performs node obfuscation for each tree node; after node obfuscation, then Each tree node is added redundantly;

[0043] Step S1.4 Use the grammar tree parser to extract the word blocks of the tree nodes in sequence from the grammar tree processed in step S1.3 according to t...

Embodiment 2

[0051] In order to better realize the present invention, further, the scheme 1 can be replaced by the scheme 2, and the scheme 2 specifically includes the following steps:

[0052] Step S2.1 searches for variables and function names in the initial JavaScript code, and saves them in a key-value pair object;

[0053] Step S2.2 sets an array of meaningless strings, traverses the key-value pair objects, and replaces the variables and function names stored in the key-value pair objects with meaningless strings in the meaningless string array through regular matching.

[0054] Working principle: use the corresponding meaningless string to replace variables and function names to generate obfuscated JavaScript code, and then only need to follow the corresponding relationship in advance to complete deobfuscation.

[0055] Other parts of this embodiment are the same as those of Embodiment 1 above, so details are not repeated here.

Embodiment 3

[0057] In order to better realize the present invention, further, solution 1 or 2 can also be replaced by solution 3, and the solution 3 specifically refers to: first process the initial JavaScript code in solution 1, and then perform the processing in solution 2.

[0058] Working principle: First perform syntax tree obfuscation, and then perform variable replacement obfuscation. The obfuscation will be more complicated, but you need to pay attention to the operation. When obfuscating, first perform syntax tree obfuscation, and then perform variable substitution obfuscation. It is necessary to de-obfuscate the variable replacement first, and then de-obfuscate the syntax tree.

[0059] Other parts of this embodiment are the same as those of Embodiment 1-2 above, so they will not be repeated here.

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to a JavaScript code obfuscation method of a custom obfuscation scheme. The obfuscation method comprises three obfuscation schemes which are independently selected by a user, namely the syntax tree code obfuscation, the variable replacement code obfuscation and the combined code obfuscation. According to the obfuscation method, the obfuscation of the initial JavaScript codesis completed through any one scheme, and an obfuscated JavaScript code, an auxiliary JavaScript code and an obfuscation program are generated. The information verification interaction between a clientand a server is realized by the auxiliary JavaScript code and the obfuscation program, and when a visitor normally accesses a web application, the client and the server can also perform verificationin real time to ensure that the access of the visitor is authorized. According to the invention, the complexity of the code obfuscation, the security of the verification and the operability of a userare improved.

Description

technical field [0001] The invention belongs to the field of code security, and in particular relates to a JavaScript code obfuscation method of a self-defined obfuscation scheme. Background technique [0002] If the written JavaScript code is placed directly on the browser, it is easy for others to plagiarize and steal our hard-written code; at the same time, criminals can easily understand our coding intentions and make corresponding changes. Destruction attacks, so the protection of JavaScript code is a consensus in the industry. [0003] The current protection method for javascript code is mainly through obfuscation, encryption and decryption of javascript code, but this operation is one-time, the secrecy is not complicated enough, and the operability of the user for the obfuscation scheme is not strong. Contents of the invention [0004] Based on solving the problem that the JavaScript code has only one-time operation and the confidentiality is not strong, the presen...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/41G06F21/12
CPCG06F8/42G06F21/125
Inventor 廖培淋范渊吴永越郑学新刘韬
Owner CHENGDU DBAPP SECURITY
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products