PBKDF2 using CommonCrypto on iOS
Here’s how i generate AES256 keys. The only interesting this is that i get CommonCrypto to estimate for me how many rounds to use. It seems pretty straightforwards. #import <CommonCrypto/CommonKeyDerivation.h> … // Makes a random 256-bit salt – (NSData*)generateSalt256 { unsigned char salt[32]; for (int i=0; i<32; i++) { salt[i] = (unsigned char)arc4random(); } return … Read more