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

hide python code !

P: n/a
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 ...?

---------------------------------------
First Iranian Open Source Community : www.python.ir

Aug 10 '06 #1
Share this Question
Share on Google+
64 Replies


P: n/a

Bayazee wrote:
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 ...?

---------------------------------------
First Iranian Open Source Community : www.python.ir
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[2]
[1] and [2] don't seem to be compatible.

Really the only way to keep your code secret is not to distribute it --
provide the functionality from a web server.

If you want to distribute obfuscated code, consider writing it in perl
:-)

Aug 10 '06 #2

P: n/a
hi
in compiled languages when we compile a code to an executable file it
convert to a machine code so now we cant access to source ...
but in python we easily open the program executable(ascii) file and
read source ....
i meen than any way to protect my code or convert it to executable
witch can not be decompiled (python code)....

Aug 10 '06 #3

P: n/a

Bayazee wrote:
hi
in compiled languages when we compile a code to an executable file it
convert to a machine code so now we cant access to source ...
but in python we easily open the program executable(ascii) file and
read source ....
i meen than any way to protect my code or convert it to executable
witch can not be decompiled (python code)....
I know what you mean.

However consider this: There is no such thing as an executable which
cannot be decompiled; if the code can be executed, then anybody with
read access to the code can disassemble/decompile/whatever it -- there
is no theoretical difference between disassembling an .exe file and
decompiling a .pyc file. What's in a .pyc file is just the machine code
for a virtual machine ...

Consider changing your business plan: write crappy software, charge
heaps for support -- it's not a novel idea :-)

Aug 11 '06 #4

P: n/a
On Thu, 10 Aug 2006 17:03:51 -0700, Bayazee wrote:
hi
in compiled languages when we compile a code to an executable file it
convert to a machine code so now we cant access to source ...
There are disassemblers for machine code. If somebody really wants to see
how your code works, they can do it.
but in python we easily open the program executable(ascii) file and read
source ....
Yes. That is by design.
i meen than any way to protect my code or convert it to executable witch
can not be decompiled (python code)....
In your first email, you wrote:

"First Iranian Open Source Community : www.python.ir"

Hiding source code is incompatible with Open Source software. You can hide
code, or be Open Source, but not both.

What makes you think that your code is so special that it is worth
stealing? Do you have incredible secret algorithms that nobody has ever
seen before? Or are you just so ashamed of it that you don't want people
to see it?

Or maybe you've copied other people's code, and you don't want them to see
that? What are you hiding?

Whatever your reasons for hiding the source code, there are things which
you can do to obfuscate Python code which will make it difficult for
people to get to the source code. Google for "python obfuscate" for links.
But I'm guessing that, if you hide your source code, most people will
wonder what you are hiding and avoid your program.

If you really want something which compiles to machine code, then Python
is not the language for you. Use another language.

--
Steven D'Aprano

Aug 11 '06 #5

P: n/a
I don't think you're the first person that has wondered about this. But
you might have some options:

1. If you are running it on Windows only, use py2exe to wrap it up as
an executable.
2. I've never done this, but you might be able to encrypt or otherwise
turn you modules into binary form, and then use a clever import hook. I
know zipimport in the standard lib gives you more control over
importing zip files, but I don't think it can handle encrypted ones.
3. Write a custom module importer in C using Python's API so you can
encrypt your modules any way you want as long as you know how to use C
to decrypt them again.

There's probably a thousand other ways if you're clever enough (e.g.
write it in Jython and package it as .jar files). As long as your
program sticks closer to pure Python, the easier it will be. If you're
using a lot of open source modules to help you out, you might want to
double-check their licensing to see if what you're doing is allowed
anyway.
Bayazee wrote:
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 ...?

---------------------------------------
First Iranian Open Source Community : www.python.ir
Aug 11 '06 #6

P: n/a
Bayazee wrote:
hi
in compiled languages when we compile a code to an executable file it
convert to a machine code so now we cant access to source ...
It can still be disassembled and reverse engineered.
but in python we easily open the program executable(ascii) file and
read source ....
i meen than any way to protect my code or convert it to executable
witch can not be decompiled (python code)....
How do you reconcile this desire with being part of "First Iranian Open
Source Community"?

I am not hostile, just curious.
BTW, John Machin's suggestion of presenting your code as a web service
is a good one.

Peace,
~Simon

Aug 11 '06 #7

P: n/a
In article <pa****************************@REMOVEME.cybersour ce.com.au>,
Steven D'Aprano <st***@REMOVEME.cybersource.com.auwrote:
>On Thu, 10 Aug 2006 17:03:51 -0700, Bayazee wrote:
>hi
in compiled languages when we compile a code to an executable file it
convert to a machine code so now we cant access to source ...

There are disassemblers for machine code. If somebody really wants to see
how your code works, they can do it.
>but in python we easily open the program executable(ascii) file and read
source ....

Yes. That is by design.
>i meen than any way to protect my code or convert it to executable witch
can not be decompiled (python code)....

In your first email, you wrote:

"First Iranian Open Source Community : www.python.ir"

Hiding source code is incompatible with Open Source software. You can hide
code, or be Open Source, but not both.

What makes you think that your code is so special that it is worth
stealing? Do you have incredible secret algorithms that nobody has ever
seen before? Or are you just so ashamed of it that you don't want people
to see it?

Or maybe you've copied other people's code, and you don't want them to see
that? What are you hiding?

Whatever your reasons for hiding the source code, there are things which
you can do to obfuscate Python code which will make it difficult for
people to get to the source code. Google for "python obfuscate" for links.
But I'm guessing that, if you hide your source code, most people will
wonder what you are hiding and avoid your program.

If you really want something which compiles to machine code, then Python
is not the language for you. Use another language.
Aug 11 '06 #8

P: n/a
"Bayazee" <ba*****@gmail.comwrites:
can we hide a python code ?
Sure; don't distribute it to anyone. Then they can't run the program
or inspect it or anything.
if i want to write a commercial software can i hide my source code
from users access ?
You can write commercial software and sell it without hiding the
source code.
we can conver it to pyc but this file can decompiled ... so ...!!
Indeed. So?

--
\ "For of those to whom much is given, much is required." -- |
`\ John F. Kennedy |
_o__) |
Ben Finney

Aug 11 '06 #9

P: n/a
Bayazee wrote:
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 ...!!
It's just the same with java byte-code or machine code. FWIW, I had a
cracked (and localised) copy of Steinberg's Cubase midi sequencer v1.1
*before* v1.0 was publicly available in France... And believe me, they
had made their best to protect the software (dongle etc...).

The only secure way to protect "critical" code is to not distribute it -
make it run on your own server, and require the application to access
the server.
Aug 11 '06 #10

P: n/a
Steven D'Aprano wrote:
(snip)
If you really want something which compiles to machine code, then Python
is not the language for you. Use another language.
But that won't protect your software from piracy anyway.

Aug 11 '06 #11

P: n/a

John Machin wrote:
If you want to distribute obfuscated code, consider writing it in perl
:-)
LOL

That's really strong protection. Machine code is too easy
to reverse engineer. :)

Regards,
Rob

Aug 11 '06 #12

P: n/a
On Thu, 10 Aug 2006 17:35:27 -0700
enigmadude <en********@rock.comwrote:

#2. I've never done this, but you might be able to encrypt or otherwise
#turn you modules into binary form, and then use a clever import
#hook.

Please observe that whatever the "clever import hook" is, it actually
needs to know the way to *decrypt* the module (secret key or
whatever). It means that if somebody decompiles the importing code, he
can just as well decompile the "hidden" one.

--
Best wishes,
Slawomir Nowaczyk
( Sl***************@cs.lth.se )

Children are natural mimics, who act like their parents despite
every effort to teach them good manners.

Aug 11 '06 #13

P: n/a
Cameron Laird wrote:
Steven D'Aprano wrote:
Hiding source code is incompatible with Open Source software. You can hide
code, or be Open Source, but not both.
[...]
I also disagree with your characterization of Open Source.
I don't know which part of the open source movement would tolerate the
hiding of source code whilst simultaneously calling the resulting
software "open source", but I'd imagine they'd have a hard time
justifying their "open source" label. Of course, it is possible to be
the "First Iranian Open Source Community" in terms of consuming open
source software rather than producing it, so perhaps that's what the
questioner intended to communicate in their signature.

[...]
Myself, I just marvel at the different worlds in which we live. *My*
experience has to do with how tough it is to deploy and maintain
correct, working stuff, even with teams of seasoned pros. The thought
that users will routinely reverse-engineer our applications, and ...
well, I marvel.
I've previously mentioned a very interesting paper which not only
described the reverse engineering of the Skype protocol and software
but also described how to make interoperating Skype clients. Given that
the well-financed developers spent a lot of time introducing various
protection measures (encryption, verification, etc.) and yet someone
can write the aforementioned stuff up in a paper, I'd recommend an
upgrade to any business plan which relies on obfuscation to prevent
"unauthorised" use or modification. Indeed, I'd recommend that any such
entrepreneur think twice about starting a traditional proprietary
software business in this day and age.

Paul

Aug 11 '06 #14

P: n/a

Bayazee wrote:
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 ...?

---------------------------------------
First Iranian Open Source Community : www.python.ir

You can distribute the compiled byte-code files (*.pyc) which are
harder to turn back into source code.

There was a product called decompyle which could do it, but although
there is a version floating around which works for Python 2.4 I've
never heard of anyone getting it to work.

Import hooks and encrypted source are a good option.

Py2exe embeds the byte-code file for your main script into the
executable which is also pretty good.

All of these make it hard enough to deter most people who will ever
want to abuse your source code. Until you have *lots* of users this is
probably enough.

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...

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

Aug 11 '06 #15

P: n/a

Paul Boddie wrote:
[snip..]
I've previously mentioned a very interesting paper which not only
described the reverse engineering of the Skype protocol and software
but also described how to make interoperating Skype clients. Given that
the well-financed developers spent a lot of time introducing various
protection measures (encryption, verification, etc.) and yet someone
can write the aforementioned stuff up in a paper, I'd recommend an
upgrade to any business plan which relies on obfuscation to prevent
"unauthorised" use or modification. Indeed, I'd recommend that any such
entrepreneur think twice about starting a traditional proprietary
software business in this day and age.
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.

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

Paul
Aug 11 '06 #16

P: n/a
Fuzzyman wrote:
Bayazee wrote:
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 ...!!
[...]
You can distribute the compiled byte-code files (*.pyc) which are
harder to turn back into source code.
As the man said, and I've seen various proprietary software companies
do just that.
There was a product called decompyle which could do it, but although
there is a version floating around which works for Python 2.4 I've
never heard of anyone getting it to work.
I've got decompyle to work in the recent past (about a year or so ago)
- the trick was to find the Debian package and to make some minor
adjustments to the code to work with whatever breakage the 2.3 -2.4
upgrade caused.

[...]
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...
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.

Paul

Aug 11 '06 #17

P: n/a
>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 ...!!

All of these make it hard enough to deter most people who will ever
want to abuse your source code. Until you have *lots* of users this is
probably enough.

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...
I think the reaction is based mostly in reality...an honest
answer: If you give people the program, then you also give them
the ability to reverse engineer it. It's as simple as that.

No matter how dongled, obfuscated, compiled, encrypted, etc. At
some point the code actually has to be executed/interpreted, and
at that point, it can be intercepted. Thus, "by telling them
that they don't really want to do it", the list is conveying the
futility of attempting to strive for the goal. Obfuscation may
be a shallow speedbump, and for some folks, better than nothing.
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.

My "%s%0.2f" % (currency_marker, 0.02) on the matter. :)

-tkc


Aug 11 '06 #18

P: n/a

Paul Boddie wrote:
Fuzzyman wrote:
Bayazee wrote:
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 ...!!

[...]
You can distribute the compiled byte-code files (*.pyc) which are
harder to turn back into source code.

As the man said, and I've seen various proprietary software companies
do just that.
There was a product called decompyle which could do it, but although
there is a version floating around which works for Python 2.4 I've
never heard of anyone getting it to work.

I've got decompyle to work in the recent past (about a year or so ago)
- the trick was to find the Debian package and to make some minor
adjustments to the code to work with whatever breakage the 2.3 -2.4
upgrade caused.

[...]
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...

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.
If you distribute applications with py2exe then your application is no
longer dependent on the installed version of Python.

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.

In fact what you can do with Python is not a lot worse than most other
languages, and almost certainly *good enough* for this sort of thing.

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
Paul
Aug 11 '06 #19

P: n/a

Tim Chase wrote:
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 ...!!
All of these make it hard enough to deter most people who will ever
want to abuse your source code. Until you have *lots* of users this is
probably enough.

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...

I think the reaction is based mostly in reality...an honest
answer: If you give people the program, then you also give them
the ability to reverse engineer it. It's as simple as that.
[snip..]
But until your number of users gets beyond quite a high level, it's
just extremely likely that any of your individual users will have that
sort of ability - or anyone else will have the motivation to do it.

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
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

Aug 11 '06 #20

P: n/a
Fuzzyman wrote:
Paul Boddie wrote:
[Skype paper]
I'd recommend an
upgrade to any business plan which relies on obfuscation to prevent
"unauthorised" use or modification. Indeed, I'd recommend that any such
entrepreneur think twice about starting a traditional proprietary
software business in this day and age.

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

Aug 11 '06 #21

P: n/a

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
My "%s%0.2f" % (currency_marker, 0.02) on the matter. :)

-tkc
Aug 11 '06 #22

P: n/a
Fuzzyman wrote:
Paul Boddie wrote:
Fuzzyman wrote:
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...
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

Aug 11 '06 #23

P: n/a
John Machin wrote:
Bayazee wrote:
>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 ...?

---------------------------------------
First Iranian Open Source Community : www.python.ir
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[2]
[1] and [2] don't seem to be compatible.
I suppose all of you who have commented about this, are sitting in the
>>free world <<< .
But 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!
Aug 11 '06 #24

P: n/a
Paul Boddie wrote:
Fuzzyman wrote:
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...

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.

--
Ben Sizer

Aug 11 '06 #25

P: n/a
Fuzzyman wrote:
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.
Aug 11 '06 #26

P: n/a
Ben Sizer wrote:
>
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

Aug 11 '06 #27

P: n/a
Paul Boddie wrote:
Ben Sizer wrote:

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.

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.

--
Ben Sizer

Aug 11 '06 #28

P: n/a

"Fuzzyman" <fu******@gmail.comwrote in message
news:11*********************@74g2000cwt.googlegrou ps.com...
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

Aug 11 '06 #29

P: n/a
Ben Sizer wrote:
>
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/20...s_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

Aug 11 '06 #30

P: n/a
Bayazee wrote:
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 ...?

---------------------------------------
First Iranian Open Source Community : www.python.ir
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

Aug 11 '06 #31

P: n/a

Terry Reedy wrote:
"Fuzzyman" <fu******@gmail.comwrote in message
news:11*********************@74g2000cwt.googlegrou ps.com...
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."
And categorising their intent in this way is likely to make many
genuine coders cross Python off their list and go and see if the Ruby
community is any friendlier...

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
This question has nothing to do with preventing blind copying of
distributed software, whether in source or binary form.

tjr
Aug 11 '06 #32

P: n/a
"Fuzzyman" <fu******@gmail.comwrites:
Paul Boddie wrote:
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?

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.

--
\ "I always wanted to be somebody. I see now that I should have |
`\ been more specific." -- Lily Tomlin |
_o__) |
Ben Finney

Aug 12 '06 #33

P: n/a
"Fuzzyman" <fu******@gmail.comwrites:
Terry Reedy wrote:
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."

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.

--
\ "I used to be a narrator for bad mimes." -- Steven Wright |
`\ |
_o__) |
Ben Finney

Aug 12 '06 #34

P: n/a
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

Aug 12 '06 #35

P: n/a
Bayazee wrote:
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

Aug 12 '06 #36

P: n/a
On 2006-08-12, Ben Finney <bi****************@benfinney.id.auwrote:
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. ;)

--
Grant Edwards grante Yow! ... I see TOILET
at SEATS...
visi.com
Aug 12 '06 #37

P: n/a
In article <11**********************@m73g2000cwd.googlegroups .com>,
Bayazee <ba*****@gmail.comwrote:
>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.
Aug 12 '06 #38

P: n/a
On Fri, 11 Aug 2006 06:16:26 -0700, Fuzzyman wrote:
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.
--
Steven D'Aprano

Aug 14 '06 #39

P: n/a
On Fri, 11 Aug 2006 09:18:12 -0700, Ben Sizer wrote:
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.

>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'.
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.

--
Steven D'Aprano

Aug 14 '06 #40

P: n/a
Paul Boddie wrote:
Ben Sizer wrote:

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/20...s_whiners.html
I don't believe so. That talks about copying of ideas, which is quite
distinct from copying of implementations. The distinction may be
meaningless in your typical desktop app where implementation is usually
obvious from the interface. However in more high-tech systems such as
multimedia or AI, the same is far from true.
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?
However, in most of those jobs you get paid properly at the time. Aside
from the 1% of musicians who are pop stars, musicians generally do not.
I'm not saying I agree with extending the copyright period, however I
do think you can't just compare it to 'a day at work'. It's a totally
different set of circumstances which requires a different set of rules
to both encourage artists to continue creating while benefitting
society in the long run too.

--
Ben Sizer

Aug 14 '06 #41

P: n/a
Steven D'Aprano wrote:
On Fri, 11 Aug 2006 09:18:12 -0700, Ben Sizer wrote:
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.
I work in game development, where new algorithms and processes are
being discovered all the time. Sure, they're not going to cure cancer
or end poverty but there are most definitely some algorithms devised by
many developers which other companies have no idea how to emulate until
years down the line; long enough for the first company to enjoy a
little commercial benefit based on their individual implementation.
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.
True, however, most is not all, and I think it's unfair to categorise
all software as being so trivial.
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.
Play the odds, and pretty much everything is unlikely. Of all the names
in the world, what was the chance of this language being called Python?
Yet these things occasionally happen. I have no opinion on why the
original poster wants to hide code, only an opinion on there definitely
being a few applications where it is very useful.

--
Ben Sizer

Aug 14 '06 #42

P: n/a
Ben Sizer wrote:
Paul Boddie wrote:
Ben Sizer wrote:
>
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/20...s_whiners.html

I don't believe so.
Well, it talks about competing against some large business who will
eventually emulate your work. The advantage of small businesses
competing against anyone with a fairly rigid schedule and an arguably
non-agile internal organisation is that there will be a certain amount
of time before that large business firstly gets round to dismantling
your product (as opposed to that of the other small competitors),
secondly manages to produce something which does more or less the same
thing, and thirdly is able to bring it to market with the same level of
quality/branding that its customers expect.

Successful software businesses are not merely founded on the process of
having ideas and implementing them - they might also need to be
effective at delivering those ideas and going through the whole process
again and again. Writing a neat utility for Windows is not by itself
the foundation of a successful business - other factors are critical,
whether they be continuous improvements, service, support, or a number
of other things.
That talks about copying of ideas, which is quite
distinct from copying of implementations. The distinction may be
meaningless in your typical desktop app where implementation is usually
obvious from the interface. However in more high-tech systems such as
multimedia or AI, the same is far from true.
Well, let's say that algorithms are a step up from mere ideas, and
let's also say that actual code is a step up from mere descriptions of
algorithms (since actual code serves to verify the behaviour of those
algorithms). The article I mention states that people shouldn't expect
to be rewarded forever for dreaming up some idea, and I extend that
point by stating that people shouldn't expect to be rewarded forever
for describing an algorithm - both of these things being patentable in
various permissive patent regimes, which (in conjunction with a few
other factors) really is quite harmful for anyone actually doing work
in any of the affected lines of work.

So, if we decide to ignore people waving pieces of paper around which
make some claim to an idea or some way of solving some problem, instead
investigating the actual code, others have pointed out already that if
you provide just a binary and there exist people who want to know what
you've done, those people will find it out whether you make it easy for
them or not. Now, if we sidestep the issue of decompiling binaries and
cast the affected work as some kind of service, the question can now be
expressed as whether you should expect to be rewarded forever for
providing such a service. This brings in a number of issues that are
suddenly more apparent than in the case where the end-user has some
binary - notably the issue of control over the activity that the
service performs - and such issues could possibly increase competitive
pressure rather than enhance any supposed competitive advantage if
people felt that the market wasn't providing enough in the way of
choice in that area.
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?

However, in most of those jobs you get paid properly at the time. Aside
from the 1% of musicians who are pop stars, musicians generally do not.
The article I read was in the paper edition of the newspaper in
question, but here's a fairly similar electronic version:

http://www.telegraph.co.uk/news/main...29/ixhome.html

I don't doubt that sessions musicians are paid badly, but multiplying
every musician's income by a certain factor doesn't necessarily
represent a just solution to that issue.
I'm not saying I agree with extending the copyright period, however I
do think you can't just compare it to 'a day at work'. It's a totally
different set of circumstances which requires a different set of rules
to both encourage artists to continue creating while benefitting
society in the long run too.
For some of those musicians (ie. probably not Sir Cliff Richard), it
probably was a day at work for which they were badly paid, whilst
others (eg. Sir Cliff Richard) went on to make quite a bit of money. Of
course, one can always argue that the result of this particular kind of
day at work is something that can be enjoyed again and again, but then
you should consider the issue of why the person working at the car
factory doesn't get paid royalties every time you turn the key in the
ignition (even if it's just $0.0001 each time).

Paul

Aug 14 '06 #43

P: n/a
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.
I think you increase your chances of Microsoft not even being in the same
room with your software 100-fold if you release it under.. say GPL.

--
damjan
Aug 14 '06 #44

P: n/a
On 2006-08-14 20:48:45, Damjan wrote:
I think you increase your chances of Microsoft not even being in the same
room with your software 100-fold if you release it under.. say GPL.
.... and have the money to run a law suit? Patents, licenses etc are only as
strong as the money that backs them, mostly.

Gerhard

Aug 15 '06 #45

P: n/a
Bayazee wrote:
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 ...?
Use Pyrex in order to build C-Modules from the critical parts of your
software.
>
---------------------------------------
First Iranian Open Source Community : www.python.ir
Interesting ... but you are not a member of this community. Right?

--Armin
Aug 15 '06 #46

P: n/a

Armin Steinhoff wrote:
Bayazee wrote:
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 ...?

Use Pyrex in order to build C-Modules from the critical parts of your
software.

---------------------------------------
First Iranian Open Source Community : www.python.ir

Interesting ... but you are not a member of this community. Right?

--Armin

Hi
thanx for your answers . i read all of your replys carefully ...
i am an open source Programmer ! i love to distribute my sources and
use other ideas ! but asking a question is't reason of using it ! i
want to find a way to hide python source codes ! can we do it ? how ?
but i dont want to use it ....
this is a question that i must be answer to a friend !

Aug 15 '06 #47

P: n/a
On 2006-08-15 05:40:31, Armin Steinhoff wrote:
>First Iranian Open Source Community : www.python.ir

Interesting ... but you are not a member of this community. Right?
You know how to read a thread, right? :)

Gerhard

Aug 15 '06 #48

P: n/a
Bayazee wrote:
>
Armin Steinhoff wrote:
>Bayazee wrote:
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 ...?

Use Pyrex in order to build C-Modules from the critical parts of your
software.
>
---------------------------------------
First Iranian Open Source Community : www.python.ir

Interesting ... but you are not a member of this community. Right?

--Armin


Hi
thanx for your answers . i read all of your replys carefully ...
i am an open source Programmer ! i love to distribute my sources and
use other ideas ! but asking a question is't reason of using it ! i
want to find a way to hide python source codes ! can we do it ? how ?
but i dont want to use it ....
this is a question that i must be answer to a friend !
Then the answer could be a question: can we hide any source/binary ?

Hardware tokens (ex: smart cards) are used just for that purpose. So as long
as you distribute a PC with your package and are certain it cannot be
tempered with (the correct O/S, administrative rights, encrypted
partitions .....) ... but I do not think there is such a PC out there.

You might want to read this:

http://www.commoncriteriaportal.org/
http://www.commoncriteriaportal.org/...troduction.pdf
http://en.wikipedia.org/wiki/Common_Criteria
Philippe



Aug 15 '06 #49

P: n/a
Gerhard Fiedler <ge*****@gmail.comwrote:
On 2006-08-14 20:48:45, Damjan wrote:
I think you increase your chances of Microsoft not even being in the same
room with your software 100-fold if you release it under.. say GPL.

... and have the money to run a law suit? Patents, licenses etc are only as
strong as the money that backs them, mostly.
I guess that's an advantage of GPL: there's a foundation (with much
better funding than you could raise as an individual) which will gladly
fight for GPL, both in the courts and in the arena of public opinion --
I believe that, so, far, they've won every single fight they've picked,
by just the joint threat of lawsuits and public shaming campaigns.

It just isn't worth Microsoft's while to take the public-relations hit
of such a fight: much cheaper for them to re-implement your ideas than
to copy your GPL'd code.
Alex
Aug 15 '06 #50

64 Replies

This discussion thread is closed

Replies have been disabled for this discussion.