OpenSSL 中 PEM 格式的默认密码是什么?

编程入门 行业动态 更新时间:2024-10-28 22:25:36
本文介绍了OpenSSL 中 PEM 格式的默认密码是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用 openssl 生成密钥/证书

I generate key/cert using openssl

openssl.exe req -x509 -days 1000 -newkey rsa:1024 -keyout key.pem -out cert.pem

它会提示输入密码.我猜密码用于密钥加密.但是我没有指定任何密码.在这种情况下使用什么密码?

It prompts for a password. I guess that the password is used for key encryption. However I haven't specified any cipher. What cipher is used in this case?

推荐答案

默认密码为 DES-EDE3-CBC,即 CBC 模式下的三键三重 DES EDE.您可以在源代码文件 req.c 中看到这一点.

The default cipher is DES-EDE3-CBC, which is three-key triple DES EDE in CBC mode. You can see this in the source code file req.c.

cipher=EVP_des_ede3_cbc();

如果您使用的是使用选项 OPENSSL_NO_DES 编译的 OpenSSL 版本,则默认情况下该库不会加密密钥.这与您通过 -nodes 参数.

If you are using an OpenSSL version compiled with the option OPENSSL_NO_DES, then the library will not encrypt the key by default. This is the same behavior as if you pass the -nodes argument.

解决这个问题的更简单方法就是查看您的密钥文件.它在 PEM 标头中宣布密码.

An easier way to figure this out is just to look at your key file. It announces the cipher in the PEM header.

$ cat key.pem -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,CAFD88DF2EF2EE81 ...

更多推荐

OpenSSL 中 PEM 格式的默认密码是什么?

本文发布于:2023-10-26 10:47:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529912.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密码   格式   OpenSSL   PEM

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!