在传输过程中保护 RSA 公钥

发布于 2024-12-23 03:05:53 字数 457 浏览 4 评论 0原文

*澄清:我的问题涉及在两方之间建立“安全”通信通道,其中密钥(读取密码)已在现实世界中达成一致。仅使用 RSA 才允许 MITM 攻击(如果我没有记错的话),因此我正在考虑使用 AES 加密公钥(双方都同意的密钥),然后再将它们发送给各方*

目前正在尝试构建两个相互通信的应用程序。为了保护交换的消息,我正在考虑使用 RSA,其中每个应用程序都有自己的一组密钥。

在两个应用程序之间开始通信之前,它们确实需要交换密钥。这不应该是一个问题,但我正在考虑使用 AES 来加密公钥,然后再通过互联网发送它们。

我知道“公共”一词(如公共密钥)的含义,但我认为这将确保正确的应用程序/计算机获得密钥,而没有其他人获得密钥。

所以我想交换密钥并保护它们免受中间人攻击。

如果有人能给出更好的建议(顺便说一句,我正在使用 LibCrypto 库),我会洗耳恭听。

谢谢。

此致 /托马斯·古斯塔夫森

*Clarification: My question relates to setting up a "secure" communication channel between two parties where a key (read passphrase) has been agreed upon in the real world. Only using RSA allows for MITM-attacks (if I'm not misstaken), so I was thinking encrypting the public keys with AES (the key that both have agreed upon) before sending them to respective parties *

I'm currently trying to build two applications that talks with eachother. To secure the exchanged messages I was thinking on using RSA where each application has it's own set of keys.

Before communication is started between the two applications they do need to exchange keys. That shouldn't be a problem but I was thinking on using AES to encrypt the public keys before sending them over the internet.

I know what the word public (as in public key) means but I was thinking that this would see to that the right application/computer gets the key and no one else.

So I want to exchange keys and to protect them from MITM attacks.

If anybody could give a better suggestion (I'm using the LibCrypto library btw), I'm all ears.

Thank you.

Best regards
/Tomas Gustavsson

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执妄 2024-12-30 03:05:53

这个问题表明你有很多误解。

我知道“公共”这个词(如公共密钥)的含义,但我是
认为这将确保正确的应用程序/计算机
拿到钥匙,没有其他人。

我认为这是您遇到并询问的真正问题。
我认为:你怎么知道你正在使用你真正想要与之通信的实体的公钥,而不是声称是你想要与之通信的恶意实体的公钥?

此问题在典型安装中通过由可信机构签名并颁发给特定实体(即 IP 或 DNS 名称)的证书来解决。

就您而言,您没有提供证书的任何详细信息。

您也可以手动预安装它们并将它们用于安全连接。

如果您遵循其他计划,例如对称加密,那么您会开始问其他问题,例如如何安全地共享密钥等

This question shows many misconceptions from your part.

I know what the word public (as in public key) means but I was
thinking that this would see to that the right application/computer
gets the key and no one else.

I think this is the real problem you have and ask.
Which I think is: How can you know that you are using the public key of the entity you actually want to communicate with and not the public key of a malicious entity claiming to be the who you want to communicate with?

This problem is solved in a typical installation by certificates signed by a trusted authority and issued to the specific entity i.e. IP or DNS name.

In your case you haven't given any details of your certificates.

You could just as well manually pre-install them and use them for your secure connections.

If you follow some other plan e.g. symmetric encryption then your would start asking other questions e.g. how do you securely share the secret key etc

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文