如何保护专有的Python代码? (字节码混淆?,还有什么更好的?) [英] How protect proprietary Python code? (bytecode obfuscation?, what better?)

查看:56
本文介绍了如何保护专有的Python代码? (字节码混淆?,还有什么更好的?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专有软件开发人员如何保护他们的Python代码?

人们常常问我有关混淆Python字节码的问题。他们不想让人们很容易地反编译他们专有的Python应用程序。


我想另一个想法就是用C语言重写整个Python应用程序

C代码

更难反编译。


有什么想法吗?

How can a proprietary software developer protect their Python code?
People often ask me about obfuscating Python bytecode. They don''t want
people to easily decompile their proprietary Python app.

I suppose another idea is to rewrite entire Python app in C if compiled
C code
is harder to decompile.

Any ideas?

推荐答案



< se ****** @ spawar.navy.mil>在消息中写道

news:11 ********************* @ v46g2000cwv.googlegro ups.com ...

<se******@spawar.navy.mil> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
专有软件开发人员如何保护他们的Python代码?
人们常常问我有关混淆Python字节码的问题。他们不希望人们轻松地反编译他们专有的Python应用程序。

我想另一个想法是用C语言重写整个Python应用程序如果编译了C / C代码更难反编译。

任何想法?
How can a proprietary software developer protect their Python code?
People often ask me about obfuscating Python bytecode. They don''t want
people to easily decompile their proprietary Python app.

I suppose another idea is to rewrite entire Python app in C if compiled
C code
is harder to decompile.

Any ideas?




转到Google的新闻组档案以获取clp(可通过google.com访问)并且

搜索这个问题上的一些过去的线程,给出了几个想法和观点。在python.com上的Python常见问题解答或Wiki中可能有也可能没有。



Go to Google''s newsgroup archives for c.l.p (accessible via google.com) and
search for some of the numerous past threads on this issue, which give
several ideas and viewpoints. There may or may not also be something in
the Python FAQ or Wiki at python.com.


嗯,你可以做一些愚蠢的事情:创建你嵌入的ac文件

你的代码,即。


#include< python.h>


char code [] =" print''hello moshe''" ;;


void main(...)

{

Py_ExecString(代码);

}


然后你可以将C文件编译成目标文件,并使用常规

混淆器/反调试器。当然,真正想要获得

来源的人将能够这样做,但这需要更多时间。使用模糊处理的好主意是什么?


但无论如何,它是愚蠢的。为什么要一个鸡巴?无论你使用什么,那些*真的想要获得

的人都可以。毕竟,

代码正在他们的CPU上执行,如果CPU可以执行它,那么

真的可以激发男人的热情。那些不想使用你的产品的人,
如果你提供来源,无论如何,b $ b都不在乎。分享。

-tomer

well, you can do something silly: create a c file into which you embed
your code, ie.,

#include<python.h>

char code[] = "print ''hello moshe''";

void main(...)
{
Py_ExecString(code);
}

then you can compile the C file into an object file, and use regular
obfuscators/anti-debuggers. of course people who really want to get the
source will be able to do so, but it will take more time. and isn''t
that
the big idea of using obfuscation?

but anyway, it''s stupid. why be a dick? those who *really* want to get
to the source will be able to, no matter what you use. after all, the
code is executing on their CPU, and if the CPU can execute it, so
can really enthused men. and those who don''t want to use your product,
don''t care anyway if you provide the source or not. so share.
-tomer



se ****** @ spawar.navy.mil 写道:
专有软件开发人员如何保护他们的Python代码?
人们经常问我有关混淆Python字节码的问题。他们不希望人们轻松地反编译他们专有的Python应用程序。

我想另一个想法是用C语言重写整个Python应用程序如果编译了C / C代码更难反编译。

任何想法?
How can a proprietary software developer protect their Python code?
People often ask me about obfuscating Python bytecode. They don''t want
people to easily decompile their proprietary Python app.

I suppose another idea is to rewrite entire Python app in C if compiled
C code
is harder to decompile.

Any ideas?




以随机顺序随机播放操作码值,重新编译Python,重新编译

stdlib,重新编译py2exe(或者用于捆绑的任何东西)。这将是b $ b让攻击者忙碌几个小时



Shuffle opcode values in random order, recompile Python, recompile
stdlib, recompile py2exe (or whatever you use for bundling). It will
keep attacker busy for several hours


这篇关于如何保护专有的Python代码? (字节码混淆?,还有什么更好的?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆