traw1233
traw1233

Reputation: 1945

Where can I safely store passwords in Swift? Is CloudKit alright?

I am creating an app that uses accounts. What would be the best way to store the data(i.e. username, password, etc...)? I have already implemented CloudKit, so could I somehow store it there?

If I were to use Keychain Access, how would I then store information in the cloud based off of that account?

Upvotes: 0

Views: 1056

Answers (2)

Peter
Peter

Reputation: 793

To more safely store passwords you should store these in the keychain. Depending upon the settings the keychain is shared among differing iOS devices.

Upvotes: 1

Edwin Vermeer
Edwin Vermeer

Reputation: 13127

you should never store passwords unencrypted anywhere. When you do want to store passwords, then use a one way hash. that way you could see if a supplied password is valid by comparing the hashes, but there is no way to get hold of the original password.

I understand from your question that you want to store them on a central location? Then CloudKit could be an option. But if you only need it on the device itself, then store it in the keychain.

Upvotes: 0

Related Questions