Counter mode encryption
Counter mode encryption generates a keystream by encrypting successive counter values with a block cipher and combines it with plaintext to produce ciphertext.
Real-World Cryptography
AES-CTR is a counter-mode construction that applies AES to successive counter values to generate a keystream or pseudorandom-looking output.
- How it is used
- Encrypts plaintext as the counter-mode component used by AES-GCM.
- How deep it goes
- Explains nonce construction, counters, keystream XOR, truncation, capacity, and nonce-reuse failure without implementation detail.
- Examples
- Uses 96-bit nonces, 32-bit counters, 16-byte blocks, keystream truncation, and repeated-nonce ciphertext comparison.
- What you can do after
- Operate AES-CTR by generating nonce-counter keystream blocks, XORing them with plaintext, and avoiding nonce reuse.
Read how Real-World Cryptography explains counter mode encryption →
Hacking Cryptography
Counter mode encrypts successive counter values with a block cipher to generate a keystream that is combined with plaintext.
- How it is used
- Uses a block cipher to produce a keystream for encrypting successive plaintext blocks.
- How deep it goes
- Defines keystream generation and plaintext combination, but does not provide implementation steps or attack analysis.
- Examples
- Uses a keystream-generation diagram to contrast stream-cipher processing with direct block-cipher ciphertext output.
- What you can do after
- Evaluate how block-cipher processing can emulate keystream-based encryption across multiple plaintext blocks.
Read how Hacking Cryptography explains counter mode encryption →
Related concepts
- stream cipherimplements · A stream cipher is an encryption algorithm that combines plaintext sequentially with a generated keystream, typically using XOR.
- Galois/Counter Modeimplemented by · Galois/Counter Mode is an authenticated-encryption mode that combines counter-mode encryption with authentication of ciphertext and associated data.
- CCMPused by · CCMP is an IEEE 802.11 wireless security protocol that combines AES counter-mode encryption with CBC-MAC-based message authentication.
- GCMPused by · GCMP is a wireless data-protection protocol that combines AES counter-mode encryption with GMAC integrity protection.
- encryptionkind of · Encryption is the cryptographic transformation of readable data into ciphertext to conceal its contents, reversible through decryption with appropriate information.
- pseudo-random number generatorproduces · A pseudorandom number generator is a deterministic computational process that uses an initial seed or internal state to produce a sequence with random-like statistical properties.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

