Any Equivalent for mcrypt (in PHP) to use in Java?

2019-03-20 15:19发布

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?

1条回答
爷的心禁止访问
2楼-- · 2019-03-20 16:07

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.

查看更多
登录 后发表回答