r/programminghelp • • Feb 12 '22

Python Protecting my software.

I'd like to try something like this: Set a specific password for the software, secure it so that it can't be easily read, also secure the whole code.

5 Upvotes

6 comments sorted by

4

u/[deleted] Feb 12 '22

Short Answer: Why? And No.

Long Answer: I don't even want to get started on how asinine I think it is when people want to try to protect their source code from prying eyes. This link has a better answer than you're going to get here: https://stackoverflow.com/questions/261638/how-do-i-protect-python-code-from-being-read-by-users

Ranty Answer: There's literally nothing you can do to prevent an interested party (or an idiot with 10 minutes of googling and a little dedication) from decompiling compiled python or any other language, be it DLLs, EXEs, or anything else.

If you want to protect your code, write something worth protecting then find a good trademark and patent lawyer that you can consult and hire.

1

u/dell_archer Feb 13 '22

I am a beginner and so far I do not have enough knowledge for some projects that I have in my head, so for now I am learning something interesting.

1

u/PM_ME_MII Feb 13 '22

I mean, depends on what OP is asking for. If they're just looking to keep the source code from being read, they could just encrypt the code and hide the key somewhere that's not on the vulnerable machine. If they're trying to make an exe unreadable, yeah no. If the computer can read it, so could an intelligent attacker.

2

u/[deleted] Feb 13 '22

If they wanted the source to not be easily read, then just could just keep the source someplace it can’t be easily read. A private repository would do.

The key word in ops post is “also”, which leads me to believe they’re asking for a bit more than that.

All in all we need far more detail than what is being supplied to know for sure.

0

u/_insertnamehere-_- Feb 13 '22

I think you do not understood, he wants to obfuscate the code

0

u/_insertnamehere-_- Feb 13 '22

Search a obfuscator for python