For iOS, only static libraries can be used, not frameworks with dynamic libraries.
Use CommonCrypto instead, it's just C, but not very difficult to use. Make sure that you use the same settings, mode, IV (if necessary for the mode), indents and the key.
Add Security.framework to the project
#import <CommonCrypto/CommonCryptor.h> + (NSData *)doCipher:(NSData *)dataIn iv:(NSData *)iv key:(NSData *)symmetricKey context:(CCOperation)encryptOrDecrypt { CCCryptorStatus ccStatus = kCCSuccess; size_t cryptBytes = 0; // Number of bytes moved to buffer. NSMutableData *dataOut = [NSMutableData dataWithLength:dataIn.length + kCCBlockSizeAES256]; ccStatus = CCCrypt( encryptOrDecrypt, kCCAlgorithmAES256, kCCOptionPKCS7Padding, symmetricKey.bytes, kCCKeySizeAES256, iv.bytes, dataIn.bytes, dataIn.length, dataOut.mutableBytes, dataOut.length, &cryptBytes); if (ccStatus != kCCSuccess) { // Handle error NSLog(@"CCCrypt status: %d", ccStatus); } dataOut.length = cryptBytes; return dataOut; }
For Base64 see SO answer
source share