如何将 Diffie-Hellman 密钥交换推广到三方或更多方?

How to generalize the Diffie-Hellman key exchange to three or more parties?

我知道如何在 2 方之间进行密钥交换,但我需要能够在 3 方或更多方之间达成密钥协议。

可能比两个复杂一点

考虑一个有 N 人的循环。每个编号为 1, 2, 3, ..., N。他们共享相同的 PG。每个人都有自己的ai号码。现在每个人都自己计算Ga,并将结果发送给下一个。然后大家计算值G1a 其中G 1是前人给的值。重复这个过程N次,每个人都有相同的数GN = Ga1a2...aN .

伪代码:

import G, P from public
generate a
send pair{pow(G, a, P), 1} to next person
for i = 1 to N-1:
  receive pair{Gx, x} from previous person
  if x = N:
    key = Gx
  else
    send pair{pow(Gx, a, P), x+1} to next person
return key