I have a script in .py format and random forest in pickle format and i should deliver it to a customer . He should not be able to read both.
Asked
Active
Viewed 712 times
-2
-
Note that all the answers provided in the linked answer will obfuscate the code, but even compiled code is a set of instructions for how to take the data and produce the desired output, so it can be reverse engineered. In short "locks only keep honest people out". If you are protecting trade secrets, this is inadequate. – mermaldad Nov 26 '19 at 16:22
-
The only truly secure way to do that is to provide it as a service on cloud - then they won't be able to read it for sure. – Nov 26 '19 at 16:33
1 Answers
0
If you really have to hide the code **, I recommend you to use an obfuscator
An example: https://wiki.python.org/moin/Pyarmor
PS: you have a similar question here: How to obfuscate Python code effectively?
Also, this is something I never did or explored, but through PYC-only distribution could be an alternative, but you must explore this by yourself. Find out more at https://www.curiousefficiency.org/posts/2011/04/benefits-and-limitations-of-pyc-only.html
*** I know obfuscating code is not nice, but sometimes companies require it :/

xCovelus
- 578
- 1
- 9
- 20
-
3The problem is that Python code will always remain de-obfuscable, and the source will be recoverable from those obfuscated files. Want a compiled language similar to Python, use Go. – Adirio Nov 26 '19 at 16:18
-
I know, but it depends on the skills of the user, although if the user can understand the code/pass to someone who will understand it, probably the obfuscation is not a big issue – xCovelus Nov 26 '19 at 16:21
-
1I am a beginner to python i would say and the code is not grown so complex yet but still i want to do it properly from the start. Thanks for your replies. I will go throught the links – Success Guru Nov 27 '19 at 05:11
-