【发布时间】:2019-08-15 18:20:47
【问题描述】:
我已经使用 openssh 生成了 Rsa 密钥对。我想使用 openssl 使用密码加密私钥。
我尝试使用 openssl 加密私钥,但无法这样做,因为它会给出错误消息。
使用以下命令生成 rsa 密钥对
ssh-keygen -t rsa -b 4096 -P ''-f ./Test-key
在下面的命令中使用 openssl 加密私钥。
rsa -des3 -in C:\Users\vkode200\Test-key -out C:\Users\vkode200\Test-key-encrypted -passout pass:"${pass}"
我收到以下错误消息:
15764:error:0906D06C:PEM routines:PEM_read_bio:no start line:crypto\pem\pem_lib.c:686:Expecting: ANY PRIVATE KEY
error in rsa```
Below is the header of my generated private key
```-----BEGIN OPENSSH PRIVATE KEY-----```
I have no clue and i spent lot of time to figure out the issue, but no luck.
【问题讨论】:
-
这里需要使用openssl吗? ssh-keygen 可以加密和解密 ssh 密钥。
-
是的,我需要使用openssl,因为其他系统使用openssl des3来解密。
标签: encryption openssl private-key openssh