Reputation: 23
I have to decrypt (AES 256) a String in objective c.
I have the Key and the IV used by the other side to encrypt (C#).
Could you help me ?
Upvotes: 2
Views: 3648
Reputation: 5835
Please have look at this application.
All you need to do is to add Helper classes from repository AES256AndBase64 in your application,
#import "NSString+AESCrypt.h"
in your required file.
Use - (NSString *)AES256DecryptWithKey:(NSString *)key
method to decrypt the data:
NSString* dummyString=@"Steve Job";
NSLog(@"Normal String- %@",dummyString);
NSString* encrypt_decrypt_Key=@"apple";
NSString *encryptString = [dummyString
AES256EncryptWithKey:encrypt_decrypt_Key];
NSLog(@"Encrypt String- %@",encryptString);
NSString *decryptString = [encryptString
AES256DecryptWithKey:encrypt_decrypt_Key];
NSLog(@"Decrypt String- %@",decryptString);
Upvotes: 2