Skip to content

SM4 Encrypt/Decrypt - Chinese Block Cipher Online Tool

100% Local

Online 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.

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

Advertisement