AESCrypt-Android
AESCrypt-Android copied to clipboard
Encryption result of AESCrypt-Android library differs from result in php?
According to the usage example, using password = password and message = hello world results in the encrypted message 2B22cS3UC5s35WBihLBo8w==
However in php using the same password and message following the snippet here results in the encrypted message lMwL6ztvVavgsTu7NJE/kw== which is different.
See complete php code snippet here
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<!-- following this snippet<br>
https://www.urbaninsight.com/2012/06/13/encrypt-and-decrypt-strings-php
-->
<?php
$string = "hello world";
$password = "password";
$method = "aes-256-cbc";
$encrypted = openssl_encrypt($string, $method, $password);
echo "ENCRYPT:<br>$string<br>$password<br>$encrypted<br><br>";
$decrypted = openssl_decrypt($encrypted, $method, $password);
echo "DECRYPT:<br>$encrypted<br>$password<br>$decrypted";
?>
<!-- result: lMwL6ztvVavgsTu7NJE/kw==
-->
</body>
</html>
Is the AESCrypt-Android library not compatible with php or is there something, I'm overseeing currently? Thank you in advance! Taifun