PHP可以使用mcrypt_encrypt进行DES加密与解密,但实际上操作,你会发现它与JAVA的DES加密出来的字符串,有些不同。基本上是前半段一样,后半段不一样。找到PHP官方网站上对这个函数的文档,有人回复了,并给出了代码。经测,这样加密解密就跟JAVA中的兼容了。
If you want to be interoperable with other PKCS #7 padding implementations, like the Legion of the Bouncy Castle Java cryptography APIs, you should always pad, that is a 8-byte (block size) padding should be added, even if not necessary
来自:http://it.oyksoft.com/post/4831/
If you want to be interoperable with other PKCS #7 padding implementations, like the Legion of the Bouncy Castle Java cryptography APIs, you should always pad, that is a 8-byte (block size) padding should be added, even if not necessary
来自:http://it.oyksoft.com/post/4831/
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/6522/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
评论列表