Python code secrecy

Source: Internet
Author: User

Python development is highly efficient, but it is too easy to decompile


Use Uncopyle decompile to get almost the same thing as the original code

git clone https://github.com/gstarnberger/uncompyle.git
CD uncompyle/
sudo./setup.py Install
uncompyler.py THANK_GOODNESS_THIS_STILL_EXISTS.PYC > recovered_file.py


Code obfuscation is a good idea, but its tools are pyobfuscate, and have long ceased to maintain


The code is all translated into Base64, the method of conversion is not advisable, the code is ugly, directly with the B64decode, it is transformed over

>>> Import Base64
>>> mycode = "print ' Hello world! '"
>>> secret = Base64.b64encode (Mycode)
>>> Secret
' Chjpbnqgj2hlbgxvifdvcmxkicen '
>>> Mydecode = Base64.b64decode (Secret)
>>> eval (Compile (mydecode, ' <string> ', ' exec '))
Hello world!


Is it that the only way to do this is to mix python with C + +?


Ref

Http://stackoverflow.com/questions/8189352/decompile-python-2-7-pyc

Python code secrecy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.