Question

Can any one tell about any library that can be used in java, which gives the same result if operation was done in PHP using the mcrypt library.

i want to actually encrypt a string in Java using AES, and decrypt it in PHP. Will the Java Cipher yield a encryption decryptable by mcrypt in PHP?

edit:

Found some resin-3.1 library in Web. Can it be?

Was it helpful?

Solution

Encryption algorithms are programming language independent.

As long as the:

are all the same, you'll be able to encrypt and decrypt data regardless of the programming language used (assuming the implementations are correct).

Just remember that Java's Cipher works on byte arrays, so if you are encrypting a string, you'll need to use String.getBytes() to get a byte array.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top