Protection on Lua script

I want to write object AI logic via Lua script. But having seen the sample HelloLua project as it perceived Lua as plain text, I do concern about the security might leak.

So are there any suggestion on protect Lua script files? Can we compile it into bytecode and use it normally (so my understand it would eliminate a need to encrypt the file).

You could encrypt the script (ex: base64) then instead of loading the text file, you read the string, decrypt it, then pass it to CCLuaEngine.

Hey thank you for your suggestion, it’s kinda handy approach, and I love that.