hide python code !

P

Paul Boddie

Fuzzyman said:
Paul Boddie wrote:

[Skype paper]
How many users did skype have before that happened...

Several orders of magnitude above what is required to earn a living
from selling a few programs I suspect.

The point was that dreaming up exotic "protection" schemes for closed
source software is quite possibly only the highest priority in either a
highly traditional shrinkwrapped proprietary software business (where
the evidence - my spam folder - suggests that the "protection" is only
a marginally effective deterrent) or in some kind of proprietary
software plus services business where you don't want people tampering
with your infrastructure (where the evidence suggests that anyone
determined enough will force you to continually focus on that
"protection" scheme over the long-term).

So, if the questioner just wants to sell a few programs, they might
want to either consider different business models than those
traditionally envisaged, or they might want to be aware that fancy
"protection" is most likely to be a long-term investment yielding
moderately disappointing results, and that their energy is best
directed elsewhere.

Paul
 
F

Fuzzyman

Tim Chase wrote:
[snip....]
However, it's better to have a good relationship with your
customers and know that they will adhere to licensing conditions,
rather than to try and strong-arm them into behaving a particular
way.

Don't forget that distributing your source code is more of a gift to
your competitors (and potential competitors) than it is to your
customers...

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
 
P

Paul Boddie

Note your choice of words: "don't really want to do it".

[...]
If you distribute applications with py2exe then your application is no
longer dependent on the installed version of Python.

But there are numerous other things that might stop whatever binary it
is from working over longer periods of time. Besides, py2exe
executables don't exactly exhibit various typical benefits of normal
Python programs such as being able to run on more than one platform,
unless you recommend that everyone runs those applications in some kind
of Windows virtualisation solution.
The question keeps getting asked because a lot of new programmers are
looking to create programs that they will sell. A lot of these will be
good programmers, and some of the software will be successful. Telling
them 'you can't do that with Python', does no good to Python itself.

But many people admit that solutions do exist, notably py2exe and other
tools which do very similar things but for more than one platform (and
have done so for at least a decade). Now you did say that people are
being made to feel that they "don't really want to do it", but that's a
very different thing from being told that they "can't do that with
Python".

Personally, I'd rather people chose not to do such things with Python,
for various reasons including the inability of the end-user to study or
fix bugs in the code or to take advantage of various well-known
benefits of the Python language, library and runtime. But I do admit
that they at least can achieve some level of obfuscation or
"protection" for such endeavours (and a suitably-phrased Web search
will provide established solutions for doing just that).

Paul
 
H

Helmut Jarausch

John said:
Bayazee said:
hi
can we hide a python code ?
if i want to write a commercial software can i hide my source code from ^^^^^^^^^^^^^^^^^^^^^^^^[1]
users access ?
we can conver it to pyc but this file can decompiled ... so ...!!
do you have any idea about this ...?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[2]


[1] and [2] don't seem to be compatible.

I suppose all of you who have commented about this, are sitting in theBut there are countries (like .ir) where the government has totally different
ideas of 'freedom'. So taking the freedom to write something can be very
dangerous at times. Fortunately most of those guys which intercept every
email and check every web server are not so smart to reverse engineer
everything in a short time since they have to check thousands of pieces of
information each day. Let's make their work a bit harder!
 
B

Ben Sizer

Paul said:
Well, given the pace of technological development and the disregard in
some environments for perpetual backward compatibility, how much of
your infrastructure would you implement in vendor-supplied binaries,
especially when the vendor is a one man plus dog operation? When the
binaries don't work on your newly-upgraded system and the vendor is on
holiday (possibly for good), it doesn't look like a knee-jerk reaction
any more.

It's worth remembering that there is a massive amount of software that
has nothing to do with 'infrastructure', that won't need to be
maintained, or upgraded. Examples include most retail software for the
home or small office, and most entertainment software. Developers of
such software often have understandable reasons for making it
inconvenient to examine the algorithms at a high level.
 
D

Duncan Booth

Fuzzyman said:
Tim Chase wrote:
[snip....]
However, it's better to have a good relationship with your
customers and know that they will adhere to licensing conditions,
rather than to try and strong-arm them into behaving a particular
way.

Don't forget that distributing your source code is more of a gift to
your competitors (and potential competitors) than it is to your
customers...
I believe Eric Raymond has argued that if your competitors are spending
their time trying to work out how to adapt to using your software, that is
time they aren't spending competing with you. So long as you make regular
releases of your software you can ensure that they are always at least one
step behind you.
 
P

Paul Boddie

Ben said:
It's worth remembering that there is a massive amount of software that
has nothing to do with 'infrastructure', that won't need to be
maintained, or upgraded. Examples include most retail software for the
home or small office, and most entertainment software. Developers of
such software often have understandable reasons for making it
inconvenient to examine the algorithms at a high level.

It may be the case that certain kinds of applications can go on working
forever on whatever hardware they were intended to run, right until the
point when the hardware ceases to function correctly or when the
end-user gets bored of it, or envious of the neighbour's hardware, or
for whatever other reason. However, I've seen plenty of evidence of
"home or small office" software which arrives as a binary, employs its
own proprietary format, runs on now-legacy hardware and whose users are
now high-and-dry with respect to accessing their old documents.

Sure, developers of such software may not want their competitors to
find out how their products work - certain companies also like to file
patents for that added anticompetitive edge, should their competitors
even consider figuring out the not-so-magic formula - but as end-users
of software ourselves, we don't have to share such an understanding of
their motivations, especially when such motivations directly conflict
with our own: with respect to the above evidence, our own motivations
are to have a reasonable level of control over the tools to manage our
own data.

It may not matter if some console game or other doesn't work after 20
years, although I think it's actually something of a shame given that
such artifacts, no matter how apparently trivial they are, are actually
part of our culture and shouldn't be so readily discarded and
forgotten, but when your own data is not easily accessible within a
much shorter timeframe, the scandal is (at least to me) so much more
obvious.

Paul
 
B

Ben Sizer

Paul said:
Sure, developers of such software may not want their competitors to
find out how their products work - certain companies also like to file
patents for that added anticompetitive edge, should their competitors
even consider figuring out the not-so-magic formula - but as end-users
of software ourselves, we don't have to share such an understanding of
their motivations, especially when such motivations directly conflict
with our own: with respect to the above evidence, our own motivations
are to have a reasonable level of control over the tools to manage our
own data.

I think you're possibly being a bit idealistic here. I use and endorse
open source and open formats wherever possible but I don't believe we
would have the same degree of diversity of software available if
everything was open.

Imagine if you were the single-person developer of a small application
that did something quite innovative, and charged a small fee for your
product. Now imagine you were practically forced to make your algorithm
obvious - a couple of months later, Microsoft bring out a freeware
version and destroy your business in an instant. Sure, they and others
can (and have) done that with closed-source products, but you increase
your chances of survival 10-fold if the key algorithms are not obvious.

The only other way to protect against that would be a software patent,
and I disagree with their existence on the grounds that it punishes
those who discover the techniques independently.
It may not matter if some console game or other doesn't work after 20
years...

Certainly; yet this is a valid example of software that requires a
degree of protection since some of the algorithms employed truly are
'worth stealing'. They can usually be replicated in time, but that may
be months and allows the original company to have a deserved commercial
advantage.
...although I think it's actually something of a shame given that
such artifacts, no matter how apparently trivial they are, are actually
part of our culture and shouldn't be so readily discarded and
forgotten...

Thankfully we have emulators for most platforms, and hopefully
litigation won't kill those off.
...but when your own data is not easily accessible within a
much shorter timeframe, the scandal is (at least to me) so much more
obvious.

I think it's quite possible to have a closed binary but an open
document format, thus allowing the user to migrate away at any point
while still preserving any 'secrets' in the implementation.
 
T

Terry Reedy

Fuzzyman said:
I never understand the knee-jerk reaction on this mailing list to
answer people who ask this question by telling them they don't really
want to do it...

Let's clarify the question: "Dear Python programmers: please tell me for
free how I can hide my code from you and others like you."

This question has nothing to do with preventing blind copying of
distributed software, whether in source or binary form.

tjr
 
P

Paul Boddie

Ben said:
Imagine if you were the single-person developer of a small application
that did something quite innovative, and charged a small fee for your
product. Now imagine you were practically forced to make your algorithm
obvious - a couple of months later, Microsoft bring out a freeware
version and destroy your business in an instant. Sure, they and others
can (and have) done that with closed-source products, but you increase
your chances of survival 10-fold if the key algorithms are not obvious.

This point is fairly comprehensively answered in the following article:

http://radar.oreilly.com/archives/2006/08/apple_eats_whiners.html
The only other way to protect against that would be a software patent,
and I disagree with their existence on the grounds that it punishes
those who discover the techniques independently.

And that's not all. Even if you accept the granting of patents for
mathematical or scientific processes (which I don't), it's hard to
justify people privatising the commons by building on the freely
available knowledge which made their own work possible whilst holding a
monopoly which not only prevents others from building on that work, but
also, as you say, from building anything similar independently or
otherwise from the starting point of that prior knowledge.

[...]
Thankfully we have emulators for most platforms, and hopefully
litigation won't kill those off.

Hopefully, yes. But the wider issue is that of ownership of culture and
whether such a concept makes sense. When you're having some popular
music involuntarily pumped into your consciousness through multiple
channels of the media, do you not have the right to say that since
you've heard the song in question umpteen times, and that the "rights
holder" was quite happy to have the work broadcast on the radio, on
television, in the shopping mall, at the airport, and so on, that you
should then be able to record the song, play it back whenever, however
and how often you like, or perhaps remix it, parody it, cover it, or
play it backwards at your leisure?

The stuff about patents, small companies supposedly innovating and
popular culture intersect quite nicely around things like copyright
expiry. I read an article where various aging popular musicians were
lobbying the British government to extend the period of copyright
beyond 50 years because their first works would soon fall into the
public domain and that they'd no longer earn royalties on those works.
But in what percentage of the many other jobs that exist do you still
get paid for a day at work that happened over 50 years ago?

[...]
I think it's quite possible to have a closed binary but an open
document format, thus allowing the user to migrate away at any point
while still preserving any 'secrets' in the implementation.

That's the point of view held by certain software vendors, but many
vendors have sadly failed to resist the temptation to lock users in
completely, using every available technique to make it almost
impossible to migrate. And then the end-users are faced with migrating
away from obsolescence. It doesn't matter if it's a Fortune 500 company
or just some individual whose data is at risk: putting the "competitive
advantage" of the vendor before that data is plainly unethical.

Paul
 
P

Philippe Martin

Bayazee said:
hi
can we hide a python code ?
if i want to write a commercial software can i hide my source code from
users access ?
we can conver it to pyc but this file can decompiled ... so ...!!
do you have any idea about this ...?

Unless you have some very specific (patent-prone) algo in your code, I do
not think you really have an issue there: *.pyc is enough to disturb most
people.

The real danger I see is a company trying to copy your concept as the real
IP (assuming the above is true) is in your specifications ... which can be
re-designed from looking at your application: I buy one legal copy of your
stuff, put a few smart guys on the deal and come up with a competitive
application some time later (I've seen companies do that).




Philippe
 
B

Ben Finney

Fuzzyman said:
The question keeps getting asked because a lot of new programmers are
looking to create programs that they will sell.

"Sell the software" is in no way dependent on "hide the source code":
businesses across the globe sell software that doesn't have the source
code hidden, often *with* source code.

Indeed, as Paul Boddie points out, hiding the source code from one's
customers, and refusing them permission to take the software to
someone else to improve it, is increasingly becoming a way to *reduce*
the willingness of people to buy one's software.

All this seems worth pointing out to any new programmers whom you
posit are looking to create programs that they will sell.
 
B

Ben Finney

Fuzzyman said:
And categorising their intent in this way

I don't see how this categorises intent at all. It's clarifying what
the question means.

"Dear Python programmers" -- the message was to comp.lang.python.

"please tell me for free" -- they have asked a question, and clearly
expect an answer without further remuneration requirements or other
payment.

"how I can hide my code" -- this is exactly what they've asked.

The only thing I can see in there you might object to is the "you and
others like you". Here, "you" is "Python programmers". By hiding the
source code to their programs, they will hide it from any Python
programmers.

Any one of their customers may want improvements to the program that
they (the author) may not be motivated to work on, for whatever
reason. No shame in that -- and no categorisation of intent.

The customer can then ask any other Python programmer to make the
improvements, offering whatever consideration is agreeable to both
parties. If the source code is hidden, its *hidden from the Python
programmer* and others like them.

Nowhere in this has intent of the author been categorised. It makes
clear some of the consequences of the proposed course of action.
 
B

Bayazee

Hi,
ThnaX for Your Answers ...
i am an open source programmer ... ! and i never like to write a closed
source app or hide my codes ! it just a question that i must
answer/solve it!
one of site ( www.python.ir ) users asked this question ! but
unfortunately i have't any solution to it ! so i ask it here to know
your concepts ...
so sorry for my inferior question
but i realy want to know a way to do it(if it possible) ! and it is't
mean that i want to do it !
Best Regard's
 
P

Philippe Martin

Bayazee said:
Hi,
ThnaX for Your Answers ...
i am an open source programmer ... ! and i never like to write a closed
source app or hide my codes ! it just a question that i must
answer/solve it!
one of site ( www.python.ir ) users asked this question ! but
unfortunately i have't any solution to it ! so i ask it here to know
your concepts ...
so sorry for my inferior question
but i realy want to know a way to do it(if it possible) ! and it is't
mean that i want to do it !
Best Regard's

Is there such a thing as inferior questions ? only fools do not ask
questions, you clearly do not qualify ... heads up !!!


Philippe
 
G

Grant Edwards

The only thing I can see in there you might object to is the "you and
others like you". Here, "you" is "Python programmers". By hiding the
source code to their programs, they will hide it from any Python
programmers.

And hiding Python code from non-Python programmers is sort of
moot. ;)
 
C

Cameron Laird

Hi,
ThnaX for Your Answers ...
i am an open source programmer ... ! and i never like to write a closed
source app or hide my codes ! it just a question that i must
answer/solve it!
one of site ( www.python.ir ) users asked this question ! but
unfortunately i have't any solution to it ! so i ask it here to know
your concepts ...
so sorry for my inferior question
but i realy want to know a way to do it(if it possible) ! and it is't
mean that i want to do it !
Best Regard's

I disagree with the respondents who have told you it's
impossible. While I can't make time now to answer your
question fully, I recommend that you read up on Pyrex
and py2exe.
 
S

Steven D'Aprano

What you can do with Python is almost certainly *good enough* for most
people who ask this question - and that fact never seems to be included
in the 'reality' propogated by the knee jerk reactionists... :p

The Original Poster *explicitly* stated that he was aware of the .pyc
files, and rejected that strategy because .pyc files can be decompiled.

He was asking for something which can't be decompiled, which is not
possible since machine code can also be decompiled -- in fact, there
are probably lots more disassemblers and decompilers for C than there are
for Python. I'd rather educate him so he stops wasting his time rather
than reinforce his ignorance by pretending that there are ways of
distributing code without it also being decompilable.

You suggested that it does harm to Python to give developers a realistic
understanding of what Python is capable of, and that it's better to give
them a misleading answer. I reject that idea utterly.
 
S

Steven D'Aprano

Imagine if you were the single-person developer of a small application
that did something quite innovative,

And imagine that you found a money-tree in your back yard...

How about a more likely scenario? Imagine you're using a boring,
run-of-the-mill algorithm, the same as 99.9% of all software out there,
and that it's neither non-obvious nor innovative in any way at all.
Statistically, I'd say it is ten thousand times more likely that this is
the case than that the algorithm is at all valuable. Everybody thinks
their algorithm is "special". They almost never are.

Even this is more likely than the semi-mythical algorithm that needs to
be kept secret: the reason "you" (generic you) want to keep your software
secret is because you've copied source code -- from books, from your
friends, from Open Source projects, maybe even from stolen copies of
Windows source code you've downloaded from the darker corners of the
Internet, and you don't want people to know. That's more likely than you
hitting upon an amazing new innovative AND valuable algorithm.

Valuable algorithms are rare. Most software is not valuable for the
algorithm, which is hidden in the source code, but for the functionality,
which is obvious. Algorithms are a dime a dozen.

Certainly; yet this is a valid example of software that requires a
degree of protection since some of the algorithms employed truly are
'worth stealing'.

Yes, and for every algorithm "worth stealing", there are ten thousand that
aren't. Play the odds, and you too will poo-poo the idea that some random
developer on Usenet has discovered a valuable innovative algorithm. More
likely he's just ashamed of his code, or wants to hide backdoors in it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top