skavinvarnan / Cross-Platform-AES

Simple cross-platform encryption and decryption using AES
MIT License
142 stars 69 forks source link

String encrypted in iOS does not decrypt in Android #11

Closed ajayfuloria closed 5 years ago

ajayfuloria commented 5 years ago

Hey!! I have used the header as bridging header in iOS, encryption and decryption works fine in ios as well as android. But when I try to encrypt in iOS and Decrypt in Android or vice versa I do not get result.. Any solution ?

AjAlex commented 5 years ago

Make sure that the configuration of each platform is consistent. I've tested the encryption and decryption between Android and iOS platforms. It's no problem at all. I've applied it to my project. I've never made any mistakes for more than half a year. Please check the code in the configuration section carefully. Good luck.

ajayfuloria commented 5 years ago

@AjAlex Can you please elaborate as to what configurations in particular? I am new to programming and i am stuck critically at this problem. I have done a lot of digging only problem i can see is that Android code uses PKCS5 whereas iOS code used kCCOptionPKCS7Padding. But how to resolve this issue. Also as far as i know PKCS5 is a subset of PKCS7 it should work but its not working. Please help !!

skavinvarnan commented 5 years ago

@ajayfuloria try this example and first check which platform doesn't give your the expected result.

Then carefully follow the instructions specified here, you will get a solution.

PS: I do encode decode on all 3 platforms, it works fine.

skavinvarnan commented 5 years ago

Closing because of inactivity