2

I am developing an application which would include the download of a few files from the server the app talks to. So I am planning to store the downloaded files(Quiet sensitive) in aLibrary directory. Preferably I would create a subdirectory (marked as hidden) and store it under it. But this hidden subdirectory would be easily accessible on a jailbroken device.

Is there a way I can store it securely in the Library directory which will not be accessible on jailbroken device also?

Can we create and store files in a subdirectory which is password protected? How can we password protect a subdirectory or a file?

Thanks in advance

bobs
  • 21,844
  • 12
  • 67
  • 78
divya
  • 177
  • 2
  • 14
  • The problem with having anything encrypted is that you need to have a key embedded into your application (or use some not so easily-extractable device-specific data such as IMEI but less obvious). If you just embed the key into your application, it would be extracted easily. – Eugene Mayevski 'Callback Apr 03 '13 at 06:58

1 Answers1

4

One possible option to look into would be to store the files in Coredata as an NSData external record file and use some kind of NSValueTransformer that is responsible to encrypting and decrypting the file. This may be a more complex approach but would provide lots of flexibility to you.

A quick search for NSValueTransformer encrypt NSData yields some interesting results that might get you started.

Hope this helps!

Dan Fairaizl
  • 2,172
  • 2
  • 28
  • 31
  • Thanks for the suggession but is there a way I can set a password to access a file/Directory,while creating it itself? – divya Apr 03 '13 at 08:34
  • No unfortunately there is not due to the nature of how iOS sandboxes apps and their directory structure. Apple pretty much leaves it up the the developers to secure their data. – Dan Fairaizl Apr 03 '13 at 18:16
  • Thanks Dan.How to use external record in core data.Also can we use external record for files/images less than 1MB ?And where and which location are these files/images stored externally ? – divya Apr 09 '13 at 06:06