user1845375
user1845375

Reputation: 23

Objective C AES256 Decryption

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

Answers (1)

Mayur Birari
Mayur Birari

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

Related Questions