In: Computer Science
When applying secured AES to a long message (multiples of 128 bits), it will have different modes of encryption. Show all the recommended AES modes of encryption with a 256-bit message m = m1m2. Include a diagram as well.
AES (Advanced Encryption Standard) is a block cipher that means the transformation performed on the amount of bits or bytes called a block. This transformation is called a keyed permutation as each plain text has a corresponding cipher text (and vice versa) for a specific key. AES supports key lengths of 128, 192 and 256 bit. Mostly AES will only encrypt 128 bit of data, but if we want to encrypt whole messages ,need to choose a block mode with which multiple blocks can be encrypted to a single cipher text. The simplest block mode is Electronic Codebook or ECB
The disadvantage of this method is a lack of diffusion. Because ECB encrypts identical plain text blocks into identical cipher text blocks, it does not hide data patterns well. In some senses, it doesn't provide serious message confidentiality, and it is not recommended for use in cryptographic protocols at all.
One of the alternative solution is Code block Chaining in which XORs the current plain text block with the previous cipher text block.Here each cipher text block depends on all plain text blocks processed.
A random initialization vector (IV) is used to avoid the generation of same key and plain text for the same cipher text.Also if you reuse the same key for different plain texts it would make it easier to recover the key. IV is a public and random data that is about the size of one block (128 bit),only used one time. If you not knowing the IV will only making the difficulty to the decryption of the first block since the CBC XORs the cipher text not the plain text of the previous one.
Another solution is Counter Mode which restrict the padding and turn a block cipher into a stream cipher. All blocks are numbered from 0 to n and every block transform with the IV ,key and the counter value.
where c59bc35 - initialization vector
00000000 - Counter value