给定一个私钥,是否可以导出它的公钥?

Given a private key, is it possible to derive its public key?(给定一个私钥,是否可以导出它的公钥?)
本文介绍了给定一个私钥,是否可以导出它的公钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我通过阅读各种材料所了解的一点点,公私钥对是非对称加密的基础,也是选择 2 个素数(大致是您的私钥)并将它们相乘(大致是您的公钥)的基础).在我看来,如果您知道私钥,则可以生成公钥.是正确的还是我弄错了什么?

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

让我更困惑的是,无法使用 only 私钥(使用 .NET 类 RSACryptoServiceProvider)将 RSA 密钥序列化为 XML.不知道这个限制是不是故意的!

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.

对于Elliptic Curve 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.

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)