Can we have separate key for separate blocks which we get while operating a plain text message using CBC encryption model? If yes, what are it's advantage? Please enlighten me.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
SHORT: The key remains the same. CBC mode is one of the ways which allow block cipher to securely process multi block input.
Block cipher with single key produces same output for same input, as it is relatively common for input to contain duplicate blocks, instead of using block cipher as is, a more complex construct is needed.
The idea of CBC mode is that the ciphertext of the previous block affects encryption of the next block. Specifically, plaintext input is XORed with the previous block cipher text (or with "Initialization Vector" also known as IV) for the first block. This operation is much less time consuming than key change.
So shortly, the benefit of CBC mode is that it allows securely using the block cipher, something that raw block cipher (ECB mode) generally does not allow for multi block messages.
In addition to CBC mode, also numerous other block cipher modes of operation exist. There are circumstances where one of the other block cipher modes of operation is more appropriate than CBC.
The most basic block cipher modes of operation (ECB, CBC, CFB, OFB, CTR) are described e.g. in Wikipedia and NIST Special Publication 800-38A. The Wikipedia article contains great picture, which illustrates the need for modes of operation beyond ECB.