Skip to main content

Cryptography & Ciphers

SM4 Encryption

Apply SM4 Encrypt with explicit key, format, and algorithm settings. Enter the data and key material, choose the parameters, then review the result.

Tool workspace

Your input stays in this browser.

Add the required input to continue.

Needs input

You can run the tool again after any change.

Options

Your result appears here

Apply SM4 Encrypt with explicit key, format, and algorithm settings. Enter the data and key material, choose the parameters, then review the result.

This tool runs open-source code from CyberChef by GCHQ (Apache License 2.0). See open-source credits.

SM4 Encryption uses SM4 block encryption to process the supplied input. It returns ciphertext for the supplied plaintext bytes. The mode list includes CBC/NoPadding and ECB/NoPadding, rather than a separate Padding control.

It returns ciphertext for the supplied plaintext bytes. The mode list includes CBC/NoPadding and ECB/NoPadding, rather than a separate Padding control. Processing runs in the browser for this catalog category, so the result depends on the supplied bytes and settings. Processing runs in the browser.

This tool performs the selected algorithm locally; it does not provide application trust or key management.

Instructions

  1. Provide text or data for this tool.
  2. Use disposable test material; the zero IV is only a reproducible example. This applies to SM4 Encryption.
  3. Keep the complete ciphertext and settings for the paired decrypt operation. This applies to SM4 Encryption.

Example

Input: Use ASCII abc, CBC, key 000102030405060708090a0b0c0d0e0f in Hex, and an all-zero 16-byte IV.

Settings: SM4 Encryption: Key length: 16 bytes. Non-ECB IV length: 16 bytes. CBC and ECB apply padding unless their /NoPadding variants are selected. Input: Raw; Output: Hex for a transferable ciphertext fixture.

Result: It returns ciphertext for the supplied plaintext bytes. The mode list includes CBC/NoPadding and ECB/NoPadding, rather than a separate Padding control. Processing runs in the browser for this catalog category, so the result depends on the supplied bytes and settings.

Limits

  • SM4 Encryption: 16-byte blocks determine alignment requirements when padding is disabled.
  • SM4 Encryption: These modes do not add an authentication tag or manage keys.