Encrypt and decrypt data using SM4 — Chinese national standard block cipher (GB/T 32907)
SM4 is a block cipher standard published by the Chinese State Cryptography Administration as GB/T 32907. It is a symmetric block cipher with a 128-bit key and 128-bit block size, widely used in Chinese financial systems, government communications, and WAPI wireless security.
No. All encryption and decryption operations happen entirely in your browser. No data is ever sent to any server. The key, IV, and plaintext remain on your device at all times.
CBC (Cipher Block Chaining) is recommended for most use cases. ECB (Electronic Codebook) encrypts each block independently, which can reveal patterns in the plaintext. CBC uses an IV to add randomness and prevents pattern leakage. Always use CBC unless you have a specific reason to use ECB.