Encryption

Is there a way to encrypt code on here, or on Xcode so that people with jail broken devices cannot view the code?

google for encrypt in the search box above

Nope.

I posted an encryption library on Codea Community pretty recently; it’s really simple but it works fine, and since it’s my own algorithm and not a well-known encryption, it might not be as easy to figure out.

@FLCode - unfortunately, as the encryption experts say, your own system is likely to be dead easy to crack. But as you say, your best protection is that the apps we write are lost in a sea of other apps, so nobody is likely to bother cracking them.

@YoloSwag - I wouldn’t be concerned about the code not being encrypted. Anyone copying your app is just going to copy what it does, and not care about the code. (Professional thieves could probably write better code than most of us, anyway). The app would have to be very, very complex before it was necessary to steal the actual source code.

If anyone is going to go through the trouble of stealing something, they’ll go after credit cards and bank accounts. They won’t waste their time on apps.

And if they know how to steal the code, they know enough to create their own version of it, anyway

I think it’s more likely that assets straight out of the .ipa file are more likely to be stolen, however having the raw lua from the Codea export available is a little annoying.

It’s a trivial task to take the code / assets out of the app package and then import them back into Codea ready to be exported again as a new app.

@Ignatz Apps are lucrative - something like Flappy Bird would reward the effort…

And let’s not forget that Angry Birds was written in Lua - it’s amazing the things you can find if you go poking around inside .ipa files :wink:

I’m hoping that when 2.1 is released (please god let it be soon) that lua encryption / compilation will be included.

Regarding updates would Codea be able to input in code access to other services, or parts of them, like iOS8 was designed for?

Not quite sure what your asking here, however once you’ve exported your app, there’s no reason why you couldn’t use add on’s or extensions to hook into whatever OS functionality you want, obviously your mileage will vary depending on what you want to do and what input / outputs you require, and in some cases Codea won’t probably be the best solution.

Example:

In an app (let us say Codea), there may be a link. Now, iOS8 enable us to open that link in a browser that pops up in the app itself, without actually going out to the actual safari app.

Oh - you mean an in app web view. Currently the openURL() function will open a browser window and not in app - however it should be fairly easy to include that as an addon. Although I don’t think that’s an iOS8 feature - I’d done that in Corona years ago.

Not just in Codea tho- in other apps you can even go and get mail without leaving the app, and reply to emails and messages (not sure 'bout this 1) in the notifications drawer.

Ah - I don’t know much about those features of the new OS - sorry :slight_smile:

@TechDojo There’s a second parameter to openURL() with an option to use an in-app browser, I don’t think it supports mail, though.

:slight_smile: And here’s another example where RTFM pay’s dividends :slight_smile:
To be fair I haven’t used this function yet so I can’t kick myself too much.

I think that using the mailto: or the tel: scheme will work as expected - opening mail and the phone (if present) respectively.

That said - having access to some kind of native popup (ala http://coronalabs.com/blog/2012/01/03/composing-email-and-sms-in-corona/) to be able to better integrate these things would be great

Hi Codeans, @YoloSwag, @TechDojo

I am encrypting the Lua code in our app as we have a large codebase and using iExplorer on a Mac allows you to immediately extract code and assets. There’s nothing we can do about the assets, any watermarking can easily be removed, but we don’t want our code lifted!

We use the lua compiler to compile our files to bytecode, then encrypt them, then decrypt them on the fly when the app starts. All code ends up in one encrypted file for 32-bit and one for 64-bit…

I can post details if anyone is interested, we use the RNCrypt library…

Brookesi

I’m certainly interested, I’m assuming your working with the source that’s been exported when you export an xcode project. I thought about running it through a source obfuscater but your solution is better.

As for iExplorer - you don’t even need that, just look in the mobile apps folder inside itunes as all your apps are stored there as .ipa files (which are just .zip files in disguise, as are android .apk’s)

This is not just a codea problem, it’s the same problem that 99% of other mobile (and web for that matter) games have, there’s never a 100% secure way to protect your assets, one thing I do wonder though…

I’m toying with the idea of a two pronged approach - 1. generating some of my assets at run time via code (I can code better than I draw :slight_smile: and it might allow me to neatly sidestep providing retina assets ) and 2. trying to aggregate all my assets on to a single large tpage to use a mesh based sprite sheet approach.

I wonder if this tpage image could be converted to C source and then included in the xcode project and then made visible to codea through a lua bridge then this might offer a higher degree of protection.