0

I need to store information on application that always need to be read when open application. But I don't want user copy/dump/or edit it. So the question is : "Is UIPasteboard can solve this problem?" is it security? and if not, what else is suitable to use.

Thank you very much.

Edit: Is there have other solution that can solve "delete and reinstall application?"

majorl3oat
  • 4,327
  • 1
  • 18
  • 21

2 Answers2

0

UIPasteboard can be overwritten at any time, and I wouldn't call it secure.

You might want to consider encrypting and serializing the data. Then when you need to access it, decrypt it and read it into memory.

mergesort
  • 672
  • 4
  • 10
  • Thanks you very much for very fast answer. But I don't quite clear what your mean? after encrypted, where to save it? what is "read it into memory" mean? I'm sorry that I'm a newbie for this objective-c did you have any example? Thanks. – majorl3oat Jun 06 '12 at 03:50
  • Read into memory means that you would take the contents of the file and put it into an object, like an NSString. Since you don't want them to edit it, you have to save it to a file, but one that is not readable to the user, hence the encryption. You would save it to the file system, in one of the folders you can write to (such as Documents) – mergesort Jun 06 '12 at 18:52
  • OK, Thanks but i think i might use other solution for this. may be a keychain that was protect by sandbox. thanks you for information – majorl3oat Jun 07 '12 at 03:52
0

The use of pasteboard does not seem the right direction for your problem. You should more likely communicate with a server and use the method identifierForVendor from UIDevice.

But if you are sure a pasteboard is what you need, look at the concept of named pasteboards. In your context, the following method seems appropriate: + (UIPasteboard *)pasteboardWithUniqueName // An application pasteboard object with a unique name.

Note that by default, this kind of pasteboard exists only until the app is open. Look at the persistent property if you want to change this behavior.

Maybe (not tested), the system keeps it even if you delete / reinstall the app.

Guillaume
  • 21,685
  • 6
  • 63
  • 95