Technical Answer - Protecting code in python

Diez B. Roggisch deets at nospam.web.de
Wed Mar 21 10:03:57 EDT 2007


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



More information about the Python-list mailing list