These are the five classic confidentiality modes from NIST SP 800-38A. They do not authenticate messages by themselves. The block size b is 64 bits for DES or 128 bits for AES; s denotes a CFB segment size.
A mode of operation defines how a symmetric block cipher processes data into a single block.
NIST defines five modes of operation for various encryption applications
Block-cipher modes and applications
| Mode | Operation | Application described in the notes |
|---|---|---|
| ECB | Each plaintext block is encrypted independently using the same key. | Encrypting a single block; repeated blocks reveal patterns. |
| CBC | XOR the next plaintext block with the preceding ciphertext block before encryption. | General-purpose block-oriented transmission; related chaining constructions underpin some MACs. |
| CFB | Process s bits at a time; encrypt the preceding feedback state and XOR the selected output with plaintext. | Stream-oriented transmission; separate authentication is still required. |
| OFB | Feed the preceding block-cipher output back into encryption to generate the next keystream block. | Stream-oriented transmission over a noisy channel, such as a satellite link. |
| CTR | XOR each plaintext block with an encrypted counter; increment the counter for each block. | General-purpose block transmission, especially where high throughput is needed. |
The source uses DES-sized 64-bit examples. The same mode definitions apply to other block sizes, including AES’s 128 bits. These five modes provide confidentiality, not authentication by themselves.
Mode definitions: NIST SP 800-38A
Modes of operation
A mode of operation defines how a symmetric block cipher processes data into a single block.
NIST defines five modes of operation for various encryption applications
- Electronic Code Book (ECB)
Simplest modes of operation for symmetric block ciphers
Plain-text is handled b bits at a time and each block of plaintext is encrypted using the same key
b = 64 for DES or b = 128 for AES
To decrypt, each ciphertext block is processed independently using the same key to retrieve the original plaintext blocks.
If same b-bit block of plain text appears more than once, it always produces the same ciphertext

- Cipher block Chaining mode (CBC)
Input to algorithm is XOR of current plain text and previous ciphertext block
The same key is used for each block.
CBC requires an initialization vector (IV), which is a random value of the same size as the block.
The first step involves XORing the plaintext block with the IV before encryption, modifying the first block and then encrypting it using the algorithm and secret key.
The process of decryption involves reversing the ciphertext to retrieve a modified plaintext block, which is then XORed with the previous ciphertext block to recover the original plaintext.
The sender and receiver must be aware of the IV and its key for maximum security.

CFB requires an initialization vector (IV). Can be used with block ciphers and stream Ciphers both as it operates in a stream oriented manner (processes plaintext as continuous stream rather than fixed-size blocks)
Eliminates the need to pad a message


Decryption process involves initialization using the same IV as in encryption, encrypting the IV to produce output and XORing with the first ciphertext block to retrieve the first plaintext block, and then encrypting the ciphertext previous ciphertext along with shift register to generate new output then XOR with current ciphertext to get plain text
- Output Feedback (OFB)
Converts a block cipher into a synchronous stream cipher by continuously encrypting the previous output to generate a series of keys. Each encryption step relies on the output of the previous step, rather than the ciphertext, creating a stream of keystream blocks for data encryption.


- Counter (CTR)
encrypt data in a way that allows for parallel processing
CTR mode converts a block cipher into a stream cipher by combining the plaintext with a series of "counter" values. Each block of plaintext is XORed with an encrypted counter value to produce the ciphertext.
counter value must be different for each plaintext block that is encrypted.

Advantages:
- Hardware efficiency: Unlike chaining modes, CTR allows parallel processing of multiple blocks, increasing throughput by utilizing parallelism.
- Software efficiency: Modern processors with parallel features like pipelining and SIMD can handle CTR mode efficiently.
- Preprocessing: Encryption can be precomputed without needing plaintext or ciphertext, allowing for faster XOR operations when input is provided.
- Random access: Any block can be encrypted/decrypted independently, useful for applications requiring selective block processing.
- Provable security: CTR mode is as secure as other encryption modes.
- Simplicity: CTR mode only requires the encryption algorithm, simplifying implementation, especially when the decryption algorithm differs (e.g., in AES).
Encryption Mode: Summary
Encryption modes: visual comparison

| Mode | Main observation |
|---|---|
| ECB | Simple and independent blocks, but equal plaintext blocks reveal equal ciphertext blocks. |
| CBC | Encryption chains blocks and is sequential; decryption can be parallelized. A corrupted ciphertext block affects its own plaintext block and the corresponding bits of the next. |
| CFB | Stream-oriented feedback; encryption is sequential. A transmission error affects the corresponding plaintext bits and subsequent feedback until the damaged bits leave the register. |
| OFB | The keystream has a feedback dependency but is independent of the message. A ciphertext bit error flips only the corresponding plaintext bit. |
| CTR | Counter blocks can be processed in parallel and support random access. No padding is required for a partial final block; counter blocks must never repeat under the same key. |