<?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>sm4 on SecDoc</title>
    <link>https://secdoc.jazor.net/tags/sm4/</link>
    <description>Recent content in sm4 on SecDoc</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-cn</language>
    <copyright>© 2026 黑豆子</copyright>
    <lastBuildDate>Sat, 06 Jun 2026 00:07:22 +0800</lastBuildDate><atom:link href="https://secdoc.jazor.net/tags/sm4/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>OpenSSL SM4 加密算法使用指南</title>
      <link>https://secdoc.jazor.net/posts/openssl-sm4-encryption-guide/</link>
      <pubDate>Sat, 06 Jun 2026 00:07:22 +0800</pubDate>
      
      <guid>https://secdoc.jazor.net/posts/openssl-sm4-encryption-guide/</guid>
      <description>SM4 是中国国家密码管理局发布的分组密码算法，于 2006 年正式发布为行业标准。2012 年被采纳为国家标准（GB/T 32907-2016），2021 年成为 ISO/IEC 标准（ISO/IEC 18033-3:2010/Amd.1:2021）。
作为国密算法的重要组成部分，SM4 被广泛应用于政府、金融、电信等对数据安全有高要求的领域。本文介绍如何在 OpenSSL 中使用 SM4 算法进行数据加密。
环境要求 OpenSSL 3.0 及以上版本原生支持 SM4 算法，无需额外安装 GmSSL。
1 openssl version 输出：
1 OpenSSL 3.0.19 27 Jan 2026 (Library: OpenSSL 3.0.19) 查看支持的 SM4 模式：
1 openssl list -cipher-algorithms | grep SM4 输出：
1 2 3 4 5 6 sm4 =&amp;gt; SM4-CBC SM4-CBC SM4-CFB SM4-CTR SM4-ECB SM4-OFB 支持的模式包括：CBC、CTR、CFB、OFB、ECB。
⚠️ 注意：不推荐使用 ECB 模式，因为它会产生相同的密文块，容易泄露数据模式。
SM4-CBC 加密解密 SM4-CBC 是最常用的模式，结合 PKCS#5/PKCS#7 填充实现安全加密。</description>
    </item>
    
  </channel>
</rss>
