Problems with interoperability: MCrypt AES PHP x Java

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am having problems while trying to decrypt an encrypted string (generated
from a java system) in PHP.

To take external factors out of the way I decided to make them work first in
my local system.

So I've created a sample encrypt/decrypt from PHP (using mcrypt's extension)
and the java code found at
http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html.

I've added a System.out.println("KEY: " + asHex(raw));

to get the key used in the java and set the same in PHP.   There is no
mention in Java but since I didn't see a initialization vector I assume we
are use ECB mode.

Unfortunately the same string /key produces different encrypted values.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux