Closed AzriDelta closed 5 years ago
I added class Base64
from Android package and created custom dev.mervick.android.Aes256
class.
Usage:
import dev.mervick.android.Aes256;
// encryption
String encrypted = Aes256.encrypt("TEXT", "PASSWORD");
System.out.println(encrypted);
// decryption
String decrypted = Aes256.decrypt(encrypted, "PASSWORD");
System.out.println(decrypted);
that is fast.
About the error that I got, apparently it was a silly mistake of mine of trying to decrypt another string. Sorry about that.
Changing the library to android.util.Base64 does work for now. I will try to decrypt it using the python version.
Okay, then I close this
I noticed that the Base64 library requires API level 26 (Oreo), which is quite high. I am using my own phone (Nougat) to test my own app, so it doesn't work.
If I tried to change the library android.util.Base64, and modified codes from
On decryption, the error
java.lang.IllegalArgumentException: Initial bytes from input do not match OpenSSL SALTED_MAGIC salt value.
is thrown.And of course even if it works, does it affect the libraries for other languages (especially Python, since I need to decrypt using Python)