K029 / Cipher modes and AEAD
AES-CCM
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.
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.Output
Previous state
- 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
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
- Recommendation for block cipher modes of operation: the CCM mode for authentication and confidentiality ↗
- Implementation on FPGA - 2022.2 English ↗
- iSEC Partners, Inc 123 Mission Street, Suite 1020 San Francisco, CA 94105 ↗
- On the Security of the CCM Encryption Mode ↗
- NIST to Revise Special Publications 800-38B, "CMAC" and 800-38C, "CCM" | NIST ↗
- The CCM Mode of Operation (NIST SP 800-38C): Counter Mode with CBC-MAC | AccessDenied ↗
- SP 800-38C, Recommendation for Block Cipher Modes of Operation: the CCM Mode for Authentication and Confidentiality | CSRC ↗
- Report on the Block Cipher Modes of Operation in the NIST SP 800-38 Series ↗
- aes_ccm - Rust ↗
- crypto (1.3.0) ↗
- Modern modes of operation for symmetric block ciphers - PyCryptodome ↗
- A Critique of CCM ↗