技术答案 - 保护python中的代码 [英] Technical Answer - Protecting code in python

查看:66
本文介绍了技术答案 - 保护python中的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一个难题,每当我找到这个答案,它就会从技术领域中获得

并继续道德/社会领域。

首先,我生活在第三世界,不好的政府,教育不好,警察不好

以及大量的税金和账单,以及是的,我生活在一个民主的国家/地区。 (腐败,但民主)。

所以,请不要试图让我相信社交/经济/

开源/给予所有/开放/所有人都是诚实的,直到

证明与兔子相反/跳舞...

记住我需要支付账单和保证金。

现在技术问题:


1 - 有一种方法可以在python中创建一些程序并保护它吗?我不是说b $ b不是在谈论超硬核保护,只是简单的一个

将阻止90%的脚本小子。


2 - 如果我像Web服务一样将代码放在网络中,我怎样才能保护我的

代码不被破坏?有一种方法可以避免有人使用我的网站

并翻录.py文件?


感谢和抱歉介绍

解决方案

flit写道:


1 - 有一种方法可以在python中创建一些程序保护它?我不是在讨论超硬核保护,只是简单的一个

,这将阻止90%的脚本小子。



把它放在可执行文件中?它比隐藏的更隐蔽,但它会阻止一些非专家的公平。我使用并且对pyinstaller感到满意,但是

还有其他选择。我使用它更易于分发给非技术用户,但它也是一种隐藏代码的简单方法。


2 - 如果我把代码放在网络服务器上,我怎样才能保护我的

代码免遭破坏?有一种方法可以避免有人使用我的网站

并翻录.py文件?



正确配置您的网络服务器,它永远不会提供.py文件,

只会生成它们产生的结果。我没有用Python做过,但是我用
在Apache和XSLT上设置了类似的东西,它只会给生成的数据提供

,而不是代码它创造了它。即使

代码中有错误也是如此 - 它只会给出HTTP 500内部服务器

错误并且对它的错误日志转储一些更有用的东西。


-

我在CAMbridge,而不是SPAMbridge


flit写道:


Hello All,


我每次都有一个难题我寻找这个答案,它从技术领域中获得了b $ b,继续在道德/社会领域。

首先,我生活在第三世界与坏政府。教育不好,警察不好

和很多税款和账单要支付,是的,我生活在一个民主的状态中。 (腐败,但民主)。

所以,请不要试图让我相信社交/经济/

开源/给予所有/开放/所有人都是诚实的,直到

证明与兔子相反/跳舞...

记住我需要支付账单和保证金。

现在技术问题:



这些讨论中的大多数都不是关于开源或道德的,而是关于你问的问题 - 技术细节。我的一个朋友用一个反汇编装置是如此流利的b
,他会立即在你平常的模拟风格游戏中获得他想要的任何数量的学分。

。 >

这只是一个问题,即你提出的障碍是否足够高?

目标读者 - 并且出于某种原因,人们会觉得编译代码

会更安全。不是。除非采取非常特殊的措施

(例如skype),但那也超出了常见的C编译器运行。


几乎总是没有关键在于你已经编写了一些东西,而这些东西对于撕裂并分块使用会很有趣。对不起,

但99%的代码只是一些胶合逻辑 - 并且不愿意开发人员甚至使用明确购买和记录良好的库
而不是推出他们自己的定制解决方案说明

将你的思维方式调整为其他人的问题更多的是问题

比实际编写金额更多 - 大多数是琐碎的 - 代码。


唯一_real_有趣的东西是复制保护。但这是一个问题

对所有人来说,也是编译器阵营伙伴。


1 - 有办法制作一些python中的程序并保护它?我不是在讨论超硬核保护,只是简单的一个

,这将阻止90%的脚本小子。



如果可以,只需提供pyc文件即可。对于大多数人来说应该足够辛苦了。


2 - 如果我把代码放在网络上就像网络服务一样,我该如何保护我的

代码被扯掉?有一种方法可以避免有人使用我的网站

并翻录.py文件?



服务不会暴露这些文件,除非你以某种方式指示它做

所以。

Diez


3月21日下午2:36,flit < superf ... @ gmail.comwrote:


现在技术问题:


1 - 有办法在python中制作一些程序并保护它?我不是在讨论超硬核保护,只是简单的一个

,这将阻止90%的脚本小子。



冻结。对于99%的用户来说,这应该足够了。


2 - 如果我把代码放在网络上就像一个网络服务,我怎样才能保护我的
被破坏的
代码?有一种方法可以避免有人使用我的网站

并翻录.py文件?



这是关于特定

服务器安全性的更多问题。通常情况下,如果服务器设置良好,那么未经授权的用户无法访问外部的源代码表格。


Hello All,

I have a hard question, every time I look for this answer its get out
from the technical domain and goes on in the moral/social domain.
First, I live in third world with bad gov., bad education, bad police
and a lot of taxes and bills to pay, and yes I live in a democratic
"state" (corrupt, but democratic).
So please, don''t try to convince me about the social / economical /
open source / give to all / be open / all people are honest until
prove contrary / dance with the rabbits...
Remember I need to pay bills and security.
Now the technical question:

1 - There is a way to make some program in python and protects it? I
am not talking about ultra hard-core protection, just a simple one
that will stop 90% script kiddies.

2 - If I put the code in web like a web service, how can I protect my
code from being ripped? There is a way to avoid someone using my site
and ripping the .py files?

Thanks and sorry for the introduction

解决方案

flit wrote:

1 - There is a way to make some program in python and protects it? I
am not talking about ultra hard-core protection, just a simple one
that will stop 90% script kiddies.

Put it in an executable? It''s more hidden than protected, but it will stop a
fair few non-experts. I use and have been happy with pyinstaller, though
there are other options. I use it more for ease of distribution to
non-techy users, but it''s also a simply way to hide your code.

2 - If I put the code in web like a web service, how can I protect my
code from being ripped? There is a way to avoid someone using my site
and ripping the .py files?

Configure your web-server properly and it will never serve up the .py files,
only the results generated by them. I''ve not done it with Python, but I
have set up a similar thing with Apache and XSLT where it will only give
the generated data, not the code which created it. This is true even if
there''s an error in the code - it will just give "HTTP 500 Internal Server
Error" and dump something a bit more useful to its error log.

--
I''m at CAMbridge, not SPAMbridge


flit wrote:

Hello All,

I have a hard question, every time I look for this answer its get out
from the technical domain and goes on in the moral/social domain.
First, I live in third world with bad gov., bad education, bad police
and a lot of taxes and bills to pay, and yes I live in a democratic
"state" (corrupt, but democratic).
So please, don''t try to convince me about the social / economical /
open source / give to all / be open / all people are honest until
prove contrary / dance with the rabbits...
Remember I need to pay bills and security.
Now the technical question:

Most of these discussions aren''t about open source or moral, but exactly
about what you ask - technicalities. A friend of mine is so f**ing fluent
with a disassembler, he immediately has whatever amount of credits he wants
in your usual simulation style game.

It''s just a question of if the hurdles you put up are high enough for you
intended audience - and for some reason people feel that compiled code
would be much more safe. It''s not. Unless very special measures are taken
(e.g. skype), but that then is also beyond the common C-compiler run.

And what almost always is not a point is that you''ve programmed something
that would be interesting for outher to rip apart and use in pieces. Sorry,
but 99% of all code is just a bit of glue logic - and the reluctance of
developers to even use explicitly bought and well-documented libraries
instead of rolling out their own, customized solution illustrates that
adjusting your mindset to that of somebody else is much more of a problem
than actually writing amounts of - mostly trivial - code.

The only _real_ interesting thing is copy-protection. But that''s a problem
for all, also the compiler-camp-buddies.

1 - There is a way to make some program in python and protects it? I
am not talking about ultra hard-core protection, just a simple one
that will stop 90% script kiddies.

If you can, just deliver the pyc-files. Should be hard enough for most
people.

2 - If I put the code in web like a web service, how can I protect my
code from being ripped? There is a way to avoid someone using my site
and ripping the .py files?

A service doesn''t expose those files, unless you somehow instruct it to do
so.

Diez


On Mar 21, 2:36 pm, "flit" <superf...@gmail.comwrote:

Now the technical question:

1 - There is a way to make some program in python and protects it? I
am not talking about ultra hard-core protection, just a simple one
that will stop 90% script kiddies.

Freeze. That should be hard enough for 99% of users.

2 - If I put the code in web like a web service, how can I protect my
code from being ripped? There is a way to avoid someone using my site
and ripping the .py files?

That''s more of a question about the security of that particular
server. Normally if the server is well set up, there is no way that
unauthorized user could access source code form outside.


这篇关于技术答案 - 保护python中的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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