Unlock instant, AI-driven research and patent intelligence for your innovation.

A method and system for protecting python source code based on pyc encryption

A source code and code technology, applied in the field of network security, can solve the problems of cumbersome conversion process, inapplicability, and low source code protection, and achieve the effect of solving cumbersome process, enhancing security, and increasing the difficulty of decompilation

Active Publication Date: 2022-05-20
HUNAN UNIV +1
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] For the above defects or improvement needs of the prior art, the present invention provides a Python source code protection method and system based on pyc encryption, the purpose of which is to encrypt the generated pyc file and modify the Python interpreter source code to enable It can run encrypted pyc files, solve the technical problems of low protection of source codes existing in the existing Python source code obfuscation method and Python source code packaging method, and the existing method of converting py files into so files. The conversion process is cumbersome and not suitable for technical problems of larger projects

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 method and system for protecting python source code based on pyc encryption

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0049] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not constitute a conflict with each other.

[0050] The basic train of thought of the present invention is, at first utilize the symmetric encryption algorithm to encrypt the user-defined Python file imported by the user in the Python source code file to be operated to obtain the corresponding encrypted pyc file; then modify the Python interpreter source code so that it can run Encrypt the pyc file and get the correct running result. The ...

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 source code protection method based on pyc encryption, comprising: acquiring a user-defined Python file imported by a user in a Python source code file to be run, performing bytecode conversion processing on the custom Python file, and Generate the corresponding pyc files, and delete these custom Python files; encrypt the pyc files to obtain the encrypted pyc files, obtain the source code of the Python interpreter, and modify the source code of the Python interpreter to obtain the modified Python interpreter source code, recompile the modified Python interpreter source code to generate a Python interpreter binary file, use the generated Python interpreter binary file to execute the Python source code file to be run, and decrypt the obtained encrypted pyc file and get the running results. The invention can solve the technical problem of low protection of source code existing in the existing Python source code obfuscation method and Python source code packaging method.

Description

technical field [0001] The invention belongs to the technical field of network security, and more specifically relates to a method and system for protecting Python source codes based on pyc encryption. Background technique [0002] The Python programming language can be said to be the most popular computer programming language at present. From the birth of the Python language in the early 1990s to the present, more and more people have begun to use Python, and Python can be seen in various fields. Python is a scripting (interpretation) language, that is, the written Python code is finally interpreted and executed by the Python interpreter, and its Python code file (.py) is essentially the same as a text file, and any text editor can be opened .py file and view its source code. In some business scenarios, you don't want to expose the source code, so you need to use some technical means to protect the security of the Python source code. [0003] Currently commonly used Pytho...

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/60G06F21/12
CPCG06F21/602G06F21/125
Inventor 李肯立杨圣洪王岩松蔡宇辉秦云川吴帆
Owner HUNAN UNIV