How can I securely store passwords in xcode app?

I’m writing an app with Xcode using Applescript-ObjC. I’m wanting to put in some usernames and passwords to automatically check some remote servers. How can I put these login credentials in the app and securely store the code so no one could open the AppDelegate to see the credentials? (i.e. an “execute-only” app that you can’t read/change once built) Is this even possible?

thanks

Hi,

there are at least two options:

save the credentials in the keychain
save the credentials in a property list as hashes (using a secure encryption method like bcrypt)

For both options there are ObjC wrappers, maybe the OS X encryption framework is suitable, too

In Build Settings, search for OSACompile - Build Options,and change Save as Execute-Only to YES.

But that’s a secure way to store code, not passwords.

thanks Stefan and Shane. I’ll look into how to store them in the keychain. It will be good to learn this. Thanks again for your helpful and quick responses.