【发布时间】:2016-06-01 05:46:10
【问题描述】:
这是我的测试用例。
$ openssl genrsa -out private.pem 2048
$ openssl rsa -in private.pem -outform PEM -pubout -out public.pem # but I don't use it.
$ touch raw_data.log && echo 123456 >> raw_data.log
$ openssl rsautl -encrypt -in raw_data.log -inkey private.pem > enc.raw_data.log
$ openssl rsautl -decrypt -in enc.raw_data.log -inkey private.pem > dec.raw_data.log
$ cat raw_data.log
$ cat dec.raw_data.log
为什么我只能使用 rsa 私钥加密和解密数据。(不是加密数据的公钥)
对吗?
【问题讨论】:
标签: encryption openssl rsa