Python requires a certain level of security awareness for commercial development, in order not to be easily reversed. Confusion and encryption are necessary. In order to increase the difficulty of code reading, source code confusion is very necessary, http://pyob.oxyry.com/ is an online Python code confusion website. It should also be noted that this confusion is actually suspected by many people, because even if it is confused, it does not change the structure of the code.
1. Source Code Confusion.
So, if necessary, when programming, you can deliberately do things that make it harder to reverse:
- Structure changes slightly, merging several classes into the same file.
- Add innocuous paradigm-programming styles in object-oriented structures.
2. File Encryption.
- The most basic method is to publish pyc files, that is, to convert all .py source files into pyc for distribution .Using the above method can easily generate pyc, to preliminary hidden code. However, pyc can still be easily cracked.
- A trick is to pull all the variables from somewhere in each module into a python file and use cython to process that file, which makes it more difficult for crackers to remove pyd file dependencies from other pyc files.
As an interpreted language, encryption is extremely difficult, open source code is the king, but in the case of should-encryption, you can choose the above encryption method or confusion method.