linux下使用openssl对文件RSA加密解密
2016-07-05 00:14
716 查看
生成一个1024位的密钥:
从这个密钥中分离出公钥:
对hello.txt进行加密:
对hello.en进行解密:
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
相关文章推荐
- Linux socket 初步
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- OpenSSL编程之RSA
- Ubuntu Linux使用体验
- 每 172 个活动 RSA 证书中就有一个容易受到攻击
- c语言实现hashmap(转载)
- Linux 信号signal处理机制