Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #105009

Re: Obfuscating Python code

From Daniel Wilcox <dmw@yubasolutions.com>
Newsgroups comp.lang.python
Subject Re: Obfuscating Python code
Date 2016-03-15 23:40 -0700
Message-ID <mailman.196.1458129721.12893.python-list@python.org> (permalink)
References <570f76f8-1e4a-421f-b1ff-4fba72f06a56@googlegroups.com> <mailman.155.1458020722.12893.python-list@python.org> <6849887.F7PvubJjsv@PointedEars.de> <mailman.167.1458073875.12893.python-list@python.org> <1577402.lMk4FsjPMl@PointedEars.de>

Show all headers | View raw


If you really want to learn about obfuscating python bytecode so it can't
be reverse engineered (easily) -- there are people who are doing it.
Search for 'pyasm' on github as a starting point.  tldr; yes people are
patching .pyc files. yes you can make them a nightmare to disassemble. and
yes it slows down your code.

=D

also yes, you can be tricked into running a patched .pyc file that has
nothing to do with your .py file, you have been warned.  be careful out
there.

On Tue, Mar 15, 2016 at 2:51 PM, Thomas 'PointedEars' Lahn <
PointedEars@web.de> wrote:

> Chris Angelico wrote:
>
> > On Wed, Mar 16, 2016 at 5:59 AM, Thomas 'PointedEars' Lahn
> > <PointedEars@web.de> wrote:
> >> That said, not distributing the source code of a program as well (or at
> >> least making it available to users in some way) strikes me as unpythonic
> >> since Python is at least Open Source software, and Python 2.0.1, 2.1.1
> >> and newer are GPL-compatible Free Software.
> >
> > gcc is also free software. Does that mean that all C programs should
> > be free software? No.
>
> IMNSHO, yes.  At the very least because in using gcc you benefited from the
> free software community, so you should give back to the free software
> community accordingly.
>
> > However, since all software can be reverse-compiled (particularly
>
> You mean _decompiled_.
>
> > byte-code like .pyc files),
>
> Yes, it is easier with bytecode *if you know the VM*.
>
> > the only truly reliable way to make completely closed software is to
> > restrict access to it in all forms.
>
> ACK.
>
> > In today's world, that usually means providing it as a web service.
>
> ACK.  That’s why RMS calls it SaaSS, Service as a Software Substitute :)
>
> > Otherwise, you have to assume that anyone can see your source. The
> > only difference between open-source and closed-source is the license,
> > not the ability to see stuff.
>
> If that were the case and reverse engineering were an easy task that
> everyone could do, we would have a lot more free software variants of
> proprietary software.  Particularly, we would have a lot less proprietary
> device drivers.  ISTM that you do not know what you are talking about here.
>
> --
> PointedEars
>
> Twitter: @PointedEars2
> Please do not cc me. / Bitte keine Kopien per E-Mail.
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Is there a way to create a shared object file using PyInstaller? Swanand Pashankar <swanand.pashankar@gmail.com> - 2016-03-14 22:35 -0700
  Obfuscating Python code (was: Is there a way to create a shared object file using PyInstaller?) Ben Finney <ben+python@benfinney.id.au> - 2016-03-15 16:45 +1100
    Re: Obfuscating Python code Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-03-15 19:59 +0100
      Re: Obfuscating Python code Chris Angelico <rosuav@gmail.com> - 2016-03-16 07:31 +1100
        Re: Obfuscating Python code Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-03-15 22:51 +0100
          Re: Obfuscating Python code Daniel Wilcox <dmw@yubasolutions.com> - 2016-03-15 23:40 -0700
      Re: Obfuscating Python code Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-03-16 18:04 +1100
        Re: Obfuscating Python code Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-03-16 07:55 -0400

csiph-web