Encrypt python files

BartC bc at freeuk.com
Wed May 13 09:48:00 EDT 2015


On 08/05/2015 11:59, Denis McMahon wrote:
> On Wed, 06 May 2015 00:23:39 -0700, Palpandi wrote:

>> No, I just want to hide the scripts from others.

> As the decryption method is always available to anyone who has legitimate
> access to execute the code, it's impossible to hide the code at that
> point.

Execute yes, but not necessarily allow access to the source if that is 
the problem.

> Example - if I give you an encrypted binary to run on your system, it
> either has to be unencryptable using tools you already have, or using a
> built in unencrypter, both of which you have access to and can use to
> unencrypt the encrypted executable code.

It can certainly be made harder than simply distributing source code. By 
using a proprietary byte-code for example, or code designed to run on 
some virtual machine. The tools run execute it will need to be provided, 
but that's a long way from being able to reconstruct source code (and if 
that was achieved, you would likely end up with some source code that 
corresponds to the interpreter, not the application).

But it depends on what secrets the OP is trying to hide. Just proving 
.pyc files might be enough, and is minimal inconvenience to the user.

-- 
Bartc



More information about the Python-list mailing list