SM in the Wild: Measuring Security-Semantics Failures in Chinese Commercial Cryptography Implementations

Chinese commercial cryptography (Guomi: SM2, SM3, SM4) exposes security inputs international APIs and misuse taxonomies omit: the signer's identity, the curve and the ciphertext arrangement. We call this gap *contract impedance mismatch* and measure its consequences in published software, not deployments. We build an executable SM2/SM3/SM4 oracle calibrated against four GB/T standards and two Bouncy Castle defects. Across 794 npm packages, 83 Maven artifacts and 59 Gitee repositories we find 147 adjudicated rows, 144 admitted package-frame pairs; recorded replay supports 140 (14 caveated; §5). Confirmation is single-author and LLM-assisted, not independent human validation. One recorded finding grouping contributes 54 of 124 npm defect rows. It is no verified lineage: recorded, code-matched and construct-based memberships differ. By finding key: 64 keys, 27 at L5; that grouping is one key. Conversion is **56.6%** on npm (124 of 219 candidates); removing grouping numerator rows gives 32.0% (a counting scenario, not remeasurement; §6.1). A JCA SM4 provider replaces caller-supplied IVs with a constant in four modes; a key agreement returns a constant SM4 key. Every demonstrated confidentiality break is a generic defect of this kind - known key, fixed IV, non-cryptographic randomness; the Guomi-specific categories yield conformance defects and permitted-but-weak defaults. Four detector families find 7 of a curated 28-finding cohort, all via hard-coded keys; none flags any Guomi-specific property. On 88 seeded defects our literal screen localises 37.5%, Semgrep's semantic screen 6.8%; neither localises the 12 provider-contract defects. Constant screens find implementations, not uses; a frame's membership rate must precede its precision. Prepared for submission to USENIX Security 2027 (Cycle 2). Artefacts whose findings are not already public are pseudonymized (U1-U59) per the paper's Ethical Considerations section.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-10-28
DOI
https://doi.org/10.5281/zenodo.23716986
Primary Topic
Cryptographic Implementations and Security
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

SM in the Wild: Measuring Security-Semantics Failures in Chinese Commercial Cryptography Implementations

Juwan Hwang
Zenodo (CERN European Organization for Nuclear Research)
Cryptographic Implementations and Security
preprint

SM in the Wild: Measuring Security-Semantics Failures in Chinese Commercial Cryptography Implementations

Juwan Hwang
preprint en

Abstract

Chinese commercial cryptography (Guomi: SM2, SM3, SM4) exposes security inputs international APIs and misuse taxonomies omit: the signer's identity, the curve and the ciphertext arrangement. We call this gap *contract impedance mismatch* and measure its consequences in published software, not deployments. We build an executable SM2/SM3/SM4 oracle calibrated against four GB/T standards and two Bouncy Castle defects. Across 794 npm packages, 83 Maven artifacts and 59 Gitee repositories we find 147 adjudicated rows, 144 admitted package-frame pairs; recorded replay supports 140 (14 caveated; §5). Confirmation is single-author and LLM-assisted, not independent human validation. One recorded finding grouping contributes 54 of 124 npm defect rows. It is no verified lineage: recorded, code-matched and construct-based memberships differ. By finding key: 64 keys, 27 at L5; that grouping is one key. Conversion is **56.6%** on npm (124 of 219 candidates); removing grouping numerator rows gives 32.0% (a counting scenario, not remeasurement; §6.1). A JCA SM4 provider replaces caller-supplied IVs with a constant in four modes; a key agreement returns a constant SM4 key. Every demonstrated confidentiality break is a generic defect of this kind - known key, fixed IV, non-cryptographic randomness; the Guomi-specific categories yield conformance defects and permitted-but-weak defaults. Four detector families find 7 of a curated 28-finding cohort, all via hard-coded keys; none flags any Guomi-specific property. On 88 seeded defects our literal screen localises 37.5%, Semgrep's semantic screen 6.8%; neither localises the 12 provider-contract defects. Constant screens find implementations, not uses; a frame's membership rate must precede its precision. Prepared for submission to USENIX Security 2027 (Cycle 2). Artefacts whose findings are not already public are pseudonymized (U1-U59) per the paper's Ethical Considerations section.

Zenodo (CERN European Organization for Nuclear Research)
Shanghai Maritime University (CN)
Cryptographic Implementations and Security
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
SM in the Wild: Measuring Security-Semantics Failures in Chinese Commercial Cryptography Implementations — Juwan Hwang · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS