您的位置:首页 > 运维架构 > Linux

linux下使用openssl对文件RSA加密解密

2016-07-05 00:14 716 查看
生成一个1024位的密钥:

openssl genrsa -out test.key 1024


从这个密钥中分离出公钥:

openssl rsa -in test.key -pubout -out test_pub.key


对hello.txt进行加密:

openssl rsautl -encrypt -in hello.txt -inkey test_pub.key -pubin -out hello.en


对hello.en进行解密:

openssl rsautl -decrypt -in hello.en -inkey test.key -out hello.de
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  rsa 加密 openssl linux 解密