简体   繁体   中英

Encryption/ Decryption using AES128 between Objective c and C#

I am using encryption/decryption between Objective c(iPad end) and C#(.net, server site). I am using code from this link: iPhone/C# AES Encryption

We are encrypting a XML on server end and sending it to iPad end using web services. At the iPad end when i am trying to decrypt, it is creating decrypted data but is not able to convert that data into the string. There is some problem coming in converting data into string using NSUTF8StringEncoding.

Before sending from server to iPad we are converting it into base64 String.

The same XML file when encrypted and decrypted at iPad end works fine.

I believe there are some special characters in the encrypted data coming from from server end ,therefore it is not decrypted at iPad end.

Can anybody give me any suggestion on this.

Thank you!

You can not send encrypted string over the network. you need to convert encrypted NSString into Base64 String. Then send this Base 64 string to ipad.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM