0

I wrote a project with many sub-sheets of python code. and need to run it on a p2p cloud-computing service because it needs performance. I dont want the 'host' to know what it is by trying to understand the variable names and function names.

Its about 1000s of variables and 100s of functions, so doing it via CTRL+r and then renaming gives a high risk of errors and takes a long time.

a) Is there a procedure in compiling to make the variable names (of a copy) unrecognizable? (e.g. ahjbeunicsnj instead of placeholder_1_for_xy_csv or kjbej() instead of save_csv())

or alternatively b) Is there a way to encrypt all the files and run it encrypted? (maybe .exe)

  • 2
    Duplicate of [Is there a way to run a script with 'unrecognizable' variablenames & funcitonnames?](https://stackoverflow.com/questions/65669440/is-there-a-way-to-run-a-script-with-unrecognizable-variablenames-funcitonnam) – Topaco Jan 11 '21 at 18:33

1 Answers1

0

Yes it's possible. You can obfuscate the Python script. Programs like PyInstaller can create executables too. You didn't indicate that you researched that but it's an option.

Here's the official page on this topic which goes into far more detail: https://wiki.python.org/moin/Asking%20for%20Help/How%20do%20you%20protect%20Python%20source%20code%3F

Here's an answer on another StackExchange that's also relevant: https://reverseengineering.stackexchange.com/questions/22648/best-way-to-protect-source-code-of-exe-program-running-on-python

Random Davis
  • 6,662
  • 4
  • 14
  • 24