Skip to content
This repository was archived by the owner on Dec 20, 2017. It is now read-only.
This repository was archived by the owner on Dec 20, 2017. It is now read-only.

Encryption result of AESCrypt-Android library differs from result in php? #20

@puravidaapps

Description

@puravidaapps

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions