<DRAFT!>
OpenSSL 有关密钥的那些事儿(HOWTO keys) 1. 介绍(Introduction) Keys are the basis of public key algorithms and PKI. Keys usually
come in pairs, with one half being the public key and the other half
being the private key. With OpenSSL, the private key contains the
public key information as well, so a public key doesn't need to be
generated separately. Public keys come in several flavors, using different cryptographic
algorithms. The most popular ones associated with certificates are
RSA and DSA, and this HOWTO will show how to generate each of them. 2. 生成 RSA 密钥(To generate a RSA key) A RSA key can be used both for encryption and for signing. Generating a key for the RSA algorithm is quite easy, all you have to
do is the following: openssl genrsa -des3 -out privkey.pem 2048 With this variant, you will be prompted for a protecting password. If
you don't want your key to be protected by a password, remove the flag
'-des3' from the command line above. NOTE: if you intend to use the key together with a server
certificate, it may be a good thing to avoid protecting it
with a password, since that would mean someone would have to
type in the password every time the server needs to access
the key. The number 2048 is the size of the key, in bits. Today, 2048 or
higher is recommended for RSA keys, as fewer amount of bits is
consider insecure or to be insecure pretty soon. 3. 生成 DSA 密钥(To generate a DSA key) A DSA key can be used for signing only. This is important to keep
in mind to know what kind of purposes a certificate request with a
DSA key can really be used for. Generating a key for the DSA algorithm is a two-step process. First,
you have to generate parameters from which to generate the key: openssl dsaparam -out dsaparam.pem 2048 The number 2048 is the size of the key, in bits. Today, 2048 or
higher is recommended for DSA keys, as fewer amount of bits is
consider insecure or to be insecure pretty soon. When that is done, you can generate a key using the parameters in
question (actually, several keys can be generated from the same
parameters): openssl gendsa -des3 -out privkey.pem dsaparam.pem With this variant, you will be prompted for a protecting password. If
you don't want your key to be protected by a password, remove the flag
'-des3' from the command line above. NOTE: if you intend to use the key together with a server
certificate, it may be a good thing to avoid protecting it
with a password, since that would mean someone would have to
type in the password every time the server needs to access
the key. --
Richard Levitte

OpenSSL 有关密钥的那些事儿(HOWTO keys)的更多相关文章

  1. php openssl 增加密钥

      生成私钥:openssl genrsa 1024 > private.key (注意,1024是密钥的长度,如果密钥较长,相应加密后的密文也会较长) 生成公钥:openssl rsa -in ...

  2. 使用openssl生成密钥、加密和签名

    openssl genrsa -out rsakey.pem 1024  //生成1024bit的RSA密钥,并保存到rsakey.pem,此处未对密钥进行加密 openssl genrsa -aes ...

  3. OpenSSL(1)密钥和证书管理

    OpenSSL是一个开源项目,包括密码库和SSL/TLS工具集. 从项目的官方站点可以看到: OpenSSL项目是安全套接字层( secure sockets layer, SSL)和传输层安全( t ...

  4. openssl RSA密钥格式PKCS1和PKCS8相互转换

    RSA私钥格式PKCS1和PKCS8相互转换 RSA公钥格式PKCS1和PKCS8相互转换 以下转换基于openssl命令的操作: 1. openssl 生成pkcs1格式的私钥,密钥长度1024位, ...

  5. openssl pem密钥文件rsa加密解密例子

    准备工作 命令行加密解密,用与比对代码中的算法和命令行的算法是否一致 C:\openssl_test>openssl rsautl -encrypt -in data.txt -inkey pu ...

  6. 简单使用OpenSSL生成密钥

    一.生成自签名证书 1.1.创建root CA私钥 openssl req -newkey rsa:4096 -nodes -sha256 -keyout ca.key -x509 -days 365 ...

  7. openssl生成密钥/证书

    一.公钥/私钥/签名/验证签名/加密/解密/非对称加密 对称加密:用同一个密码  加密/解密  文件. 非对称加密:加密用的一个密码,解密用另外一组密码. 加密解密:公钥加密数据,然后私钥解密. 公钥 ...

  8. 基于OpenSSL的RSA加密应用(非算法)

    基于OpenSSL的RSA加密应用(非算法) iOS开发中的小伙伴应该是经常用der和p12进行加密解密,而且在通常加密不止一种加密算法,还可以加点儿盐吧~本文章主要阐述的是在iOS中基于openSL ...

  9. 创建私有CA,我就用openSSL

    目录 简介 搭建root CA 生成root CA 使用CRL 使用OSCP 总结 简介 一般情况下我们使用的证书都是由第三方权威机构来颁发的,如果我们有一个新的https网站,我们需要申请一个世界范 ...

随机推荐

  1. MATLAB矩阵操作大全

    转载自:http://blog.csdn.net/dengjianqiang2011/article/details/8753807 MATLAB矩阵操作大全 一.矩阵的表示 在MATLAB中创建矩阵 ...

  2. Postfix+Sasl+Courier-authlib+Dovecot+MySQL+extmail 邮件系统部署

    # yum remove postfix ##删除系统自带postfix# userdel postfix# groupdel postdrop# groupadd -g 2525 postfix# ...

  3. 追加window.onload函数

    function addLoadEvent(func) { var old_onload = window.onload; if (typeof window.onload != 'function' ...

  4. CodeVS1611_APIO2009_抢掠计划_C++

    题目:http://codevs.cn/problem/1611/ 关于题解请戳这里:http://www.cnblogs.com/hadilo/p/5892765.html 下面给一个可以A的代码, ...

  5. pip3 快速安装

    https://www.cnblogs.com/wenchengxiaopenyou/p/5709218.html

  6. VS MFC 按键导入BMP图片

    1. 图片导入资源: 2.实现代码: 直接给CButton加图片的方法: 1.在资源编辑器中添加一个按钮.把它的Bitmap属性设为true 2.在按钮上点右键,添加一个变量m_Btn(CButton ...

  7. UVA 10985 Rings'n'Ropes

    最短路 参考了Staingger的博客 感觉DP的状态记录还是有毛病.可以DFS寻找结果也. #include <map> #include <set> #include &l ...

  8. Appium+python自动化20-查看iOS上app元素属性【转载】

    前言 学UI自动化首先就是定位页面元素,玩过android版的appium小伙伴应该都知道,appium的windows版自带的Inspector可以定位app上的元素Mac版的appium1.6的版 ...

  9. validate插件实现表单效验(二)

    一款优秀的表单验证插件——validation插件 特点: l  内置验证规则:拥有必填.数字.email.url和信用卡号码等19类内置验证规则 l  自定义验证规则:可以很方便的自定义验证规则 l ...

  10. Matlab,C++存取二进制

    1,Matlab存储二进制 load Wall.dat %读取数据,数组名为Wall fid=fopen('Wall','wb'); %打开一个文件,二进制写入 fwrite(fid,Wall','f ...