Source code protection method and device

A source code and code technology, applied in the network field, can solve problems such as weak protection, and achieve the effect of reducing success rate and readability

Active Publication Date: 2019-07-09
HANGZHOU FRAUDMETRIX TECH CO LTD
View PDF9 Cites 22 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] In view of this, the present invention provides a source code protection metho...

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
  • Source code protection method and device
  • Source code protection method and device
  • Source code protection method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0027] figure 1 It is a flow chart of steps of a source code protection method provided by an embodiment of the present invention, such as figure 1 As shown, the method may include:

[0028] Step 101, obtain the source code to be protected, and convert the source code into a syntax tree.

[0029] The syntax tree, also known as the abstract syntax tree, is an abstract representation of the grammatical structure of the source code. It expresses the grammatical structure of the programming language in the form of a tree structure, but the syntax here does not represent every detail that appears in the real grammar. , generally speaking, "syntax highlighting", "keyword matching", "scope judgment", and "code compression" can be performed through the syntax tree. In addition to deconstructing syntax, it is also necessary to provide various functions to traverse and Modify the syntax tree.

[0030] In the embodiment of the present invention, it is necessary to obtain the source co...

Embodiment 2

[0039] figure 2 is a flow chart of steps of another source code protection method provided by an embodiment of the present invention, such as figure 2 As shown, the method may include:

[0040] Step 201, obtain the source code to be protected, and convert the source code into a syntax tree.

[0041]In the embodiment of the present invention, the source code to be protected can be obtained by the staff themselves, or the source code that has been launched in the platform can be obtained, and the method of obtaining the source code is not limited in the present invention.

[0042] Step 202, traverse the syntax tree, and perform protection processing on the units to be protected in the syntax tree; wherein, the units to be protected include at least one of constants, variables, and code blocks.

[0043] In the embodiment of the present invention, in the process of loop traversing the syntax tree, the execution logic of the code can be marked first, such as marking the variabl...

Embodiment 3

[0081] image 3 is a block diagram of a source code protection device provided by an embodiment of the present invention, such as image 3 As shown, the device may include:

[0082] The syntax tree converting module 301 is configured to obtain the source code to be protected, and convert the source code into a syntax tree.

[0083] The syntax tree processing module 302 is configured to traverse the syntax tree and perform protection processing on the units to be protected in the syntax tree; wherein the units to be protected include at least one of constants, variables, and code blocks.

[0084] An object code acquisition module 303, configured to convert the protected syntax tree into an object code.

[0085] Optionally, the unit to be protected is a constant, and the syntax tree processing module 302 includes:

[0086] The constant acquisition submodule is used for traversing the syntax tree to find the constant in the syntax tree.

[0087] The constant encryption submod...

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 provides a source code protection method, and belongs to the technical field of computers. The method comprises the following steps: obtaining a source code to be protected, and converting the source code into a syntax tree; traversing the syntax tree, and performing protection processing on a to-be-protected unit in the syntax tree; wherein the unit to be protected comprises at least one of a constant, a variable and a code block; and converting the syntax tree subjected to protection processing into a target code. According to the embodiment of the invention, a powerful sourcecode protection scheme is provided, and meanwhile, the bottom layer structure of the MINA JS engine is universally adapted, so that the scheme of the embodiment of the invention can be applied to deepprotection of WeChat applet codes.

Description

technical field [0001] The invention belongs to the field of network technology, and in particular relates to a source code protection method and a source code protection device. Background technique [0002] The WeChat mini-program platform currently has more than 1 million mini-programs, 1.5 million developers and more than 5,000 third-party platforms, with over 100 million daily active users. WeChat applets are developed using the MINA JS (Multipurpose Infrastructure for Network Applications, MINA) engine, which is a Javascript engine independently developed by Tencent. Since the Javascript program can directly obtain the source code in the browser, there are many ways to obtain the source code based on the WeChat applet directly from the client, which is less secure. At present, the entire industry lacks effective protection measures, and risks such as the business logic of mini programs being cracked and the code of mini programs being plagiarized and pirated widely pl...

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
IPC IPC(8): G06F21/14G06F21/60G06F8/41
CPCG06F8/427G06F8/44G06F21/14G06F21/602
Inventor 郭嵩彭亮
Owner HANGZHOU FRAUDMETRIX TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products