This tool performs SM4 encryption and decryption with local browser-side processing, supporting multiple modes and format conversions.
Key Features
- Modes:
ECB,CBC, andCTR - Generate random key and IV
- Input/output formats: Text/Base64/Hex/Spaced Hex/C-style Hex
- One-click copy for encryption/decryption result
Steps
- Select mode and prepare key (IV required for CBC/CTR).
- Choose input/output formats.
- Enter plaintext or ciphertext and run encryption/decryption.
- Copy output for integration.
Use Cases
- SM4 interoperability and integration testing
- Local client-side encryption demos
- Learning and validating national symmetric crypto flows
Notes
ECBdoes not use IV, whileCBC/CTRrequires correct IV.- Both sides must use identical mode, key, and IV.
- In production, combine with secure key distribution and storage.