By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,070 Members | 1,718 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,070 IT Pros & Developers. It's quick & easy.

protecting the python code.

P: n/a
Hi all,
I've developed a testing application in python, and should supply it in
a way that no one (lets say they are regular users) will understand it
and edit it.
The application source is all python but we expose a UI written in C#
that go over all our code and expose to user functions (Indicated with
a special prefix).
So the problem on one hand is protecting the source and make it less
accessible ond on the other hand to make it available for the UI.
10x in advance

Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
nell wrote:
Hi all,
I've developed a testing application in python, and should supply it in
a way that no one (lets say they are regular users) will understand it
and edit it.
The application source is all python but we expose a UI written in C#
that go over all our code and expose to user functions (Indicated with
a special prefix).
So the problem on one hand is protecting the source and make it less
accessible ond on the other hand to make it available for the UI.
10x in advance


Before I spend *any* time explaining why this is probably a bad idea,
not to mention impossible, I'd need to be convinced that your code is
worth protecting in the first place :-)

Why is *your* code so much more valuable than any other commercial
Python code currently distributed in non-obfuscated form?

Paranoia can be taken too far.

What does "10x in advance" mean?

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
Jul 18 '05 #2

P: n/a
Hi Steve,
First the "10x in advance" means thanks in advance.
The main importance of protecting my code is to save headache of
customers that want to be smart and change it and then complain on bugs
and problems.

10x

Jul 18 '05 #3

P: n/a
nell wrote:
Hi Steve,
First the "10x in advance" means thanks in advance.
The main importance of protecting my code is to save headache of
customers that want to be smart and change it and then complain on bugs
and problems.

10x


I'd say that's more of a policy issue than a technical issue. You have a
contract or agreement with your customers, right? Just place a cluase in
it that addresses your concerns. You don't have to support people who
have altered your code... nor should they expect to be supported.

Jul 18 '05 #4

P: n/a
nell wrote:
Hi Steve,
First the "10x in advance" means thanks in advance.
The main importance of protecting my code is to save headache of
customers that want to be smart and change it and then complain on bugs
and problems.

10x

I'd have understood "tnx", never seens 10x b4 :-)

Your concerns are what licensing's for. ("No support on modified copies"
would be a good heading for a section addressing this issue).

With good enough release controls you can verify the code is unmodified
using md5 checksums or similar.

If a customer's good enough at Python to disassemble your .pyc files,
they will probably tell you they've modified your code when the support
queries come in :-)

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
Jul 18 '05 #5

P: n/a
nell wrote:
First the "10x in advance" means thanks in advance.
The main importance of protecting my code is to save headache of
customers that want to be smart and change it and then complain on bugs


also you can try to use py2exe
Jul 18 '05 #6

P: n/a
nell wrote:
Hi all,
I've developed a testing application in python, and should supply it in a way that no one (lets say they are regular users) will understand it and edit it.
The application source is all python but we expose a UI written in C#
that go over all our code and expose to user functions (Indicated with a special prefix).
So the problem on one hand is protecting the source and make it less
accessible ond on the other hand to make it available for the UI.
10x in advance


You basically have two options:

1. Use Pyrex to compile your application to be used as (a) module(s).
2. Use Pyrex to compile your application and embed Python in it.

The first option is probably the easier of the two, and it only
requires that you install Pyrex
(http://nz.cosc.canterbury.ac.nz/~greg/python/Pyrex/) and that you
study the Docs and the Demos in their respective directories.

The second option is more involved but is still possible. You need to
follow this:
http://lists.copyleft.no/pipermail/p...ne/000822.html

Many people use Pyrex to write Python extensions only. But given the
obvious absence of competitors to address the issue of the protecting
of python code, for whatever reason, then I think it is safe to say
that Pyrex is now in a unique position to address that issue as well.
Please be kindly reminded that even py2exe-- although a great
undertaking-- is not AFAIK currrently that protective of your code--
not that it ever claimed it is so-- as draging the resulting exe file
to your zip archiever will reveal the python code inside your exe file.
And so in short: try the Pyrex way.
Regards,
Khalid

Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.