A block cipher mode is an algorithm used along with a block algorithm to encrypt arbitrary size plaintext, providing both confidentiality and authentication.
A single block cipher operates only on a fixed block length. It is not alone enough to encrypt larger plaintexts. It functions as a blackbox in an encryption scheme (see Random Oracle Model).
The are many block cipher modes of operations. Some work as a stream cipher (synchronous and self-synchronous), and some provide avalanche effect over certain or large portions of the input (encryption/decryption). Here is list of a few of them:
- Electronic Codebook (ECB): ECB simply encrypts consecutive blocks of data with the chosen block cipher and key.
It is important to note that this mode fails to successfully disrupt patterns in the plaintext, as identical blocks get encrypted to identical cipher blocks.
- Counter(CTR): Counter mode turns a block cipher into a synchronous stream cipher. It requires an IV or nonce which is combined with a counter and encrypted with a block cipher. The counter can be any non repeating function, however a simple increment by one is secure enough, and not to mention, the most efficient.
- Output Feedback (OFB): This also turns a block cipher into a synchronous stream cipher. It starts encryption with an IV, and operates by encrypting the previous block.
- Cipher Feedback (CFB): This one converts a block cipher into a self-synchronous stream cipher. It starts with an IV, XORs the output to get the first ciphertext block, and uses every previous ciphertext block as the next IV.