# What happens if CBC-mode uses the same IV for all processes?

In CBC mode (Cipher Block-chaining mode), each block of plaintext is XOR with the previous ciphertext block before being encrypted. What happens if I use the same IV instead of the previous ciphertext block? Is it vulnerable to Chosen plaintext attack?

## migrated from security.stackexchange.comOct 30 '18 at 9:14

This question came from our site for information security professionals.

• If you "use the same IV instead of previous ciphertext block?" it is not CBC mode. It is essentially ECB mode with a slight modification. If the same key is used blocks with identical plain text will have identical cypher text. – zaph Oct 20 '18 at 10:48
• The Initialization Vector is something different than the previous ciphertext block. As the name indicates, the IV is only used at the start of the CBC calculation: the first plaintext block is XORed with it before it is fed into the block cipher. And actually it should not be a ciphertext block of a previous encrypted message, as it needs to be unpredictable (random) to an attacker. You are possibly describing a vector but not the initialization vector. – Maarten Bodewes Oct 25 '18 at 15:58
• @MaartenBodewes Using the last ciphertext block of the previous message as IV for the next message will produce the same result as you would have achieved by encrypting the concatenation of the two cleartext messages in one go. Intuitively that sounds safe, but it isn't for the reasons you point out. That subtlety is something which has lead to vulnerabilities in the past. – kasperd Nov 1 '18 at 14:20
• @MaartenBodewes There is no flaw in your reasoning. I was merely pointing out why it's so easy to mistakenly believe you can use the last cipher block as IV for your next message. I don't see how my comment could be interpreted as saying it is secure. I clearly said it isn't safe and that it has lead to vulnerabilities in the past. – kasperd Nov 1 '18 at 15:23

$$C_i=E_K(\text{IV}\oplus P_i)$$