Line by Line Debug Python Scripts In GDB

2015-09-22 Thread Jondy Zhao
There is a gdb extension "libpython.py" within Python sources, it could print 
Python frame, locals/globals variable, Python sources in GDB. But it couldn't 
set breakpoints in Python scripts directly. Finally, I decided to write a 
debugger to extend GDB could debug Python scripts line by line, just like 
debugging c/c++.

This project is published in github, https://jondy.github.io/pyddd

The purpose of this project is to debug Python scripts line by line as debug 
C/C++ in GDB, so that we can easily debug Python scripts and C/C++ extensions 
within GDB.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-09-18 Thread Jondy Zhao
On Friday, September 18, 2015 at 11:06:25 AM UTC+8, Ben Finney wrote:
> Jondy Zhao <jondy.z...@gmail.com> writes:
> 
> > For example, I develop a game by python. What I want to do is that the
> > player or the agent could not simply copy the game to others. For the
> > player or the agent, they needn't research the game.
> 
> Deciding for the customer what they may not do, on their own computer,
> is quite hostile. Please don't enable such restrictions.
> 

This is only one possible way to distribute encrypted scripts. As I thought the 
user of Pyarmor would be the producer of commercial software, so they could 
bind their license file to netcard, harddisk, cpu, etc.

> -- 
>  \   "We must find our way to a time when faith, without evidence, |
>   `\disgraces anyone who would claim it." --Sam Harris, _The End of |
> _o__) Faith_, 2004 |
> Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-09-18 Thread Jondy Zhao
On Friday, September 18, 2015 at 4:08:57 PM UTC+8, alister wrote:
> On Thu, 17 Sep 2015 22:38:32 -0700, Jondy Zhao wrote:
> 
> > On Friday, September 18, 2015 at 1:02:09 PM UTC+8, Chris Angelico wrote:
> >> On Fri, Sep 18, 2015 at 12:40 PM, Jondy Zhao <jondy.z...@gmail.com>
> >> wrote:
> >> > The loader only can see the compiled scripts as ast nodes, even if
> >> > the load some tools could dump the separated ast node to bytecode and
> >> > de-compile it, think of one script is divided into thousands of
> >> > pieces, it's not easy to assemble them again.
> >> >
> >> > The final solution is to distribute the loader with encrypted
> >> > scripts, only my own loader can run the encrypted scripts.
> >> 
> >> So anyone who's going to run your program needs your loader. If someone
> >> wants to redistribute your code, s/he can simply distribute the loader
> >> as well - and you're right back where you started. You have still
> >> achieved nothing in terms of preventing redistribution.
> >> 
> >> Please do not do this. Not only are you not achieving the goal you
> >> think you are, you're making a mess for people to have to deal with.
> >> 
> >> ChrisA
> > 
> > But the loader and the encrypted scripts could be bind to one fixed
> > computer when I distribute them to end users, so the end users can't
> > redistribute them to any other machines. Actually this is what some
> > commercial software does.
> 
> Making life difficult for legitimate users whilst causing Pirates minor 
> difficulties at best (crack once distribute many)..
> 
> Copyright legislation is what provides you with protection if you need it
> 
> Commercial users do not risk running unlicensed software because of the 
> damage a piracy case against them would cause to their business, not 
> because they cant get it!

I agree with you absolutely. Maybe I can show you the purpose of Pyarmor by the 
following case:

When we express a box, we can close this box with a lock, this equals encrypted 
scripts, or we just close the box without a lock. Pyarmor is just as this lock, 
it make the box more security, but it can not protect the box completely.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-09-18 Thread Jondy Zhao
On Friday, September 18, 2015 at 6:06:51 PM UTC+8, alister wrote:
> On Fri, 18 Sep 2015 01:31:50 -0700, Jondy Zhao wrote:
> 
> > On Friday, September 18, 2015 at 4:08:57 PM UTC+8, alister wrote:
> >> On Thu, 17 Sep 2015 22:38:32 -0700, Jondy Zhao wrote:
> >> 
> >> > On Friday, September 18, 2015 at 1:02:09 PM UTC+8, Chris Angelico
> >> > wrote:
> >> >> On Fri, Sep 18, 2015 at 12:40 PM, Jondy Zhao <jondy.z...@gmail.com>
> >> >> wrote:
> >> >> > The loader only can see the compiled scripts as ast nodes, even if
> >> >> > the load some tools could dump the separated ast node to bytecode
> >> >> > and de-compile it, think of one script is divided into thousands
> >> >> > of pieces, it's not easy to assemble them again.
> >> >> >
> >> >> > The final solution is to distribute the loader with encrypted
> >> >> > scripts, only my own loader can run the encrypted scripts.
> >> >> 
> >> >> So anyone who's going to run your program needs your loader. If
> >> >> someone wants to redistribute your code, s/he can simply distribute
> >> >> the loader as well - and you're right back where you started. You
> >> >> have still achieved nothing in terms of preventing redistribution.
> >> >> 
> >> >> Please do not do this. Not only are you not achieving the goal you
> >> >> think you are, you're making a mess for people to have to deal with.
> >> >> 
> >> >> ChrisA
> >> > 
> >> > But the loader and the encrypted scripts could be bind to one fixed
> >> > computer when I distribute them to end users, so the end users can't
> >> > redistribute them to any other machines. Actually this is what some
> >> > commercial software does.
> >> 
> >> Making life difficult for legitimate users whilst causing Pirates minor
> >> difficulties at best (crack once distribute many)..
> >> 
> >> Copyright legislation is what provides you with protection if you need
> >> it
> >> 
> >> Commercial users do not risk running unlicensed software because of the
> >> damage a piracy case against them would cause to their business, not
> >> because they cant get it!
> > 
> > I agree with you absolutely. Maybe I can show you the purpose of Pyarmor
> > by the following case:
> > 
> > When we express a box, we can close this box with a lock, this equals
> > encrypted scripts, or we just close the box without a lock. Pyarmor is
> > just as this lock, it make the box more security, but it can not protect
> > the box completely.
> 
> And if the person at the other end looses the key it causes a great deal 
> of trouble.
> 
> Alternatively the highway man that holds up the delivery truck simply 
> takes a pair of bolt cutters to the lock...
> 
> yes it stops a casual snooper but that is all
> 
> 
In reality, when we leave the house, we lock the door, even the lock could not 
make sure the safe of our property. It's just make it difficult. It's same in 
the software world. Someone need the lock in both of the world. 

And if the highway man need leave the trunk for many days, whether they lock 
the truck or ask someone to take care of it or not.

> 
> 
> -- 
> A statesman is a politician who's been dead 10 or 15 years.
>   -- Harry S. Truman

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-09-18 Thread Jondy Zhao
On Friday, September 18, 2015 at 9:08:27 PM UTC+8, Lorenzo Sutton wrote:
> On 18/09/2015 13:41, Jondy Zhao wrote:
> [...]
> > In reality, when we leave the house, we lock the door, even the lock could
> > not make sure the safe of our property. It's just make it difficult.
> > It's same in the software world. Someone need the lock in both of the world.
> 
> I think you meant "in the *proprietary* software world".
> 

Exactly.

> This discussion on the topic, and in particular this answer, on 
> Stackoverflow are quite inspiring:
> 
> http://stackoverflow.com/questions/261638/how-do-i-protect-python-code/261727#261727
> 
> Lorenzo.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-09-18 Thread Jondy Zhao
On Friday, September 18, 2015 at 3:27:28 PM UTC+8, Chris Angelico wrote:
> On Fri, Sep 18, 2015 at 3:55 PM, Jondy Zhao <jondy.z...@gmail.com> wrote:
> > On Friday, September 18, 2015 at 11:06:25 AM UTC+8, Ben Finney wrote:
> >> Jondy Zhao <jondy.z...@gmail.com> writes:
> >>
> >> > For example, I develop a game by python. What I want to do is that the
> >> > player or the agent could not simply copy the game to others. For the
> >> > player or the agent, they needn't research the game.
> >>
> >> Deciding for the customer what they may not do, on their own computer,
> >> is quite hostile. Please don't enable such restrictions.
> >>
> >
> > This is only one possible way to distribute encrypted scripts. As I thought 
> > the user of Pyarmor would be the producer of commercial software, so they 
> > could bind their license file to netcard, harddisk, cpu, etc.
> >
> 
> Great. Please put a big warning notice on your application:
> 
> ATTENTION ALL USERS
> The author of this program believes that he controls your usage of it,
> to the extent that a legitimately-purchased copy will refuse to run if
> you upgrade your computer's hardware.
> It is therefore recommended that you pirate this program as per XKCD 488.
> If you don't like this, don't use the program.
> 
> 
> At least then you'll be being honest.
> 

I know you hate it. But I have purchased some commercial software in this way 
before, a tool named ERWIN used to create relation database. The license I got 
from software provider is bind to the network card of my PC. I can't use this 
tool in any other machine. This is true case.

The world is wide, maybe it's better to be tolerant of all things.

> ChrisA

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-09-17 Thread Jondy Zhao
On Tuesday, September 15, 2015 at 5:36:52 PM UTC+8, Ben Finney wrote:
> Jondy Zhao <jondy.z...@gmail.com> writes:
> 
> > Pyarmor is a simple to use tool which is capable of importing or
> > running encrypted Python script files. Moreover, it can apply encoding
> > algorithms to your Python scripts, in order to help you protect them
> > before you can distribute them. You may also generate license files
> > with custom validity conditions.
> 
> Protect them from whom? What is the threat model against which Pyarmor
> is claimed to protect? Who is the attacker, who is being protected?
> 
> > The program allows you to encrypt files, but to also open and run them
> > as if no protection was applied. Moreover, it can run or import
> > encrypted Python scripts in any target machine, only in specified
> > machines or before a specified date. This aspect can be controlled by
> > the creation of the license files: bound to a hard disk serial number
> > or by an expiration date.
> 
> So a Python file encrypted this way will be arbitrarily restricted in
> how it can be inspected for debugging, performance monitoring, and
> testing?
> 
> This seems to explicitly treat the user of the Python software as a
> hostile attacker. That is not a friendly or respectful position, and I
> hope I misunderstand Pyarmor's operation.
> 
> -- 
>  \   "Any fool can write code that a computer can understand. Good |
>   `\   programmers write code that humans can understand." --Martin |
> _o__)  Fowler, _Refactoring_, 2000 |
> Ben Finney

Think that python developer is manufacturer, and he want to sell his product to 
the customers who don't know anything about programming. He don't hope his 
customers redistribute his product, that's protected by Pyarmor.



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-09-17 Thread Jondy Zhao
On Tuesday, September 15, 2015 at 5:49:15 PM UTC+8, Chris Angelico wrote:
> On Tue, Sep 15, 2015 at 7:21 PM, Jondy Zhao <jondy.z...@gmail.com> wrote:
> > Pyarmor is dedicated to users who create their applications, components, 
> > scripts or any file with the help of the Python programming language. You 
> > may use this application to encrypt the files, in order to protect their 
> > content and your intellectual property, by encoding the scripts.
> >
> >
> > The program allows you to encrypt files, but to also open and run them as 
> > if no protection was applied.
> 
> If they can be run as if no protection had been applied, that
> presumably means the loader is capable of decrypting them, right? So
> what's to stop anyone from reading the loader, using it to decrypt the
> actual code, and running it?
> 
> ChrisA

The loader only can see the compiled scripts as ast nodes, even if the load 
some tools could dump the separated ast node to bytecode and de-compile it, 
think of one script is divided into thousands of pieces, it's not easy to 
assemble them again.

The final solution is to distribute the loader with encrypted scripts, only my 
own loader can run the encrypted scripts.
Besides,
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-09-17 Thread Jondy Zhao
On Friday, September 18, 2015 at 10:06:30 AM UTC+8, Chris Angelico wrote:
> On Fri, Sep 18, 2015 at 11:58 AM, Jondy Zhao <jondy.z...@gmail.com> wrote:
> > Think that python developer is manufacturer, and he want to sell his 
> > product to the customers who don't know anything about programming. He 
> > don't hope his customers redistribute his product, that's protected by 
> > Pyarmor.
> >
> 
> The trouble with that thinking is that they _can_ redistribute his
> product. In fact, PyArmor isn't going to do anything about that. It
> might make it harder for them to reverse engineer that product, but it
> does nothing whatsoever for redistribution.
> 
> ChrisA

The encrypted scripts could be distributed to bind to hard disk of computer, so 
the customers could not simplely copy them to somewhere else. Except they could 
reverse all the bytecodes, and pyarmor does make it harder to reverse bytecode 
to source. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-09-17 Thread Jondy Zhao
On Friday, September 18, 2015 at 10:27:35 AM UTC+8, Ben Finney wrote:
> Jondy Zhao <jondy.z...@gmail.com> writes:
> 
> > Think that python developer is manufacturer, and he want to sell his
> > product to the customers who don't know anything about programming.
> 
> Are you also assuming those customers have no-one they can talk with who
> knows programming?
> 
> > He don't hope his customers redistribute his product, that's protected
> > by Pyarmor.
> 
> Pyarmor is not going to stop them redistributing anything. If they're
> motivated to redistribute the code, this won't stop them. If they're
> motivated to examine what the code does, this will increase the effort
> but not stop them.
> 
> At best, it will annoy customers who want to get someone's help in
> debugging the product. That sounds like an anti-feature.
> 
> -- 
>  \ "This world in arms is not spending money alone. It is spending |
>   `\  the sweat of its laborers, the genius of its scientists, the |
> _o__)   hopes of its children." --Dwight Eisenhower, 1953-04-16 |
> Ben Finney

For example, I develop a game by python. What I want to do is that the player 
or the agent could not simply copy the game to others. For the player or the 
agent, they needn't research the game. That's cases concerned by PyArmor.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-09-17 Thread Jondy Zhao
On Friday, September 18, 2015 at 1:02:09 PM UTC+8, Chris Angelico wrote:
> On Fri, Sep 18, 2015 at 12:40 PM, Jondy Zhao <jondy.z...@gmail.com> wrote:
> > The loader only can see the compiled scripts as ast nodes, even if the load 
> > some tools could dump the separated ast node to bytecode and de-compile it, 
> > think of one script is divided into thousands of pieces, it's not easy to 
> > assemble them again.
> >
> > The final solution is to distribute the loader with encrypted scripts, only 
> > my own loader can run the encrypted scripts.
> 
> So anyone who's going to run your program needs your loader. If
> someone wants to redistribute your code, s/he can simply distribute
> the loader as well - and you're right back where you started. You have
> still achieved nothing in terms of preventing redistribution.
> 
> Please do not do this. Not only are you not achieving the goal you
> think you are, you're making a mess for people to have to deal with.
> 
> ChrisA

But the loader and the encrypted scripts could be bind to one fixed computer 
when I distribute them to end users, so the end users can't redistribute them 
to any other machines. Actually this is what some commercial software does.
-- 
https://mail.python.org/mailman/listinfo/python-list


Pyarmor, guard your python scripts

2015-09-15 Thread Jondy Zhao
Pyarmor is a simple to use tool which is capable of importing or running 
encrypted Python script files. Moreover, it can apply encoding algorithms to 
your Python scripts, in order to help you protect them before you can 
distribute them. You may also generate license files with custom validity 
conditions.

Python protector application

Pyarmor is dedicated to users who create their applications, components, 
scripts or any file with the help of the Python programming language. You may 
use this application to encrypt the files, in order to protect their content 
and your intellectual property, by encoding the scripts.

Pyarmor uses two alternative methods of applying protection: converting the 
Python script file to an encrypted type of item, with the .PYX extension. 
Otherwise, you may add specific files to the script and distribute it as a 
package: the program can create and attach license files, with various validity 
terms.

Change the shape, not the content

While Pyarmor can modify the package in which the Python script is distributed, 
it hardly applies any modifications to the script itself. In fact, the program 
is not a script editor and does not allow you to make changes within the files.

The program allows you to encrypt files, but to also open and run them as if no 
protection was applied. Moreover, it can run or import encrypted Python scripts 
in any target machine, only in specified machines or before a specified date. 
This aspect can be controlled by the creation of the license files: bound to a 
hard disk serial number or by an expiration date.

Simple to use application

Pyarmor comes as a wizard, which can guide you through all the steps of the 
process, for your convenience. The steps are not restricted by certain 
requirements, so you may easily skip either of them and customize the process. 
Moreover, the program allows you to save the files at any location on your 
computer.

For more information, search pyarmor in pypi.
-- 
https://mail.python.org/mailman/listinfo/python-list


A package could import/run encrypted python scripts

2014-11-04 Thread Jondy Zhao
Hello everyone,

I'm glad to announce a python package: pyarmor.

PA HREF=http://dashingsoft.com/products/pyarmor.html;Pyarmor
1.7.3/A - A python package could import/run encrypted python
scripts. (03-11-14)

Some python developer may be not want to distribute the literal
python scripts to his customer or other people. So they can use
Pyarmor to encrypt python scripts and run/import encrypted python
scripts.

Pyarmor is published under Shareware license.
author:   jondy.z...@gmail.com

-- 
Regards
Jondy
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/