Skip to content

Shangmi

March 24, 2025
February 20, 2025

A suite of authentication, encryption, and hash algorithms from the People's Republic of China.

PKI - 一文读懂SM1、SM2、SM3、SM4等国密算法-腾讯云开发者社区-腾讯云
国密即国家商用密码管理办公室认定的国产密码算法。主要有SM1,SM2,SM3,SM4。密钥长度和分组长度均为128位。
国密算法是指国家密码管理局认定的一系列国产密码算法,包括SM1-SM9以及ZUC等。其中

其中SM1、SM7算法不公开,调用该算法时,需要通过加密芯片的接口进行调用

Standard

商用密码标准研究院 PQC
中国商用密码算法标准概况----商用密码标准研究院

标准规范查询_国家商用密码管理办公室

国家标准全文阅读|标准检索 GB/T 15843 Entity authentication
国家标准|GB/T 15843.2-2017 symmetric encryption
国家标准|GB/T 15843.2-2024 authenticated encryption
国家标准|GB/T 15843.3-2023 digital signature
国家标准|GB/T 15843.4-2024 cryptographic check
国家标准|GB/T 15843.5-2005 zero knowledge techniques

国家标准全文阅读|标准检索 GB/T 15852 Message authentication codes (MACs)
国家标准|GB/T 15852.2-2024 dedicated hash-function
国家标准|GB/T 15852.3-2019 universal hash-function

国家标准全文阅读|标准检索 GB/T 18238 Hash-functions
国家标准|GB/T 18238.2-2024 Hash-functions using a block cipher
国家标准|GB/T 18238.3-2024 dedicated hash-function

Implementation

OpenSSL

OpenSSL added SM2, SM3, SM4 support since 1.1.1i in 2018

OpenSSL 1.1.1 新特性: 全面支持国密SM2/SM3/SM4加密算法_openssl实现的sm3杂凑实例代码-CSDN博客
算法库 | openEuler文档 | openEuler社区 | v22.09
OpenSSL 命令行 SM2 SM3操作 - 天行常

GMSSL

probably obsolete

The GmSSL Project
guanzhi/GmSSL: 支持国密SM2/SM3/SM4/SM9/SSL的密码工具箱

ShangMi SM2

asymmetric cipher based on ECC

Performance Evaluation and Comparison of Standard Cryptographic Algorithms and Chinese Cryptographic Algorithms
On the Design and Performance of Chinese OSCCA-approved Cryptographic Algorithms PDF

ShangMi SM3

SM3 Cryptographic Hash Algorithm: A hash algorithm operating on 512-bit blocks to produce a 256-bit hash value.

国家标准|GB/T 32905-2016
GB/T 32905-2016

ShangMi SM4

symmetric cipher

SM4 (cipher) - Wikiwand

SM4 Block Cipher Algorithm: A Feistel block cipher algorithm with a block length and key length of 128 bits, and 32 rounds. Described in GB/T 32907-2016.