Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe12.ams2.POSTED!00000000!not-for-mail Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Newsgroups: comp.lang.python Subject: Re: obviscating python code for distribution References: <4DD08620.4030507@tysdomain.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Rhodri James" Message-ID: User-Agent: Opera Mail/11.10 (Linux) Lines: 28 NNTP-Posting-Host: 82.8.62.87 X-Complaints-To: http://netreport.virginmedia.com X-Trace: newsfe12.ams2 1305585762 82.8.62.87 (Mon, 16 May 2011 22:42:42 UTC) NNTP-Posting-Date: Mon, 16 May 2011 22:42:42 UTC Organization: virginmedia.com Date: Mon, 16 May 2011 23:42:40 +0100 Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5536 On Mon, 16 May 2011 03:21:00 +0100, Daniel Kluev wrote: > On Mon, May 16, 2011 at 1:04 PM, Littlefield, Tyler > wrote: >> Hello all: >> Finally, is there a good way to accomplish this? I know that I can make >> .pyc >> files, but those can be disassembled very very easily with the >> disassembler >> and shipping these still means that the person needs the modules that >> are >> used. Is there another way to go about this? > > No, there is no way to prevent users from getting access to raw python > sources. By its nature and design, python is not meant to be used this > way, and even obfuscation would not harm readability much. > However, you can write all parts you want to hide in C/C++/Cython and > distribute them as .so/.dll ...which is, of course, not exactly secure either. A sufficiently determined hacker won't have much trouble disassembling a shared library even if you do strip out all the debug information. By chance I'm having to do something closely related to this at work just at the moment; it's hard, but far from impossible. -- Rhodri James *-* Wildebeest Herder to the Masses