rsa私钥和公钥

RSA is an algorithm used for Cryptography. It was patented until 2000 in the USA (not the whole world) where now it can be used freely. RSA has a lot of usage examples but it is mainly used for encryption of small pieces of data like key and Digital signatures. RSA is based integer factorization problem. As it is known that asymmetric ciphers are very slow against symmetric ciphers. So it is used with symmetric cipher like AES to secure bulk data. Using with AES and RSA together named hybrid usage. Here are some practical RSA tools to manage.

RSA是用于密码术的算法。 它直到2000年在美国(不是整个世界)都获得了专利,现在可以免费使用了。 RSA有很多用法示例,但它主要用于加密小数据,例如密钥和数字签名。 RSA是基于整数分解的问题。 众所周知,非对称密码相对于对称密码非常慢。 因此,它与AES等对称密码一起使用来保护批量数据。 与AES和RSA一起使用时称为混合用法。 这里是一些实用的RSA工具进行管理。

建立金钥 (Create Key)

In order to manage the RSA key, we need to create it first. we specify the output type where it is a file named t1.key and the size of the key with 2048. We used the verb genrsa with OpenSSL. By default, keys are created in PEM format as it showed with file command.

为了管理RSA密钥,我们需要首先创建它。 我们在文件名为t1.key的文件中指定输出类型,并使用2048作为密钥的大小。我们将genrsa动词与OpenSSL一起使用。 默认情况下,密钥以PEM格式创建,如文件命令所示。

$ openssl genrsa -out t1.key 2048

Create Key
建立金钥

将Pem格式转换为Der格式(Convert Pem Format into Der Format)

Formats are used to encode created RSA key and save into a file. Pem is common format but sometimes you need to use DER format. Here is how it can be done. We specify input form and output form with -inform and -outform parameters and then show the existing file within and created file with -out. Then we check file as we see that data as file type because of the binary type. Der is not encoded base64 like pem format.

格式用于对创建的RSA密钥进行编码并保存到文件中。 Pem是常见格式,但有时您需要使用DER格式。 这是可以完成的。 我们使用-inform-outform参数指定输入表单和输出表单,然后使用-out显示其中的现有文件以及创建的文件。 然后我们检查文件,因为二进制类型将数据视为文件类型。 Der不是像pem格式那样编码为base64。

$ openssl rsa -inform pem -outform der -in t1.key -out t1.der

使用AES加密RSA密钥 (Encrypting RSA Key with AES)

Private keys are very sensitive if we transmit it over insecure places we should encrypt it with symmetric keys. Here we use AES with 128-bit key and we set encrypted RSA key file without parameter. Or while generating the RSA key pair it can be encrypted too.

如果我们在不安全的地方传输私钥,则私钥非常敏感,我们应该使用对称密钥对其进行加密。 在这里,我们将AES与128位密钥一起使用,并且设置不带参数的加密RSA密钥文件。 或者在生成RSA密钥对时也可以对其进行加密。

$ openssl rsa -aes128 -in t1.key -out t1out.pem

Encrypting RSA Key with AES
使用AES加密RSA密钥

列出/显示公钥(List/Show Public Key)

We can display or view a given public key in the terminal. We will use -in parameter to provide the certificate file name which is t1.key in this example and -pubout and -text options in order to print to the screen.

我们可以在终端中显示或查看给定的公钥。 我们将使用-in参数使其能够提供证书文件名t1.key在这个例子和-pubout-text选项,以打印到屏幕上。

$ openssl rsa -in rsa1.pem -pubout -text

List/Show Public Key
列出/显示公钥

We can see from the screenshot that RSA key is 2048 bit with modulus.

从屏幕截图中我们可以看到RSA密钥为2048位模数。

.ue4207c832f473b8bf073928dee1bd25d , .ue4207c832f473b8bf073928dee1bd25d .postImageUrl , .ue4207c832f473b8bf073928dee1bd25d .centered-text-area { min-height: 80px; position: relative; } .ue4207c832f473b8bf073928dee1bd25d , .ue4207c832f473b8bf073928dee1bd25d:hover , .ue4207c832f473b8bf073928dee1bd25d:visited , .ue4207c832f473b8bf073928dee1bd25d:active { border:0!important; } .ue4207c832f473b8bf073928dee1bd25d .clearfix:after { content: ""; display: table; clear: both; } .ue4207c832f473b8bf073928dee1bd25d { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .ue4207c832f473b8bf073928dee1bd25d:active , .ue4207c832f473b8bf073928dee1bd25d:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .ue4207c832f473b8bf073928dee1bd25d .centered-text-area { width: 100%; position: relative; } .ue4207c832f473b8bf073928dee1bd25d .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .ue4207c832f473b8bf073928dee1bd25d .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .ue4207c832f473b8bf073928dee1bd25d .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .ue4207c832f473b8bf073928dee1bd25d:hover .ctaButton { background-color: #E67E22!important; } .ue4207c832f473b8bf073928dee1bd25d .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .ue4207c832f473b8bf073928dee1bd25d .ue4207c832f473b8bf073928dee1bd25d-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .ue4207c832f473b8bf073928dee1bd25d:after { content: ""; display: block; clear: both; }

LEARN MORE  What Is Windows Sysinternal?

.ue4207c832f473b8bf073928dee1bd25d , .ue4207c832f473b8bf073928dee1bd25d .postImageUrl , .ue4207c832f473b8bf073928dee1bd25d .centered-text-area { min-height: 80px; position: relative; } .ue4207c832f473b8bf073928dee1bd25d , .ue4207c832f473b8bf073928dee1bd25d:hover , .ue4207c832f473b8bf073928dee1bd25d:visited , .ue4207c832f473b8bf073928dee1bd25d:active { border:0!important; } .ue4207c832f473b8bf073928dee1bd25d .clearfix:after { content: ""; display: table; clear: both; } .ue4207c832f473b8bf073928dee1bd25d { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .ue4207c832f473b8bf073928dee1bd25d:active , .ue4207c832f473b8bf073928dee1bd25d:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .ue4207c832f473b8bf073928dee1bd25d .centered-text-area { width: 100%; position: relative; } .ue4207c832f473b8bf073928dee1bd25d .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .ue4207c832f473b8bf073928dee1bd25d .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .ue4207c832f473b8bf073928dee1bd25d .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .ue4207c832f473b8bf073928dee1bd25d:hover .ctaButton { background-color: #E67E22!important; } .ue4207c832f473b8bf073928dee1bd25d .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .ue4207c832f473b8bf073928dee1bd25d .ue4207c832f473b8bf073928dee1bd25d-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .ue4207c832f473b8bf073928dee1bd25d:after { content: ""; display: block; clear: both; }

了解更多什么是Windows Sysinternal?

如何创建RSA公钥和私钥? 信息图 (How To Create RSA Public and Private Key? Infographic)

How To Create RSA Public and Private Key? Infographic
如何创建RSA公钥和私钥? 信息图

翻译自: https://www.poftut.com/create-rsa-public-private-key/

rsa私钥和公钥

rsa私钥和公钥_如何创建RSA公钥和私钥?相关推荐

  1. xshell怎么连接服务器公钥_配置xshell生成公钥和私钥,使用密钥认证方式登录服务器...

    ssh登录提供两种认证方式:口令(密码)认证方式和密钥认证方式.其中口令(密码)认证方式是我们最常用的一种,这里介绍密钥认证方式登录到linux/unix的方法. 使用密钥登录分为3步: 1.生成密钥 ...

  2. 公钥私钥 多久过期_上传到公钥服务器的gpg公钥过期了会被删除吗?

    参考链接:GPGTools: Discussion​gpgtools.tenderapp.comFrequently Asked Questions​pgp.mit.eduKey Management ...

  3. 配置 不使用rsa 密码_了解使用RSA的密码学

    配置 不使用rsa 密码 RSA is an asymmetric cryptographic algorithm that you are probably using right now to v ...

  4. C#_完整的RSA操作类

    using System; using System.Collections.Generic; using System.Text; using System.Management; using Sy ...

  5. 私钥经过哈希计算可以产生公钥_「区块链基础概念100」:公钥和私钥 | 027

    免责声明:本文旨在传递更多市场信息,不构成任何投资建议.文章仅代表作者观点,不代表火星财经官方立场. 小编:记得关注哦 投资区块链,猛戳:火星财经App下载 来源:学习区块链 原文标题:「区块链基础概 ...

  6. 网络安全_密码学实验_非对称加密算法RSA

    网络安全_密码学实验_非对称加密算法RSA 一.实验环境 二.非对称加密RSA 1.理解RSA算法原理 2.加密过程 解密过程 一.实验环境 PyCharm 2019.2.4 (Professiona ...

  7. Centos7中创建RSA非对称密钥对及搭建私有CA并为客户端颁发证书

    Centos7中创建RSA非对称密钥对及搭建私有CA并为客户端颁发证书 1.在centos7中使用gpg创建RSA非对称密钥对 [13:32:55 root@centos7 data]#gpg --g ...

  8. rsa解密的应用_安全-加解密

    内容概要: 加解密基本原理简介 https简介 中间人攻简介 iOS应用简介 对称 加密算法 加密密钥和解密密钥是同一把密钥K,加解密速度快,典型算法有DES.AES等. 加解秘流程 非对称 加密算法 ...

  9. 公钥和私钥怎么生成_科普 | Eth2 验证者如何生成和保护取款密钥

    来源 | 以太坊爱好者 作者|Jim McDonald责编|晋兆雨 取款密钥是什么? 取款密钥(withdrawal key)是以太坊 2.0 中的验证者用来提现以太币的密钥 [1].以太坊 2.0 ...

最新文章

  1. 在同一个文件中定义多个命名空间
  2. 用 Flask 来写个轻博客 (14) — M(V)C_实现项目首页的模板
  3. Excel中VLOOKUP函数的用法和注意点
  4. CSS基础(part6)--CSS的颜色表示
  5. 在虚拟机上装win2003 server心得体会
  6. [vue] 有在vue中使用过echarts吗?踩过哪些坑?如何解决的?
  7. HTML5+CSS+JQuery 实现简单的进度条功能
  8. NPM 修复两个严重漏洞但无法确认是否已遭在野利用,可触发开源软件供应链攻击...
  9. 用matlab进行边缘检测,利用MATLAB进行数字图像的边缘检测
  10. 做word计算机海报图片,使用word制作宣传海报
  11. 微信小程序--首页加载界面demo
  12. 服务式办公室,价格影响选择
  13. 电脑运行应用程序出现0xc000007b的解决方法
  14. python输出乘法式子(HLOJ)(完整解析)
  15. Acpi 和 apm
  16. 工业虚拟仿真软件系统解决方案
  17. Pinyin4j生成城市编码和简码
  18. 白盒测试基础知识(概念、目的、方法、工具)
  19. XX移动SUN F280R一次系统恢复备份过程
  20. CRC的校验原理及硬件、软件算法实现

热门文章

  1. Postgresql SP-Gist索引
  2. 平凡的世界-少安少平
  3. 理解变分自编码器,GAN的近亲
  4. 苹果6LMAP服务器没响应,qq邮箱在苹果手机上登录提示lmap.qq.com无响应
  5. 电子发票服务器维护,电子发票来了!你关心的问题都在这里!
  6. 代码实现照片素描_我的代码素描之旅
  7. 一键下载网页所有图片(含dataurl格式图片)
  8. Windows命令行的基础操作
  9. IP防尘防水等级测试标准
  10. 详解u盘怎么重装系统win7,u盘一键安装win7