0

I am using a SQLite database to build an iOS app. Which is the best way to store username and password: in the database or the Keychain? Also, if I store any data in database how can I make it secure like the keychain?

jscs
  • 63,694
  • 13
  • 151
  • 195
Alex
  • 15
  • 1
  • 5
  • use keychain, otherwise encrypt the username and password then store it to localdb like AES encryption. Please use COREDATA for the alteration of SQLite – S. Karthik Mar 04 '16 at 17:51
  • You can check you answer from this link http://stackoverflow.com/questions/6972092/ios-how-to-store-username-password-within-an-app?rq=1 – iParesh Mar 04 '16 at 17:54
  • you are welcome friend/// – S. Karthik Mar 04 '16 at 17:57

2 Answers2

2

Keychain is better. However, we recommend that you don't save the password. You should always save the hash value and compare the hashes to see if the login is correct!

Ruchira Randana
  • 4,021
  • 1
  • 27
  • 24
0

Keychain is the best option to save any kind of passwords. Use library SSKeychain which is a light weight wrapper for keychain.

BangOperator
  • 4,377
  • 2
  • 24
  • 38
Maulik Bhuptani
  • 597
  • 3
  • 14