skip to Main Content

Software these days can be separated into two categories: runs on client infrastructure (like in the case of enterprise software, like Splunk or Tibco), OR runs on the infrastructure of a software provider (like in the case of Facebook, where you need to use their API to access the backend).

In the first category, the client pays for a license and receives the software to run on their own machines on their premises of choice. The client IS in possession of the actual code and software.

In the second category, the software resides somewhere external and can be accessed only by an API. The client is NOT in possession of the software and can only use it to the extent allowed by the API.

My question is: in the first category above, how is the actual code kept hidden from the client?

Let’s say I’ve built a really awesome analysis engine in Python for analyzing output logs. A corporate client is interested in using it for their internal applications. However, they insist that my engine must run on their own machines for security reasons. If I succumb and give them my Python code, then I will risk my intellectual property.

In that case, do I need to rewrite all my code into a compiled language like C++ to obfuscate it during compile time? Or is there a way to keep it in Python but secure the source code it in another way?

Update:
Given the answers below, in that case, would the more efficient pathway to developing a client-hosted application (i.e.: first category above) be to write a proof of concept in a more convenient language like Python first, and then take those ideas and rewrite it into C++?

2

Answers


  1. The short answer is that you pretty much can’t. You can do workarounds, but in the end almost anyone can reverse engineer your code no matter how you obfuscate it.

    Your best bet might be to use something like PyInstaller and see if you can only include .pyc files. That doesn’t protect you all the way, but it at least makes it a pain to reverse. You might even be able to find an obfuscater to run it first, but I don’t know much about that part.

    Login or Signup to reply.
  2. Similar to @gabeappleton’s suggestion above, compile the Python code into an EXE. I use cx_freeze quite regularly and have good success. It’s pretty well documented and reasonable support on these forums.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search