Question

I have the paid content on my application on App Store. And I save it using the following code:

paidContentCount = [[NSUserDefaults standardUserDefaults] integerForKey:@"paidContentCount"];

But it's easy to hack it. How can I protect integer data from hacking?

Était-ce utile?

La solution 2

You can try saving your content as string with [NSString hash] method, and after your app is loaded, compare paid content's hashes with value from NSUserDefaults

UPDATE: forgot that [NSString hash] returns NSInteger

Autres conseils

Never store such settings in NSUserDefaults! Use an iOS Keychain for it. Here is the wrapper, which makes the biggest part of work.

Besides it, you can read this article from Ray Wenderlich - there are a lot of good ideas of basic security.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top