concept operation in category cryptography

This is an excerpt from Manning's book Real-World Cryptography MEAP V09.
Mode of Operation. Second, a mode of operation is used to encrypt multiple blocks of 128-bits (if needed) as well as "randomizing" the encryption. The latter is useful because as we’ve previously mentioned, encryption with AES is deterministic and leaks information when the same plaintext is encrypted twice.
There exist many mode of operations, but the most popular one for AES is the Cipher Block Chaining (CBC). CBC works for any deterministic block cipher (not just AES) by taking an additional value called an Initialization Vector (IV) to randomize the encryption. Because of this, the IV is the length of the block size (16 bytes for AES) and must be random and unpredictable.
Figure 4.14. The CBC mode of operation with AES. To start encrypting the first block of plaintext, a random Initialization Vector (IV) is generated and XORed with the block prior to encrypting it.
![]()
To encrypt with the CBC mode of operation, start by generating a random IV of 16-byte (we will see in chapter 8 how to do this), then XOR the generated IV with the first 16-byte of plaintext before encrypting them. This effectively randomize the encryption. Indeed, if the same plaintexts is encrypted twice but with different IVs, the mode of operation will render two different ciphertexts.
Figure 4.15. The CBC mode of operation with AES. To encrypt, a random Initialization Vector (IV) is used in addition to a padded plaintext (split in multiple blocks of 16 bytes).
![]()
The Poly1305 core function mixes the key with the accumulator (set to 0 in the beginning) and the message to authenticate. The operations are simple multiplications modulo a constant
P
.