问题 使用RSA和DES3密钥加密和解密一串文本


我使用的是Linux命令行,我使用以下命令创建了一个私钥:

openssl genrsa -des3 -out private.pem 2048

我从私钥中提取了公钥,如下所示:

openssl rsa -in private.pem -out public.pem -outform PEM -pubout

我想使用公钥来加密一串文本,让我们说“foo bar”,然后再次解密这个字符串。

我该怎么做?

谢谢


10295
2017-12-21 12:26


起源



答案:


我想你想要的

openssl rsautl -encrypt -inkey public.pem -pubin -in unencrypted_file.txt -out encrypted_file.ssl

更多信息请访问 迪威


10
2017-12-21 13:21



非常感谢你! - JMK


答案:


我想你想要的

openssl rsautl -encrypt -inkey public.pem -pubin -in unencrypted_file.txt -out encrypted_file.ssl

更多信息请访问 迪威


10
2017-12-21 13:21



非常感谢你! - JMK