AES Encryption for an NSString on the iPhone

前端 未结 5 1567
陌清茗
陌清茗 2020-11-22 05:56

Can anybody point me in the right direction to be able to encrypt a string, returning another string with the encrypted data? (I\'ve been trying with AES256 encryption.) I w

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 06:37

    @owlstead, regarding your request for "a cryptographically secure variant of one of the given answers," please see RNCryptor. It was designed to do exactly what you're requesting (and was built in response to the problems with the code listed here).

    RNCryptor uses PBKDF2 with salt, provides a random IV, and attaches HMAC (also generated from PBKDF2 with its own salt. It support synchronous and asynchronous operation.

提交回复
热议问题