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

Python source code protection method and system based on pyc encryption

A source code and code technology, applied in the field of network security, can solve problems such as inapplicability, low source code protection, cumbersome conversion process, etc., to achieve the effect of enhancing security, solving cumbersome process, and improving operating efficiency

Active Publication Date: 2021-09-24
HUNAN UNIV +1
View PDF11 Cites 2 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
  • Python source code protection method and system 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, which comprises the following steps: acquiring self-defined Python files imported by a user in a to-be-operated Python source code file, performing bytecode conversion processing on the self-defined Python files to generate corresponding pyc files, and deleting the self-defined Python files; encrypting the pyc files to obtain encrypted pyc files, obtaining a Python interpreter source code, modifying the Python interpreter source code to obtain a modified Python interpreter source code, recompiling the modified Python interpreter source code to generate a Python interpreter binary file, executing the to-be-operated Python source code file by using the generated Python interpreter binary file so as to decrypt the obtained encrypted pyc files and obtain an operation result. According to the method and the system, the technical problem of relatively low source code protection in an existing Python source code obfuscation method and a Python source code packaging method can be solved.

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