Ticket #365 (enhancement)

Opened 2 years ago

Last modified 2 years ago

Code protection

Status: closed (fixed)

Reported by: pspuser Assigned to: fraca7
Priority: minor Component: PythonCore
Version: current Keywords: code protection
Cc:

I there Is there a way to protect code and/or saved games with PSP python? If not, do you plan do implement such a function? Would be nice. Thanks Hooker

Change History

04/01/07 13:32:49: Modified by fraca7

  • status changed from new to assigned.

Er, what do you mean by 'protect' ?

04/04/07 01:35:33: Modified by pspuser

Hello again I heard that Lua supports code protection. Its a way to "hide" code, so its not visible (not pure Python code) when checking it. Like it looks compiled (confusing strings mixed with numbers). It would be also nice if there is such an option for saved games, so people cant obviously see the code/saved data strings (not in a simple readable form). Hooker

04/22/07 10:46:29: Modified by fraca7

  • status changed from assigned to closed.
  • resolution set to fixed.

There is no real way to obfuscate Python code, any determined guy with some knowledge of Python can get the source from a .pyc or .pyo file. It's tougher than just opening a .py file though; so maybe this solution will be good enough for you: place all your code in modules rather than script.py, so that script.py is reduced to something like

import mygame
mygame.main()

Then launch it, make sure all .pyc files have been generated, and delete all *.py files except script.py. It should work but I didn't test it :)

As for protecting game data, there is no standard encryption module in Python but I may include a DES module at some time. I'll open a ticket for that but it's not really high-priority.