SM4 Encrypt/Decrypt - Chinese Block Cipher Online Tool
100% LocalOnline SM4 block cipher tool: ECB/CBC modes, PKCS#7 padding, random key generation with visibility toggle. 128-bit blocks, the Chinese national alternative to AES-128. Fully local, nothing uploaded.
TL;DR: Online SM4 block cipher: ECB/CBC modes, key generation, the Chinese alternative to AES-128.
This tool runs entirely in your browser. Open DevTools → Network panel and search your input — it appears in no request.
FAQ
Same role: block ciphers. SM4 uses fixed 128-bit blocks and keys (comparable to AES-128); AES offers key-size options. Chinese compliance requires SM4; everywhere else AES. Hardware-accelerated AES is faster; SM4 has acceleration in certified Chinese crypto hardware.
Always prefer CBC (with a random IV): ECB encrypts identical blocks identically, leaking data patterns (the penguin image classic). CBC only when IV transport is impossible.
A 32-hex-char string for the 128-bit key (e.g. 0123456789abcdeffedcba9876543210). CBC also needs a 32-hex-char IV. Use the generate button for CSPRNG keys.
Designed for learning and short payloads (a few KB). For large files, use streaming modes or a dedicated crypto library — very long inputs will jank the UI.
Related Articles
SM3 vs SHA-256: Comparing the Chinese and NIST Hash Algorithms
SM3 versus SHA-256: same 256-bit digest strength, structural similarities (Merkle-Damgård), the standard test vectors for integration debugging, hardware acceleration differences, when Chinese compliance mandates SM3, and HMAC's algorithm-agnostic construction.
Chinese National Cryptography (SM2/SM3/SM4/SM9/ZUC): A Developer's Introduction
Introduction to China's commercial cryptography standards: what SM2, SM3, SM4, SM9 and ZUC each do, how they map to RSA/SHA/AES, the TLCP GM-TLS protocol, compliance drivers (等保, government, finance), library landscape (BouncyCastle, sm-crypto, Tongsuo), and online tools for hands-on learning.
AES Encryption in the Browser: A Practical Guide to Web Crypto API
Learn AES encryption in JavaScript using the Web Crypto API. Complete AES-256-GCM encrypt/decrypt example with PBKDF2 key derivation, all running client-side.