How to add salt to AES Encryption in iOS and decrypting it using objective c

后端 未结 1 1578
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 08:15

I have appended the IV to the AES Encryption/decryption code by using objective c in iOS and able to decrypt and encrypt the same. Right now I am trying to add the salt to t

相关标签:
1条回答
  • 2020-12-12 08:28

    You're stretching your encryption key, but you're not stretching your decryption key. The decryption code never calls AESKeyForPassword, and I don't see anywhere that you store the salt to send it to the decryptor (the way you send the IV to the decryptor). You can't just apply PBKDF2 to one side. That gives you completely different keys.

    0 讨论(0)
提交回复
热议问题