使用OpenSSL生成RSA秘钥对并对文件加解密
生成RSA私钥
shell
openssl genrsa -out rsa.key 1024生成RSA公钥
shell
openssl rsa -in rsa.key -pubout -out pub.key创建明文文件
shell
echo "This is plain message 2019-10-17" > plain.text加密
shell
openssl rsautl -encrypt -inkey pub.key -pubin -in plain.text -out cipher.txt解密
shell
openssl rsautl -decrypt -inkey rsa.key -in cipher.txt -out plain2.txt