I'm using AES encryption to encrypt and decrypt string between php on the server side and Android app (as client).
The encrypted string in PHP is:
HaxRKnMxT24kCJWUXaVvqDHahzurJQK+sYA4lIHql/U=
and in Java it's:
HaxRKnMxT24kCJWUXaVvqD/KMEkJTPTXEcCsHIYGX9TGtCNOHQcJyUURPk8qlgf3
I'm making use of phpseclib in the PHP script to do the encryption.
What am I missing here?
The relevant Java code here
SecretKeySpec skeySpec = new SecretKeySpec(pad16(pass), "AES");
Cipher c = Cipher.getInstance("AES");
c.init(Cipher.ENCRYPT_MODE, skeySpec);
byte[] out = c.doFinal( input )
And the PHP code here:
$aes = new Crypt_AES();
$aes->setKey('password');
$encrypted_encoded_text = base64_encode($aes->encrypt($plaintext));