In fact, encryption is very simple. Modify the code of the Python virtual machine, modify the virtual code for the part where pyc is compiled, or swap a few. No one else can figure it out. This method comes from (Yunfeng Daxia) (from the book "My Programming Insights") The disadvantage is also obvious, you must use your own modified Python virtual machine when executing.
You can use this python obfuscator to encrypt. The encryption effect is irreversible, and other methods such as pyc, compiling into exe or even modifying the bytecode are easier to restore.
Just publish the pyc file generated by compiling the python source code
python -m py_compile src.py
In fact, encryption is very simple. Modify the code of the Python virtual machine, modify the virtual code for the part where pyc is compiled, or swap a few. No one else can figure it out. This method comes from (Yunfeng Daxia) (from the book "My Programming Insights")
The disadvantage is also obvious, you must use your own modified Python virtual machine when executing.
At best, it is just confusion. It is impossible to achieve encryption in the true sense. This is the nature of interpreted languages.
You can use this python obfuscator to encrypt.
The encryption effect is irreversible, and other methods such as pyc, compiling into exe or even modifying the bytecode are easier to restore.
The most Python can do is obfuscate as mentioned above. If you want to encrypt the data, I haven’t found a good solution yet
Compile the core code into an os file using cython (note: python syntax is still used).
Finally someone has encountered this pitfall, haha
pyminifier, and then compile it into pyc. Just provide pyc