I’m developing a project in a client-server architecture. The client is a python 3.12 script that will run on customers desktops and the server is a Django 5.0.x application. I will distribute the client script after running pyinstaller -F script.py, so the package has approximately 40MB because of the virtual enviroment with python libs. So, I need to protect the client script to avoid people can read my code and copy my idea.
I was thinking in to create an auxiliary script so this auxiliary script and server will do these basic steps:
- Auxiliary script generates an RSA assymetric keypair
- Auxiliary script sends the public key to django application.
- Django application encrypts the main script with this public key and return a response with encrypted main script as response
- Auxiliary script downloads the encrypted main script and decrypt with private key
- Auxiliary script loads the unencrypted main script into the memory
- Finally, auxiliary script execute the main script.
The problem is, even I convert the auxiliary script to a binary by using pyinstaller, if someone do something and can read the auxiliary script code, so this person can edit the code and make the step 5) writes the main script to a file on disk, instead loading into memory.
So is there any solution for this?