Skip to content
Advertisement

AES Encryption in android and decryption in php and vice versa

I am trying to learn AES by testing my code against https://aesencryption.net. I previously had an error in Base64.encodeBase64String and also Base64.decodeBase64 // encode/decode Base64. So I manipulated Base64 somehow to resolve the error. Now in my app the text is encrypted and decrypted properly, I think. But when I try to encrypt or decrypt the same text server-side (at aesencryption.net), the site is not able to decrypt my encrypted string. Please help.

Following is my code :

JavaScript

Thanks in advance.

Advertisement

Answer

I do something like this which actually works 😉

JavaScript

Call this class like this :

JavaScript

And for iPhone (Code is here) : https://github.com/Gurpartap/AESCrypt-ObjC

Hope this code works for you too 🙂

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement