简体   繁体   English

RSA加密Javascript

[英]RSA Encryption Javascript

can anyone please help me with this, i have been instructed to write an application that takes some DATA then Encrypts it with a RSA Public Key and apparently needs to be RSA Encryption(i have never heard or seen this before)? 任何人都可以请帮助我,我已被指示编写一个应用程序,需要一些数据,然后使用RSA公钥加密它,显然需要RSA加密(我以前从未听过或见过这个)?

Which encryption cipher is RSA meant to use as standard? RSA使用哪种加密密码作为标准?

var key = "TUlHZE1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTEFEQ0Jod0tCZ1FDbVFiTWc3SWRpeHVmYWEwcDd2ODVLVytmUnVlZ216UUhibnNoWjhmbXlTQW9MMXRFVzAyNEZKVFlSTFZxN0VsV2p1R0U4aHQ3RmJjN1NURWpxZVViWU5xdnRiVWN6UFZYSE5FdStYRUVndGszazlFNXVQWG0wVzRIc3RtK0FhRXcyMmxxb2lFNGlrT1QzZzdPRXNHSVFCMVNlSlRtVTE1eFBBZ3M3SXRjTVFRSUJFUT09";

var data = "Xa21dr";

Never mind found the answer myself! 没关系自己找到了答案!

RSA Encryption standard uses PKCS #1 RSA加密标准使用PKCS#1

Best library to use is pidCrypt, nothing else worked for me! 最好使用的库是pidCrypt,没有其​​他工作对我来说!

https://sourceforge.net/projects/pidcrypt/ https://sourceforge.net/projects/pidcrypt/

the idiots on the other end failed to let me know that that RSA Public Key was meant to be base64 decoded too before encrypting the DATA before sending. 在发送之前加密DATA之前,另一端的白痴未能让我知道RSA公钥也是基本64位解码的。

You may be interested in trying out forge (it does RSA and more). 您可能有兴趣尝试伪造(它确实是RSA等)。 There are lots of examples on the README: README上有很多例子:

https://github.com/digitalbazaar/forge https://github.com/digitalbazaar/forge

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM