如何使用 OpenSSL 生成 Diffie-Hellman (DH) 参数
问题:
对于你的 Web 服务器或 VPN 服务器,你想使用唯一的 Diffie-Hellman 参数,但你不知道如何使用 OpenSSL 生成 .pem 文件。
解决方案
使用此命令生成参数并将它们保存在 dhparams.pem 中:
generate-dhparams.sh
openssl dhparam -out dhparams.pem 4096此命令生成 4096 位的 Diffie-Hellman 参数。这提供了良好的安全性,同时仍为现代设备提供非常合理的性能。根据你偏好的偏执程度,你可能想要增加位数。
注意即使"仅"4096 位,生成参数通常也需要几分钟。更大的参数大小可能需要数小时到数天才能生成。确保你在快速计算机上生成参数,而不是在树莓派或类似设备上!
Check out similar posts by category:
Cryptography, Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow