Encrypt python files

Dave Angel davea at davea.name
Fri May 8 08:13:57 EDT 2015


On 05/08/2015 06:59 AM, Denis McMahon wrote:
> On Wed, 06 May 2015 00:23:39 -0700, Palpandi wrote:
>
>> On Wednesday, May 6, 2015 at 12:07:13 PM UTC+5:30, Palpandi wrote:
>>> Hi,
>>>
>>> What are the ways to encrypt python files?
>>
>> No, I just want to hide the scripts from others.
>
> You can do that by deleting the scripts. Make sure you use a secure
> deletion tool.
>
> I'm not aware of any mechanism for encrypted executable python scripts.
> You can obfuscate the code, but you can't encrypt it because the python
> interpreter needs the script file to execute it.
>
> The same holds true for any mechanism designed to encrypt executable code
> regardless of whether it's script or compiled. At the lowest level the
> processor only understands the instruction set, and encrypted code has to
> be decrypted to execute.
>
> 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.
>
> Example - if I give you an encrypted binary to run on your system, it
> either has to be unencryptable

It'd be clearer if you used  decryptable, since unencryptable has a very 
different meaning.

http://en.wiktionary.org/wiki/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.
>

likewise decrypter and decrypt.

-- 
DaveA



More information about the Python-list mailing list