AES / SM4 Encryption
Symmetric encryption using AES (128/192/256) in CBC, GCM, ECB modes and SM4-CBC Chinese national standard. All computation in-browser via Web Crypto API.
AES encryption uses the browser's built-in Web Crypto API (hardware-accelerated where available). SM4 uses a pure JavaScript implementation per GMT 0002-2012.
Encryption output is Base64-encoded. For GCM mode, the 16-byte authentication tag is appended to the ciphertext before Base64 encoding. ECB mode does not use an IV.
How to Use
Encrypt: Select algorithm and key size, enter a hex key and IV (or click "Random Key + IV"), type plaintext, click Encrypt. The output is Base64-encoded ciphertext.
Decrypt: Paste Base64-encoded ciphertext into the input field, enter the same key and IV used for encryption, click Decrypt.
Key Format: AES-128 = 32 hex chars, AES-192 = 48 hex chars, AES-256 = 64 hex chars. IV = 32 hex chars for CBC/GCM. SM4 key = 32 hex chars.
Example Use Cases
- Secure messaging — Encrypt messages before transport using AES-256-GCM for authenticated encryption
- Configuration encryption — Encrypt config files or API keys at rest
- Chinese compliance — Use SM4-CBC where Chinese national cryptographic standards are required
- CTF challenges — Quickly test decryption with known keys during security competitions
- Interoperability testing — Verify your backend encryption matches using the same key/IV/plaintext