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