2 edited tags
| link
source | link

Size of initialisation vector and plaintext in CBC mode

If I have a 16-number sequence (7,7,7,....7), and I need to encrypt this using a simple 4-bit substitution cipher, do I have to "chop" the plaintext in blocks which are of same size as the IV?

In my situation the IV is specified as having to be exactly 4 bits. Let's say it's 1001.

So my plaintext is 001101110111,.....,0011.

When I start, I say 'IV' XOR '4bit plaintext' hence ==> 1001 XOR 0011 = 1010 which corresponds to 10 in decimal. If I look up 10 in my substitution cipher it corresponds to 9, so 1001 is the corresponding ciphertext C1.

Then I continue by XORing the next 4bit plaintext (the same as before) with C1 and so on.

The one thing that is not clear to me is whether I'm doing the right thing by dividing my plaintext into 4bits because the IV has to be 4 bits as well?