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.
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.
发布评论
评论(3)
您可以使用
luac
编译 Lua 脚本:使用标志 < code>-s 还将删除调试信息,从而使其也更小一些。
You can compile Lua scripts with
luac
:Using the flag
-s
will also remove debugging information, thus making it also a little bit smaller.您将无法轻易隐藏这一点。您可以即时加密和解密。问题是人们将能够查看您的进程内存并清楚地看到代码。如果你想阻止人们更改 lua,你可以创建一个哈希值,在每次运行时都会检查文本文件。
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.
(对于 Lua)
取决于它的安全程度。为了防止愚蠢的编辑,您只需更改扩展名,并配置路径以无论如何识别它。
为了阻止那些知道如何更改扩展名的人,您可以发送使用 luac 编译的文件。为了破译你已经必须付出相当大的努力。
但要真正节省,我想唯一的方法是加密/签名代码,也许修改核心,使其只运行签名检查正常或可以解密的文件。
(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.