Pregunta

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?

¿Fue útil?

Solución 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

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top