<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>dh on SecDoc</title>
    <link>https://secdoc.jazor.net/tags/dh/</link>
    <description>Recent content in dh on SecDoc</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-cn</language>
    <copyright>© 2026 黑豆子</copyright>
    <lastBuildDate>Fri, 05 Jun 2026 00:06:48 +0800</lastBuildDate><atom:link href="https://secdoc.jazor.net/tags/dh/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>OpenSSL dhparam 命令详解：生成和验证 DH 参数</title>
      <link>https://secdoc.jazor.net/posts/openssl-dhparam-command-usage/</link>
      <pubDate>Fri, 05 Jun 2026 00:06:48 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-dhparam-command-usage/</guid>
      <description>在使用 Diffie-Hellman（DH）密钥交换实现前向保密（PFS）时，DH 参数是必不可少的基础组件。本文详细介绍 OpenSSL dhparam 命令的用法，帮助你生成、验证和管理 DH 参数。
什么是 DH 参数？ DH 密钥交换的安全性依赖于两个数学参数：大素数 P 和生成元 G。这两个参数构成 DH 参数组，决定了密钥交换的安全强度。
P（素数）：一个安全的大素数，作为模数 G（生成元）：一个整数，用于生成密钥交换所需的数学运算 基本用法 生成 DH 参数 生成指定位数的 DH 参数是最常用的操作：
1 2 # 生成 2048 位 DH 参数 openssl dhparam -out dhparam.pem 2048 这个命令会生成一个 2048 位的安全素数参数组。生成过程可能需要一些时间，因为需要找到合适的素数。
使用不同生成元 默认情况下，OpenSSL 使用生成元 2。你可以指定其他生成元（2、3 或 5）：
1 2 3 4 5 6 7 8 # 使用生成元 2（默认） openssl dhparam -out dhparam.pem -2 2048 # 使用生成元 3 openssl dhparam -out dhparam.</description>
    </item>
    
  </channel>
</rss>
