How to store credit card info on iphone?

前端 未结 4 1850
情话喂你
情话喂你 2021-01-13 09:53

I have requirement to store credit card number in iPhone app. How to store the data secure manner. I have looked at keychain. Apart from it, is there anything i can use.

4条回答
  •  醉梦人生
    2021-01-13 10:27

    Encryption and the use of SSL/HTTPS seems enough for this case. If you are new to the subj, good general guidelines here: Mobile App Development Tips: How to Ensure Data Security

    There are many implementations, e.g. you can use AES256 algorithm mentioned above:

    1. When an app saves a credit card number for the first time, a random masterKey and initialization vector (IV) are generated. Use them later for encryption.
    2. A masterSalt is generated and saved locally.
    3. Using plainPassword and masterSalt, a hash (PBKDF2) is calculated.
    4. Using the AES256 algorithm, the calculated hash is used to encrypt both MasterKey and IV.
    5. Encrypted MasterKey and IV are saved locally.
    6. Decrypt the MasterKey and IV using plainPassword and masterSalt hash (PBKDF2).
    7. Now, encrypt the data with MasterKey and IV using the AES256 algorithm.

提交回复
热议问题