Domanda

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?

È stato utile?

Soluzione 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

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top