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

A python code obfuscation method based on control flow and appearance obfuscation

A code obfuscation and control flow technology, applied in the field of Python code obfuscation, can solve the problems of core code theft or tampering, and it is difficult to protect the intellectual property rights of the code, and achieve complex logical structure, increase the difficulty of reading and understanding, and protect software copyright. Effect

Active Publication Date: 2019-05-14
苏州思客信息技术有限公司
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

But now there are many open source decompilation tools, which can directly decompile program modules (pyc, pyo) developed in Python language into Python source code, resulting in the core code in the program being stolen or tampered with by attackers, making it difficult for developers to protect intellectual property in its code

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
  • A python code obfuscation method based on control flow and appearance obfuscation
  • A python code obfuscation method based on control flow and appearance obfuscation
  • A python code obfuscation method based on control flow and appearance obfuscation

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0033] In this embodiment, a kind of Python code obfuscation method based on control flow and appearance confusion, according to figure 1 Follow the steps shown:

[0034] Step 1. First, read the Python code that needs to be confused; second, use the built-in functions in the Python language to obtain the parse tree of the code; then, divide all the functions in the Python code with the start and end of a function as the unit, Get several individual functions;

[0035] Step 2. For any single function fun, such as figure 2 As shown in the figure, several consecutively executed codes in the function body are divided, and several basic blocks are obtained and numbered sequentially, recorded as B={b 1 ,b 2 ,...,b i ,...,b n}; figure 2 The number of basic blocks in n=4, so get B={b 1 ,b 2 ,b 3 ,b 4}; b i Indicates the i-th basic block; the i-th basic block b i The code in has only one entry and one exit; 1≤i≤n; to extract the basic blocks in the function;

[0036] Ste...

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 discloses a Python code obfuscation method based on control flow and appearance obfuscation. The method includes: dividing Python codes in each function into corresponding basic blocks by taking the function as a unit; numbering the basic blocks in each function; using a secret key generation algorithm based on sectional Logistic chaotic mapping to generate two sects of secret keys corresponding to the numbers; disorganizing a sequence of the basic blocks in each function, using a control sentence for control, packaging and controlling control variable of an execution sequence of the basic blocks, and using the two sets of the secret keys as condition variables for generating numbers of the basic blocks needing to be executed and in if sentence; performing appearance obfuscation on the codes after control flow obfuscation is performed, and replacing the codes with meaningless character strings. By the method, intellectual property of software developed by using Python language can be protected.

Description

technical field [0001] The invention relates to a program obfuscation method, in particular to a Python code obfuscation method based on control flow and appearance obfuscation. Background technique [0002] The security protection of software code is an important research content in the field of computer security. With the rapid development of the Internet and the advent of the era of big data, the distributed computing environment brings people stronger computing power and greater flexibility, but also makes software codes inevitably run on untrusted nodes. , so that the software code faces more serious security problems. Compared with the black box attack in which the attacker does not know the internal situation of the attack target, this kind of security attack that exposes the software code, analyzes the operation of the code in reverse, and maliciously tampers or steals the code becomes a white box attack. At present, the threat of white-box attacks is rapidly risin...

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 Patents(China)
IPC IPC(8): G06F21/14
CPCG06F21/14
Inventor 顾乃杰王岩陈悟王小强
Owner 苏州思客信息技术有限公司
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