Electronic codebook mode
Electronic Codebook mode is a block-cipher mode that encrypts each plaintext block independently with the same key.
Software Security for Developers
Electronic Codebook mode, or ECB mode, is a block-cipher mode that encrypts each plaintext block independently with the same key.
- How it is used
- Explains how AES handles data larger than one block and why ECB is unsuitable for application encryption.
- How deep it goes
- Defines independent block processing, demonstrates pattern leakage, and stops short of mathematical internals.
- Examples
- Uses repeated HTTP success-response blocks to demonstrate pattern recognition and ciphertext substitution.
- What you can do after
- Evaluate ciphertext for repeated-block leakage and choose authenticated encryption instead of ECB.
Read how Software Security for Developers explains electronic codebook mode →
Hacking Cryptography
Electronic codebook is a block cipher mode that encrypts each block independently with the same key.
- How it is used
- Explains how block ciphers handle multiple blocks and why independent encryption leaks plaintext patterns.
- How deep it goes
- Defines independent block processing and demonstrates its visual consequence, but does not detail a code-level implementation.
- Examples
- Uses repeated plaintext blocks and the recognizable ECB-encrypted penguin image to expose structural leakage.
- What you can do after
- Evaluate encryption designs by recognizing ECB pattern leakage and selecting a mode with per-message variability.
Read how Hacking Cryptography explains electronic codebook mode →
Real-World Cryptography
Electronic codebook mode encrypts each plaintext block independently with the same block-cipher key.
- How it is used
- Explains why independently encrypting message blocks can leak structure and why safer modes are needed for longer plaintexts.
- How deep it goes
- Defines block-by-block encryption and its deterministic leakage, but stops short of implementation details or a complete encryption procedure.
- Examples
- Uses the encrypted penguin image to make repeated ciphertext patterns visibly reveal plaintext structure.
- What you can do after
- Evaluate whether block-encryption output leaks repeated patterns and recognize when a different mode is required.
Read how Real-World Cryptography explains electronic codebook mode →
What to know first
- ciphertextCiphertext is data produced by encryption whose original content is intended to be unreadable without the required decryption capability.
- plaintextPlaintext is data in its readable, unencrypted form, typically before encryption or after decryption.
Related concepts
- mode of operationkind of · A block cipher mode of operation is a method for applying a block cipher to messages consisting of one or more blocks.
Questions about electronic codebook mode
What is electronic codebook mode?
Electronic Codebook mode is a block-cipher mode that encrypts each plaintext block independently with the same key.
Which Manning books explain electronic codebook mode?
Software Security for Developers, Hacking Cryptography and Real-World Cryptography.
What should I know before learning electronic codebook mode?
Manning books that teach electronic codebook mode usually introduce ciphertext and plaintext first.
What is electronic codebook mode a kind of?
Electronic codebook mode is a kind of mode of operation. A block cipher mode of operation is a method for applying a block cipher to messages consisting of one or more blocks.
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.


