给定私钥,是否可以导出其公钥? [英] Given a private key, is it possible to derive its public key?

查看:757
本文介绍了给定私钥,是否可以导出其公钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我通过阅读各种材料理解的任何一点,公私密钥对是非对称加密的基础,也是关于选择2个素数(这大致是你的私钥)和乘以它们(这大致是你的公钥),我似乎可以生成一个公共密钥,如果你知道私钥。是正确的还是我错了?

From whatever little I understand by reading various material, public-private key pair are the basis of assymetric encryption and also something about choosing 2 prime numbers (which is roughly your private key) and multiplying them (which is roughly your public key), I appears that it is possible to generate a public key if you know the private key. Is it correct or I am mistaking something?

不可能使用仅 私钥将RSA密钥序列化为XML(使用.NET类RSACryptoServiceProvider)。不确定此限制是否是有意的。

What made me more confusing was that it is not possible to serialize the RSA key to XML with only private key (using .NET class RSACryptoServiceProvider). Not sure whether this limitation is intentional or not!

推荐答案

这取决于加密系统。

RSA 中,我们有(引用维基百科):

In RSA, we have (citing Wikipedia):


模数n和公共(或加密)指数e。
私钥由模数n和私人(或解密)指数d组成,
必须保密。

The public key consists of the modulus n and the public (or encryption) exponent e. The private key consists of the modulus n and the private (or decryption) exponent d which must be kept secret.

现在,如果我们有n和d(私钥),我们只缺少公钥的e。但e通常相当小(小于三位数),或者甚至是固定的(一个共同的值是65537)。

Now if we have n and d (the private key), we are only missing e for the public key. But e is often fairly small (less than three digits), or even fixed (a common value is 65537). In these cases getting the public key is trivial.

对于椭圆曲线Diffie-Hellman ,私钥是d,公钥是dG (G也是公共的),所以它也是微不足道的。

For Elliptic Curve Diffie-Hellman, the private key is d, and the public key dG (with G also public), so it's trivial as well.

这篇关于给定私钥,是否可以导出其公钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆