scottyab / AESCrypt-Android

Simple API to perform AES encryption on Android. This is the Android counterpart to the AESCrypt library Ruby and Obj-C (with the same weak security defaults :( ) created by Gurpartap Singh. https://github.com/Gurpartap/aescrypt
Apache License 2.0
641 stars 191 forks source link

Encryption result is different on Android and IOS #19

Open CDNRahulSonpaliya opened 7 years ago

CDNRahulSonpaliya commented 7 years ago

Hello,

I am using this library in my android project and its counter part https://github.com/Gurpartap/aescrypt in ios project. I am encrypting same text with same encryption key, but it is giving me different results on ios and android.

I am using this key : 25c35734b1ef623ca2a7f730cf2fea8b790739ba

String to encrypt is : Password

Encrypted String IOS : W3LyAxKq2+QdDBfKUGVgTg== Encrypted String Android : zdgSimKva1jblici7F8DGw==

Rahulgupta-cdnsol commented 7 years ago

Hi,

I am getting same issue with library as it is not generating same result as iOS.What needs to do to get similar result as iOS.

ninjatrench commented 7 years ago

Hi, I can look into it. Can you post the IV used by you in Android as well as iOS as iOS directly doesn't take blank IV

Rahulgupta-cdnsol commented 7 years ago

in IOS I am using below function :

} Android :- byte[] ivBytes = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};