<?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>cipher on SecDoc</title>
    <link>https://secdoc.jazor.net/tags/cipher/</link>
    <description>Recent content in cipher on SecDoc</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-cn</language>
    <copyright>© 2026 黑豆子</copyright>
    <lastBuildDate>Thu, 23 Apr 2026 00:08:06 +0800</lastBuildDate><atom:link href="https://secdoc.jazor.net/tags/cipher/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>TLS 完美前向保密（PFS）深度解析</title>
      <link>https://secdoc.jazor.net/posts/perfect-forward-secrecy-guide/</link>
      <pubDate>Thu, 23 Apr 2026 00:08:06 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/perfect-forward-secrecy-guide/</guid>
      <description>完美前向保密（Perfect Forward Secrecy, PFS）是现代 TLS 连接的核心安全特性。它确保即使服务器的长期私钥在未来被泄露，攻击者也无法解密过去捕获的加密通信。
本文将深入理解 PFS 的工作原理、密钥交换机制差异，以及如何在实战中验证和配置 PFS。
什么是完美前向保密 要理解 PFS，先看一个没有 PFS 的场景：
1 2 3 4 5 6 7 8 Client Server | | | --- ClientHello -------&amp;gt;| | &amp;lt;--- ServerHello --------| (包含服务器 RSA 公钥) | | | -- PreMasterSecret ----&amp;gt;| (用服务器 RSA 公钥加密) | | | &amp;lt;-- Encrypted Data ----&amp;gt;| (双方用派生的会话密钥加密) 在传统的 RSA 密钥交换中，客户端生成一个 PreMasterSecret，用服务器的 RSA 公钥加密后发送。服务器用自己的 RSA 私钥解密。这里的致命问题是：任何人如果记录了这段加密通信，并且在未来获得了服务器的 RSA 私钥，就能解密 PreMasterSecret，进而解密所有历史通信数据。
引入 PFS 后，情况完全不同：
1 2 3 4 5 6 7 8 9 10 Client Server | | | --- ClientHello -------&amp;gt;| | &amp;lt;--- ServerHello --------| (包含服务器临时 ECDHE 公钥) | | | -- Client ECDHE Pub ---&amp;gt;| (客户端临时公钥) | | | (双方各自独立计算共享密钥，不通过网络传输) | | | &amp;lt;-- Encrypted Data ----&amp;gt;| (通信结束后临时密钥立即销毁) 使用 ECDHE 或 DHE 等临时密钥交换时，每次连接都会生成一对新的临时密钥。双方通过 Diffie-Hellman 计算得到一个共享密钥，这个密钥从未在网络上传输过，并且在连接结束后就被销毁。</description>
    </item>
    
    <item>
      <title>AES 分组加密模式详解：ECB、CBC、CTR、GCM</title>
      <link>https://secdoc.jazor.net/posts/aes-block-cipher-modes/</link>
      <pubDate>Fri, 17 Apr 2026 00:00:00 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/aes-block-cipher-modes/</guid>
      <description>深入解析 AES 分组加密的四种工作模式：ECB、CBC、CTR、GCM，理解各模式的原理、安全性和适用场景。</description>
    </item>
    
  </channel>
</rss>
