0

I'm working on an app that will have in-app purchases that grant access to a text file already in the app bundle.

How do you encrypt the file before putting it in the app? And how do you decrypt it with Swift?

I've seen a few articles in SO about the decryption part, but they don't really say how to encrypt them to begin with.

coopersita
  • 5,011
  • 3
  • 27
  • 48
  • See http://stackoverflow.com/questions/6315255/how-to-encrypt-bundled-text-json-files – rmaddy May 29 '15 at 16:06
  • But how do you encrypt the file in the first place? – coopersita May 29 '15 at 16:09
  • Use that code to encrypt your file. You could create a little helper app that encrypts a file. Then you include the encrypted file in your iOS app. – rmaddy May 29 '15 at 16:11
  • Who are you trying to protect the file against? Anyone interested enough will be able to decrypt it if you take this approach... – Wain May 29 '15 at 16:37
  • @Wain I know that someone interested enough will be able to do it, but I want to make it at least a bit harder. – coopersita May 29 '15 at 16:38
  • @rmaddy I'll give it a try, but it seems that that library is not very easily incorporated into Swift projects. Thanks. – coopersita May 29 '15 at 16:39
  • Here is a Swift Version of AES encryption in this [SO Answer](http://stackoverflow.com/a/25755864/451475) – zaph May 29 '15 at 17:02

0 Answers0