Is the initialization vector used to encrypt a block of data always static or dynamic? If it is dynamic then I should send the IV along with the key to the recipient right? This normally doesn't happen.
|
In block cipher algorithms the IV is not secret. Only the key is secret. Most of the time an IV is just a block of random data and is sent along with the enciphered message to the recipient. Actually the IV can be considered as an algorithm parameter. |
|||||||||||
|
|
The IV is dynamic. It's supposed to be different for every message you encrypt. (For some modes, the IV might be random; for others, it might be predictable but different for each message.) The recipient needs to know the IV to decrypt. Depending upon the crypto library you use, you might or might not need to send the IV explicitly to the recipient. When encrypting a message, many crypto libraries include the IV as part of the ciphertext. In this case, if you call the crypto library to encrypt your message and transmit the resulting ciphertext to the recipient, the recipient will already obtain the IV. So, you might be sending the IV to the recipient without realizing you're doing it, because the crypto library helpfully bundled it into the ciphertext for you, to make your life easier. |
|||
|
|
|
The IV is not actually used to encrypt the data. It's used as the -1 block in chaining modes. In certain modes of block ciphers, e.g. CBC, the cipher feeds the output of the previously encrypted block, into the next block, usually by XORing it with the plaintext before encrypting the next block. This allows for additional diffusion, and prevents recognizing identical blocks of plain text. But, what to do about that first block, where there is no "previous block" output that you can XOR with the first block? And yes, the IV itself is not secret, and definitely need to transmit it along with the ciphertext. Don't forget, it's supposed to be random per use. |
|||
|
|
