← Cryptography guide

K029 / Cipher modes and AEAD

AES-CCM

CCM mode · Survey date 2026-12-05

CCM is a block cipher mode defined to provide confidentiality and authenticity.

CRYPTOGRAPHY LAB / K029

Cryptography Lab · AES-CCM

Run real computations and inspect intermediate states step by step.

Educational only. Never enter real passwords or secret keys. Computation stays in your browser; input and trace values are not sent to a server. Do not use this implementation in production.

Scope: Limited implementation

AES-CCM (13-byte nonce, empty AAD, 16-byte tag)

See the scope above for fixed examples, reduced parameters and supported variants. Standard operation names and formulas are retained.

Reference ↗

Open lab →

Definition and overview
CCM is a block cipher mode defined to provide confidentiality and authenticity. Source document ↗
Classification and reversibility
An encryption mode whose implementations also support decryption. Source document ↗
Key or secret requirements
Requires a key for an approved symmetric block cipher such as AES. Source document ↗
Operating principle and structure
Combines CTR encryption with CBC-MAC integrity authentication. Source document ↗
Key size, block size and parameters
128/192/256-bit AES keys and 128-bit blocks. Source document ↗
Security strength and recommendation
NIST has decided to revise the CCM standard; revision is underway. Source document ↗
Known attacks and vulnerabilities
Repeated nonces under one key immediately compromise confidentiality. Source document ↗
Standards and certification
Defined in NIST SP 800-38C. Source document ↗
Typical uses
Used as an AEAD supported by TLS 1.3. Source document ↗
Implementations, libraries and tools
Implementations include RustCrypto aes-ccm. Source document ↗
Decryption or decoding
Call the decryption API with the same key, nonce, AAD and tag length. Source document ↗
Advantages
Combines encryption and authentication into one efficient primitive. Source document ↗
Limitations and cautions
Variable tag length can create security risks if implemented carelessly. Source document ↗
Distinguishing encryption, encoding and hashing
CCM is AEAD (encryption plus authentication), not encoding or hashing. Source document ↗

Practical examples

Examples are illustrative; they are not execution-tested implementations or operational recommendations.

Example

Sender supplies key, nonce, plaintext and AAD to AES-CCM to obtain ciphertext and tag. Receiver decrypts with identical parameters and discards plaintext on failed tag verification. Manage keys/nonces with secure randomness or counters, not example values.

Procedure

Encrypt with key, nonce, AAD and plaintext to obtain ciphertext/tag; decrypt and verify with the same key, nonce, AAD and tag. Base64 is separate keyless encoding; hashes cannot be decrypted.

Scenario

Provides confidentiality and integrity in protocols such as TLS 1.3; suitable for storage/transmission where headers require authentication as AAD, such as firmware or packets.

Pitfalls and alternatives

Never reuse nonces; choose tag lengths carefully; prefer vetted AEAD libraries. Distinguish from Base64/URL encoding and SHA. Never use plaintext after failed tag verification.

References