I have some encrypted data that I’m converting to a base64. I am having difficulty converting that string back into NSData that I can then use for decryption.
NSData *encryptedData = [self encrypt:_secretData key:[self md5data:_key] padding:&padding];
//I've tried this with different data too
NSString *cyphertext = [encryptedData base64EncodingWithLineLength:0];
//this works fine
[cyphertext dataUsingEncoding:NSUTF8StringEncoding];
//this returns too many bytes ... it's longer than my original data
I’m using the standard “NSData+Base64.h” by Dave Winer – I found it on github.
Any tips on how to convert the string back to the same NSData object?
using its counterparts maybe?
Note that converting to base64 must brings a multiple of 4…