CipherModes
Cipher modes, also known as modes of operation, are specific algorithms that define how a block cipher is used to encrypt messages of arbitrary length. Block ciphers encrypt fixed-size blocks of data, and cipher modes extend this capability to handle longer messages by repeatedly applying the block cipher. Each mode has different properties concerning security, efficiency, and error propagation.
Electronic Codebook (ECB) mode is the simplest mode. Each block of plaintext is encrypted independently with
Cipher Block Chaining (CBC) mode addresses ECB's weakness by introducing a dependency between consecutive blocks. Each
Cipher Feedback (CFB) mode is a self-synchronizing stream cipher. It encrypts ciphertext in blocks, but it is
Output Feedback (OFB) mode is also a stream cipher. It generates a pseudorandom stream of bits that
Counter (CTR) mode is another stream cipher that encrypts by XORing the plaintext with an output of