M
Momo Toolbox
Online Tools

Symmetric Encryption - AES-256 / SM4 - Momo Toolbox

Symmetric Encryption

AES-256-GCM/CBC & SM4 local encryption

Symmetric Encryption How to use

Pick encrypt/decrypt, algorithm (AES-GCM recommended / SM4-CBC Chinese standard), key source (password or hex). For encryption, input plaintext to get base64 ciphertext; reverse for decryption.

View full tutorial →

Key sizes: AES 32 bytes (256-bit), SM4 16 bytes (128-bit). Password mode uses PBKDF2-SHA256 (600,000 iterations) + random salt; CBC and SM4-CBC additionally use HMAC-SHA256 integrity checks.

Derives keys via PBKDF2-SHA256 (600,000 iterations); a random salt is embedded in the ciphertext. Your password never leaves the browser.

Implementation Notes:

• All ciphertext is prefixed with v2: and encoded as base64(header + iv + ciphertext + HMAC)

• GCM binds the algorithm and salt/iv via AAD; CBC and SM4-CBC use HMAC-SHA256 for integrity

• Password mode: PBKDF2-SHA256 with 600,000 iterations + random salt embedded in the ciphertext

• GCM is recommended (authenticated); CBC/SM4-CBC are for legacy compatibility

• Legacy ciphertext without the v2: prefix is no longer supported and must be re-encrypted

Symmetric Encryption - Use Cases

The symmetric encryption tool is useful for sensitive data transmission, config file encryption, API key protection, database field encryption, etc. Supports both international AES-256 and Chinese standard SM4: AES for global use, SM4 for compliance with Chinese cryptographic regulations. Both run locally in the browser; keys never leave the device.

Features

FAQ

Will my password be uploaded?

No. All encryption/decryption is done locally in your browser; password and key never leave your device.

How to choose between AES and SM4?

Use AES-256-GCM for international use or when no compliance is required (more secure, authenticated). Use SM4 for Chinese compliance (finance/government/MLPS). Different key lengths: AES 256-bit, SM4 128-bit.

How to choose between GCM and CBC?

GCM is recommended — it has an authentication tag to detect tampering. CBC is mainly for legacy systems; this tool adds an HMAC-SHA256 integrity check on top, but new data should still prefer GCM.

What is the ciphertext format?

Always v2:base64(header + salt? + iv + ciphertext + HMAC?). The header records key source and algorithm; password mode includes a 16-byte salt; GCM binds metadata via AAD, while CBC/SM4-CBC append a 32-byte HMAC-SHA256.

Can legacy ciphertext still be decrypted?

No. Formats before v2 used a weaker key derivation and lacked integrity checks. This version only accepts ciphertext with the v2: prefix; re-encrypt with the same password.

What if decryption fails?

Check: 1) correct password/key 2) algorithm mode matches encryption 3) full ciphertext copied 4) correct key source (password/hex) selected.

Want more details? See the full Symmetric Encryption Tutorial