blockchain/My-Wallet-iPhone — pull request #26 by Sjors (2014-08-07 18:35:04+00:00)
Title: Store guid and sharedKey in keychain.

Followup of #8. Secrets should not be stored in NSUserDefaults, but in the keychain.

I implemented the keychain for sharedKey. I assume that sharedKey is the secret, while guid is not a secret. I also added migration code to move existing guid and sharedKey values into the keychain and delete them from the NSUserDefaults.

You should probably repeat this process for pinKey, encryptedPINPassword and passwordPartHash. It's not entirely clear to me how they work and which are considered secret.

You can create multiple kSecAttrAccount properties on the App Delegate. Each KeychainItemWrapper can contain only one secret (kSecValueData). In addition it can contain something like a corresponding account name (kSecAttrAccount). I don't think the latter is encrypted, but I haven't checked.

Each KeychainItemWrapper needs an identifier (e.g. "Wallet") which I configured in `init`.