RSA加密/解密与Javascript和PHP兼容 [英] RSA encryption/decryption compatible with Javascript and PHP

查看:186
本文介绍了RSA加密/解密与Javascript和PHP兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Javascript中加密,然后在PHP中解密。有Javascript和PHP的RSA实现,但它们不兼容。我无法正确解密我使用Javascript加密的内容。

I'd like to encrypt in Javascript and then decrypt in PHP. There are RSA implementations for Javascript and PHP but they are not compatible. I cannot decrypt in PHP correctly what I had encrypted with Javascript.

有没有人知道可以使用Javascript和PHP工作的库/代码?

Does anyone know a library/code that will work both with Javascript and PHP?

谢谢。

推荐答案

这是一个JavaScript RSA加密库: http://www.ohdave.com/rsa/

Here is an JavaScript RSA encryption library: http://www.ohdave.com/rsa/

而且我认为你可以使用类这样的东西来解密生成的加密字符串 - http:/ /www.phpclasses.org/browse/package/4121.html

And I think you could use something like this class to decrypt the generated encrypted string - http://www.phpclasses.org/browse/package/4121.html

让我知道如果你管理得到这项工作,我自己正在研究这个主题(我实际上发现这篇文章自己寻找这个答案:P)。

Let me know if you manage get this work together, as I am myself looking into this subject (I actually found this post looking for this answer myself :P ) .

编辑:看,我也发现了这个 - http://www.sematopia.com/?p=275 - 似乎与公关有关以及两个......

Look, I've also found this - http://www.sematopia.com/?p=275 - seems related to the previous two as well...

这篇关于RSA加密/解密与Javascript和PHP兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆