aes-256-ccm encrypt & decrypt online

Encrypt or decrypt text with aes-256-ccm and a secret. Nothing leaves your browser.

This mode needs an authentication tag.
Runs in your browser

PHP's openssl_encrypt needs a tag variable for this mode and returns no result without it. Like on the old site, the result stays empty. For working encryption use aes-256-cbc.

In short

What is aes-256-ccm?

AES is the block cipher NIST standardised in 2001 (FIPS 197), originally called Rijndael. It is the most widely used cipher today and has no practical attack. AES-256-CCM is authenticated encryption: besides the ciphertext it produces a tag that proves nobody changed it. In PHP it needs a tag variable, so this tool, like the old site, gives no result.

Strong cipherAES (Rijndael): No practical attack on the cipher itself is known.
Where you meet AES
  • HTTPS and TLS
  • Wi-Fi (WPA2, WPA3)
  • Disk encryption: BitLocker, FileVault, LUKS
  • VPNs, ZIP and 7-Zip archives, password managers
Honest answer

Is it safe to use?

The cipher: strong cipher

AES. No practical attack on the cipher itself is known.

This setup: for compatibility

The setup of this tool is made for compatibility with PHP's openssl_encrypt, not for protecting secrets: the IV is always zero, the secret is used as the key without a key derivation function, and nothing detects changes to the ciphertext.

For real secrets use an authenticated mode such as AES-256-GCM or ChaCha20-Poly1305 with a fresh random nonce for every message, and derive the key from a password with Argon2id, scrypt or PBKDF2. What is a key derivation function?

Authenticated encryption (AEAD)

How authenticated modes work

Authenticated modes (GCM, CCM, OCB, Poly1305) encrypt and at the same time compute a tag over the data. Decryption checks the tag first and fails if anything was changed. This is what you want for real encryption.

PHP's openssl_encrypt only returns a result for these modes if you pass a variable for the tag and a nonce. The old site did neither, so the result was always empty, and this tool keeps it that way.

Common mistakes

Why aes-256-ccm gives no result

Why the result is empty

Authenticated modes need a nonce and produce a tag. PHP's openssl_encrypt returns false when you don't pass a tag variable, and the old site didn't. See the code example for how to use the mode correctly.

Reusing a nonce

In GCM, the same nonce twice with the same key reveals the XOR of the two texts and lets an attacker forge tags. Use 12 random bytes per message, or a counter that never repeats.

Throwing away the tag

The 16-byte tag is part of the message. Store or send it together with the nonce and the ciphertext; decryption without it is impossible, and skipping the check gives up the protection.

Which cipher was it?

Encrypted something here years ago?

Paste the Base64 result and the secret. Your browser tries all 174 ciphers of this site and shows those that give readable text. Useful if you don't remember the cipher, or to check whether your ciphertext really is aes-256-ccm.

Nothing is sent anywhere. Wrong secrets give no readable text.
Compare

Every AES-256 variant, same input

The text The quick brown fox jumps over the lazy dog (43 bytes) with the secret my secret in all 19 AES-256 ciphers. The last column lists names that give the same result: aliases, and modes that agree for this input. Highlighted: the same start as aes-256-ccm. Watch how CBC and ECB share the first block, and CFB, OFB and CTR the first 16 bytes. Type a text and a secret in the tool above to use yours.

CipherResult (Base64)Same as
aes-256-cbc oV3RJ8KJkJ8RE7zaMmiC3IvqaRrBXzj1Yz1LI+TEjH66KfwmN6R6qHzKZHVs2zeWaes-256-cbc-hmac-sha1, aes-256-cbc-hmac-sha256, aes256
aes-256-cbc-hmac-sha1 oV3RJ8KJkJ8RE7zaMmiC3IvqaRrBXzj1Yz1LI+TEjH66KfwmN6R6qHzKZHVs2zeWaes-256-cbc, aes-256-cbc-hmac-sha256, aes256
aes-256-cbc-hmac-sha256 oV3RJ8KJkJ8RE7zaMmiC3IvqaRrBXzj1Yz1LI+TEjH66KfwmN6R6qHzKZHVs2zeWaes-256-cbc, aes-256-cbc-hmac-sha1, aes256
aes-256-ccm no result
aes-256-cfb 1ktyGwyrPTtkgyEyM7E0vd7s0sNfMxpZ1+JmL66k6iOQDRetJtUIxxMdXg==
aes-256-cfb1 xnZa43U4+GFN07PHLjjTWL93kLi0GAONkmwZ2ChIWqMhmJDGKHELQvjZqQ==
aes-256-cfb8 1k1yiacKd98o6mj9e4XQmYHTVMKzNCt+tpLZWdnYo3GXQW1R+jdFJc5/8A==
aes-256-ctr 1ktyGwyrPTtkgyEyM7E0vQLKxTEZHxPxUe5qC3Z5g5i4uVLf/iFZqWMTPA==
aes-256-ecb LegacyoV3RJ8KJkJ8RE7zaMmiC3FGyw0egBuzK22+UB+wjL1x957WvwKfkmU0DQekRltBh
aes-256-gcm no result
aes-256-ocb no result
aes-256-ofb 1ktyGwyrPTtkgyEyM7E0veMveBwf24cCnL4wm6FGkvqIJsJlhyZEOlt1Ow==
aes-256-xts f5eVcJyT+UmSHL+ofoaYWABwFrKp62H6idKb0pdKw+vAnBxMpZyHb8MbJA==
aes256 oV3RJ8KJkJ8RE7zaMmiC3IvqaRrBXzj1Yz1LI+TEjH66KfwmN6R6qHzKZHVs2zeWaes-256-cbc, aes-256-cbc-hmac-sha1, aes-256-cbc-hmac-sha256
aes256-wrap no result
id-aes256-ccm no result
id-aes256-gcm no result
id-aes256-wrap no result
id-aes256-wrap-pad tk28ra1iLSVR4bLEB5vUiHgPkrA4Sxc4iXlhTK/5xgwnwK9SS39Ysij8omADCyGcqoxCQXdsRWQ=
FAQ

Questions about aes-256-ccm

Why is the aes-256-ccm result empty?

Because PHP's openssl_encrypt returns false for authenticated modes when no tag variable is passed, and the old site passed none. The tool keeps that behaviour so old results stay comparable. Use the code example to encrypt with a nonce and tag.

Is AES-256-CCM secure?

Yes, when used correctly: AES-256-CCM with a random, never repeated nonce and the tag checked on decryption is a recommended way to encrypt data today.

Good to know

Before you rely on it

Searches the list of pages on this site. What you type stays in your browser.