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?

Was it helpful?

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top