开发者

Compiling script files Lua or Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
开发者_开发问答

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 3 years ago.

Improve this question

I will separate my business code into a script language. it would be Lua or Python. My question is my business code written in script file is viewable by others. Because of script file will not compiled that is open. Anyone can see it.

How can I hide it? I think if I use Python, it would be compiled (.pyo), but Lua looks like more suitable for me.


You can compile Lua scripts with luac:

luac -s -o yourscript.luc yourscript.lua

Using the flag -s will also remove debugging information, thus making it also a little bit smaller.


You will not be able to hide this easily. You can encrypt and decipher on the fly. The problem is that people will be able to look at you're process memory and see the code clear as day. If you want to prevent people from changing the lua you can create a hash which the text file is checked against on each run.


(For Lua)

Depends on how safe it should be. For keeping out dumb edits you can just change the extension, and configure the path to recognize it anyhow.

For keeping out people who know how to change extensions, you can ship files compiled with luac. For deciphering that you already have to put considerable effort in it.

But to be really save I guess the only way is to encrypt/sign the code, and perhaps modify the core such that it'll only run files who's signature checks out to be OK, or which can be decrypted.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜