python程序代码是开放的、加密困难_保护python源代码

1586010002-jmsa.png

I want to protect python script, since people most likely known to be jerks and steal someones work i would really like to protect it.

Its sad how easily it can be stolen... copy paste my work that i spent months in and then someone changes bits and claims it for himself.

How can i prevent anyone from seeing code? (i tried py2exe and similar, but that most often is suspicious to user since its .exe and i don't want anyone to be afraid of my software)

Linux

Python2 & Python3

解决方案

Encrypt the python code and decrypt them when importing.

Step 1 - Implement your own module loader

You can use the importlib to implement your own python module loader. That is to say, you can change the import process to decrypt your encrypted python code.

But you may say the module loader is also written in python, the crypto key can be easily seen in the python script.

So let's go to next step.

Step 2 - Rewrite your module loader in C/C++

Thanks to cython, python module can be written in C/C++. The decryption code will be compiled to binary code. That's very hard to reverse engineer compared to py or pyc files.

Step 3 - Write a script to encrypt your source tree

This is the simplest part. :)

If you are interested in the topic, this project will help you - pyprotect.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值