推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
tcxurun
V2EX  ›  Python

Python 代码的保密的一些问题

  •  
  •   tcxurun · Dec 21, 2020 · 4424 views
    This topic created in 2105 days ago, the information mentioned may be changed or developed.
    公司相关主要是采用 Java 开发,但是涉及到一些算法是用 python 写的,现在是想把 Python 代码保护起来,python 源码保护的方案主要有代码混淆、修改解释器和编译成二进制这三种,调研了一下,觉得编译成二进制文件这种不错,但是有个点是需要注意兼容性,不知道结合容器是否可以,把源码在容器中编译成 so 文件,然后删除源码,最后导出容器为镜像,客户现场部署导出的镜像,不知道这样是否可行?
    10 replies  •  2020-12-28 11:18:36 +08:00
    chinazz
        1
    chinazz  
       Dec 21, 2020   ❤️ 1
    可行
    superrichman
        2
    superrichman  
       Dec 21, 2020
    这问题每年都会问几次 /t/624292
    你把环境折腾好能跑起来就可行
    Cipher0
        3
    Cipher0  
       Dec 21, 2020
    字节码正解
    代码保护本质就是二进制的对抗
    反而是一些字符串类的建议混淆
    要不然二进制调的时候很好调
    vissssa
        4
    vissssa  
       Dec 21, 2020
    我们是用 cython 的
    learningman
        5
    learningman  
       Dec 21, 2020
    算法用 Python 写是为了留出优化空间吗。。。
    xchaoinfo
        6
    xchaoinfo  
       Dec 21, 2020 via Android
    我们的项目用 cython,非常成熟
    yanhh
        7
    yanhh  
       Dec 26, 2020
    @learningman 计算调用 c/c++/go 库,参考 numpy, tensorflow
    learningman
        8
    learningman  
       Dec 26, 2020
    @yanhh 那就没必要加密了啊,调接口的胶水而已
    看楼主表述,算法本身估计就是 python 写的
    yanhh
        9
    yanhh  
       Dec 26, 2020
    @learningman 比如说写一个神经网络,算三角函数、指数、矩阵乘法的部分调用 numpy 的函数,但是整个网络都是写在 Python 里的。
    julyclyde
        10
    julyclyde  
       Dec 28, 2020
    这事跟容器就没有任何关系
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2572 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 05:35 · PVG 13:35 · LAX 22:35 · JFK 01:35
    ♥ Do have faith in what you're doing.