tags:

views:

113

answers:

2

I have to upload my django project to a shared hosting provider.

How can I encrypt my code?

I want to hide my code on the server.

Thanks :)

+11  A: 

You can't. You could upload .pyc files I suppose, but they are completely and utterly trivial to decompile.

Alex Gaynor
Indeed. If Python can read your code, then so can anyone who is moderately interested. If you can't trust someone with your code, don't let them run it; host a service instead.
jrockway
Exaclty: you can't obfuscate Python, or any other high-level language. A smart programmer would tell you what any C compiler would spit out does -- just read the assembly. So unless you want to write self-modifying x86 machine code, find a way without modifying.
pavpanchekha
+4  A: 

Who are you trying to conceal it from? If it's other users on the shared system, then make sure you have directory permissions properly restricted to your user. If it's the shared hosting provider itself, then there's not much you can do since obfuscation won't buy you all that much; spend some time to find a reputable hosting provider you can trust.

ars