Is it possible to encrypt the lua code?

Hello all!

Sorry if this is a bit of a newby question but:

I have just posted my first app to the store, but the app’s lua files are still visible in the app. Anybody who can access the iOS file system therefore can modify the source code. This for me usually would’t be a problem but I am soon planning to add game centre support to my app, and so would like to make the leaderboard the least “corrupted” (with people posting hacked scores") as possible. Therefore I was wondering if there is a way to encrypt the files, so that other people can not see them.

I am already aware of other posts concerning this matter, however since most are from more than 6 months ago I was wandering if anything in that time interval had been implemented into Codea that changed this.


Ps: I have already looked up obfuscation, but I can’t seem to find any good ones that are free and for Lua.

Don’t know if Codea will ever support compilation:

I have a method of encryption that I’m working on, but in order for it to work you would probably have to encrypt your code, take the output and put it in a multi-line string, and decode it in visible Lua. It would be a fair amount of work and would make changing the code a bit harder. But you could then decrypt the code and change the Lua. You would probably only want to encrypt it for an App Store release, not just testing. Anyways, it might be possible. But it would require a little bit of Lua code visible, at least a non-important part.

No easy way for encryption unless if you modify the Codea runtime, which is impossible.

Edit: I forgot to mention, another option is to download the program’s code from a website and run that code. But then your app wouldn’t work without internet, and someone might be able to find the URL that your code is at.

Thank you both very much! Your comments were both very useful :-bd

You could try implementing code signing: if I remember right, you hash your code, then sign that hash. I think that is basically what Apple does, so I don’t see why it wouldn’t work for you.