本文介绍了Objective C AES256解密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在目标c中解密(AES 256)字符串.

I have to decrypt (AES 256) a String in objective c.

我拥有另一端用来加密(C#)的密钥和IV.

I have the Key and the IV used by the other side to encrypt (C#).

你能帮我吗?

推荐答案

请查看此应用程序.

您需要做的就是在应用程序中从存储库 AES256AndBase64 中添加Helper类,在所需文件中 #import"NSString + AESCrypt.h" .

All you need to do is to add Helper classes from repository AES256AndBase64 in your application,#import "NSString+AESCrypt.h" in your required file.

使用-(NSString *)AES256DecryptWithKey:(NSString *] key 方法解密数据:

    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);

这篇关于Objective C AES256解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 20:50