We are using this code to encrypt in Objective-C on the iPhone:
- (NSMutableData*) EncryptAES: (NSString *) key
{
char keyPtr[kCCKeySizeAES128+1];
bz
You could as well use the following libs providing in-built AES-256-CBC cipher and Base64 encoding that you can use across both platforms quickly:
message = "top secret message"
password = "p4ssw0rd"
# Encrypting
encrypted_data = AESCrypt.encrypt(message, password)
# Decrypting
message = AESCrypt.decrypt(encrypted_data, password)
NSString *message = @"top secret message";
NSString *password = @"p4ssw0rd";
// Encrypting
NSString *encryptedData = [AESCrypt encrypt:message password:password];
// Decrypting
NSString *message = [AESCrypt decrypt:encryptedData password:password];
Hope it helps!