473,834 Members | 2,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

protecting the python code.

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
6 1991
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2609
by: beliavsky | last post by:
How do you keep Python code properly indented as you modify it? I use an Emacs-type editor that has a Python mode, so the initial indenting is easy. If I later want to put a 'for' loop (or an 'if' statement) around a bunch of code, I find myself going through the body of the loop, manually re-indenting to keep the nested loops correct. There should be a better way. I think that having a 'for' loop end with a matching 'next' statement,...
9
3773
by: F. GEIGER | last post by:
I've dev'ed a Python prototype of an app, that besides the internals making it up has a gui. While test-driven dev'ing the app's internals in Python is fun as usual, dev'ing the GUI is not so funny, at least for me. I guess dev'ing a GUI in a test-driven way is not possible, or is it? I'm using wxPython, so if anyone has an idea... For now most of the time I extend and change the gui things, then run it, do the clicks to go thru the...
18
5735
by: Alan Sheehan | last post by:
Hi pythonistas, I am looking for methods of deploying applications with end users so that the python code is tamper proof. What are my options ? I understand I can supply .pyc or .pyo files but they can easily be reverse engineered I am told. Is it possible to load the scripts from zip files where the zip files are password protected ?
4
5681
by: paritosh mahana | last post by:
Hi all, How can I call python code from my C# code. One thing is to make an ..exe file of the python program and then try to call it from my C# code. But I don't like that idea. Is there any other way to do this. Like making a .dll file from the python code and somehow call it from C# program.But I couldn't find anything on this topic on the net. Actually my GUI is in C# and rest part is in python, and i need to call python from my C#...
7
2161
by: Hansan | last post by:
Hi all, I hope you have time to help me out a little. My problem is that I want to combine some python code I have made with some html templates, I found a tutorial at dev shed: http://devshed.spunge.org/Server_Side/Python/CGI/page6.html and : http://devshed.spunge.org/Server_Side/Python/CGI/page5.html and tried to do it like they do, but it doesn't work. I used the same code they use for making the two display functions and the same...
5
1903
by: John | last post by:
Dear all, I've got a security question that is so difficult that "maybe" there will be no answer for it. It's regarding protecting asp code. I did write some asp code, that I sell to companies, to control several dbases. Because I sell the code, it's not that they own the code and can sell it further or change the code, or add some extra code to it. It's like I'm selling a program like Excel and that they can use the program, not...
3
2093
by: kaens | last post by:
Hey everyone, I'm relatively new to python - I actually picked it up to see how quickly I could start building non-trivial apps with it. Needless to say, I was quite pleased. Anyhow, I'm looking to expand my understanding of python, and I feel that one of the best ways to do that is looking at other peoples code. Unfortunately, I don't feel like I grok the python mindset quite well enough to fully distinguish between awesome,...
23
2541
by: Python Maniac | last post by:
I am new to Python however I would like some feedback from those who know more about Python than I do at this time. def scrambleLine(line): s = '' for c in line: s += chr(ord(c) | 0x80) return s def descrambleLine(line):
12
1757
by: WaterWalk | last post by:
Hello. I wonder what's the effective way of figuring out how a piece of python code works. With C I often find it very useful to be able to run the code in step mode and set breakpoints in a debugger so I can watch how the it executes, how the data change and how the code jumps from one function to another. But with Python, the debugger is a little primitive. The default IDLE doesn't even allow me to set a breakpoint. When the code is...
0
10795
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10512
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9332
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7760
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6957
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3981
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.