gpt4 book ai didi

diffie-hellman - 如何利用Diffie-hellman进行中间人攻击

转载 作者:行者123 更新时间:2023-12-03 22:44:50 25 4
gpt4 key购买 nike

我正在做一个项目,Alice 和 Bob 使用 Diffie-Hellman key 交换相互发送消息。让我陷入困境的是如何将他们正在使用的证书合并到其中,以便我可以获得他们的 secret 消息。

根据我对 MIM attakcs 的理解,MIM 充当冒名顶替者,如下图所示:

enter image description here

以下是我的项目的详细信息。我知道他们在交流之前都同意了 g 和 p ,但是我如何能够在他们都有证书来验证他们的签名的情况下实现这一点?

Alice 准备 ⟨signA(NA, Bob), pkA, certA⟩ 其中 signA 是 Alice 使用的数字签名算法,“Bob”是 Bob 的名字,pkA 是 Alice 的公钥,它等于根据 X 编码的 gx mod p。 509 对于固定的 g,在 Diffie-Hellman key 交换中指定的 p,certA 是 Alice 的证书,其中包含 Alice 验证签名的公钥;最后,NA 是一个 8 字节长的随机数(随机字符串)。

Bob 检查 Alice 的签名,并使用 ⟨signB{NA,NB,Alice},pkB,certB⟩ 进行响应。 Alice 得到消息,她检查她的 nonce NA,并根据 Diffie-Hellman key 交换基于 pkA、pkB 计算联合 key 。然后 Alice 将消息 ⟨signA{NA,NB,Bob},EK(MA),certA⟩ 提交给 Bob,Bobrespondswith⟨SignB{NA,NB,Alice},EK(MB),certB⟩。

其中 MA 和 MB 是它们对应的 secret 消息。

最佳答案

提供 the Wikipedia answer :

In the original description, the Diffie–Hellman exchange by itselfdoes not provide authentication of the communicating parties and isthus vulnerable to a man-in-the-middle attack. A person in the middlemay establish two distinct Diffie–Hellman key exchanges, one withAlice and the other with Bob, effectively masquerading as Alice toBob, and vice versa, allowing the attacker to decrypt (and read orstore) then re-encrypt the messages passed between them.

A method toauthenticate the communicating parties to each other is generallyneeded to prevent this type of attack. Variants of Diffie-Hellman,such as STS, may be used instead to avoid these types of attacks.


你可以考虑通过讨论 the variants of Diffie-Hellman that are more secure 给你的教授留下深刻印象.现在,鉴于您已经注意到原始实现,这将起作用。
祝你好运!

关于diffie-hellman - 如何利用Diffie-hellman进行中间人攻击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9953187/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com