This question already has an answer here:
I have to provide a Python CLI-based program to one of my clients. I will give him both the compiled version (using py2exe or something simillar) of the application and the source code.
The application structure is the following:
- a cfg folder which holds some configuration files (the main
.pyparses these configs using
configparsermodule and processes the data inside them
- a log folder which will hold the logging files generated by the app
- in / out folders which will be used for input / output files
- a processed folder which will hold the input files that were used.
Now, the client will give the
.exe version of the app to some clients and he wants to make sure that the only person that will use the app will be the one he has handled it to.
Having said this, he asked for a way / hacky workaround of protecting the app in a way or another. He specified that he does not need a 100% way of protection (we all know that if there's a determined person in charge of this, he'll get around it anyways) but a decent one.
I know that Python, being a byte-code-compiled interpreted language, is very difficult to lock down. I'm not looking for a way to protect the code.I just need some kind of license key system embedded in my python code.
The question would be: how would you secure your Python CLI-based application?