- 爱丽丝和鲍伯协商一个有限循环群 G 和它的一个生成元 g。 (这通常在协议开始很久以前就已经规定好; _g是公开的,并可以被所有的攻击者看到。)
- 爱丽丝选择一个随机自然数 a 并且将 发送给鲍伯。
- 鲍伯选择一个随机自然数 b 并且将 发送给爱丽丝。
- 爱丽丝 计算 。
- 鲍伯 计算 。
TLS generally uses the DH groups specified in RFC7919. The RFC selects the modulii it specifies so that (p−1)/2 is also prime (and so the value g is selects generates a large prime subgroup) - those primes have a number of other nice practical properties. TLS 一般使用 RFC7919 中指定的 DH 组。 RFC 选择它指定的模数,以便 (p−1)/2 也是素数(所以选择的值 g 生成一个大的素数子群) - 这些素数有许多其他很好的实用属性。
In TLS 1.2, the client could specify its own group, however that is not reatly encouraged (both because the client might get it wrong, and because it makes it difficult for the server to do validity checking). 在 TLS 1.2 中,客户端可以指定自己的组,但是并不鼓励这样做(既因为客户端可能会出错,也因为这使得服务器难以进行有效性检查)。
In TLS 1.3, they removed the option to specify your own group, and so the groups in RFC7919 (or an elliptic curve group or a private group) is your only option. 在 TLS 1.3 中,他们删除了指定您自己的组的选项,因此 RFC7919 中的组(或椭圆曲线组或私有组)是您唯一的选择。
程序中使用了:ffdhe2048