非对称加密算法RSA公钥私钥的模数和指数提取方法
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
·
生成非对称加密算法RSA公钥、私钥的方法:
1. 通过OpenSSL库生成,可参考 https://github.com/fengbingchun/OpenSSL_Test/blob/master/demo/OpenSSL_Test/funset.cpp 中的Generate_RSA_Key函数;
2. 在Linux下通过命令生成,执行:
ssh-keygen -t rsa
3. 通过网页 http://web.chacuo.net/netrsakeypair 中的RSA密钥对按钮
通过已有的公钥和私钥提取模数和指数的方法:
1. Linux下可直接通过命令,公钥提取执行:
openssl rsa -pubin -inform PEM -text < pub.key
私钥提取执行:
openssl rsa -inform PEM -text < pri.key
结果如下图:注意:模数需要去除Modulus下的第一个字节即00,公钥和私钥提取的模数和指数都是相同的,只是私钥会有额外的信息输出。


2. 通过网页http://web.chacuo.net/netrsakeypair 中的Rsa公私钥解析按钮,结果如下图,与Linux结果一致:

A beautiful web dashboard for Linux
最近提交(Master分支:4 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐



所有评论(0)