SYSEC WebTools

SM4 Encryption

GCM: 12 bytes (24 hex characters); CBC: 16 bytes (32 hex characters). Never reuse a nonce with the same key. Decryption requires the original IV.

AAD is authenticated but not encrypted and must match during decryption. Encryption fills the tag automatically; preserve the original tag for decryption.

Switching between encrypt and decrypt swaps the input and output encodings, keeping the key, IV, tag, and AAD unchanged.

This developer testing tool is not a certified cryptographic product or a replacement for production key management.

How to use

Generate or enter a 16-byte key, choose an input encoding, and encrypt. Keep the key, IV, ciphertext, and GCM tag. To decrypt, supply these parameters and the same AAD. Input is limited to 1 MiB; file encryption is not supported.