2

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 ?

user1845375
  • 23
  • 1
  • 3

1 Answers1

2

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);
Mayur Birari
  • 5,837
  • 8
  • 34
  • 61