Search code examples
objective-ctrial

How do I store data securely with objective C? (Mac/Cocoa Dev)


I'm trying to create a Trial part of my cocoa application. I have the licensing all set up (including keys) etc.

But I was wondering how I could store e.g the first the time the user ran the program in a secure place, where the user can't easily find it and/or edit it.

I was having a fiddle with NSUserDefaults standardUserDefaults, but the user can easily find and edit that data in Library > Preferences.


Solution

  • I'd argue against making it super-secure. We once had a server activation but completely went away from it. Here are some of the reasons:

    • Even the most "secure" storage method can be broken
    • Even for a niche product a crack might be developed, no way around, no matter how secure your method
    • There are few, very expensive, very secure methods. All others have been cracked
    • It goes against fair and honest users, making it harder for them to fix things causing problems
    • If a user does crack your software or circumvents your security, he'll probably also never have bought it
    • 80% of the users don't even know what a preference file is
    • 95% of all users don't think of the possibility to delete it in order to extend the trial
    • A simple way to reset trial periods massively eases your support for users you want to give a second trial for whatever reason
    • Trusting users is a good selling point
    • Power users tend to turn against software with too much protection

    I'm pretty sure that there are some, but extremely few, exceptions from these thoughts. I'd say: don't waste your time on registration security but give