Reputation: 434
My current code is like below which is from UTF8 to data. But the string is base64 (read from a file to be encrypted in aes256 cbc) and not able to be converted into UTF8
NSString* str = @"somelongbase64stringreadfromsmallimagefile";
NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding];
NSMutableData * buffer = [[NSMutableData alloc] initWithLength:[data length] + kCCBlockSizeAES128];
Upvotes: 0
Views: 56
Reputation: 434
got it working by
NSData *data = [[NSData alloc] initWithBase64EncodedString:str options:0];
Upvotes: 0