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

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.

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

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Custom Error Queue Name when using EasyNetQ for RabbitMQ?(使用 EasyNetQ for RabbitMQ 时自定义错误队列名称?)
Rabbitmq Ack or Nack, leaving messages on the queue(Rabbitmq Ack 或 Nack,将消息留在队列中)
Wait for a single RabbitMQ message with a timeout(等待一条带有超时的 RabbitMQ 消息)
Setup RabbitMQ consumer in ASP.NET Core application(在 ASP.NET Core 应用程序中设置 RabbitMQ 消费者)
How do I set a number of retry attempts in RabbitMQ?(如何在 RabbitMQ 中设置重试次数?)
WebClient set headers(WebClient 设置标头)