# Alter CBC plaintext by altering IV [duplicate]

I am building on this answer. Essentially I have an initialisation vector $$iv$$, a ciphetext $$c$$ and a plaintext $$p$$. The plaintext was encrypted using AES CBC. The aim is to modify the first 4 characters of the plaintext so that it becomes $$p_{target}$$.

Ex:

$$p$$ = 'SEND_DOGGOS_LOVE'

$$c$$ = 0x63fd039cc488dd7d937677b322a7763c

$$iv$$ = 0xa9e459b1a2e68cd7db06cf24b7e0bde8

$$p_{target}$$ = 'CATS_DOGGOS_LOVE'

My understanding was that to achieve that, I can change the $$iv$$ by simply xoring the first 4 chars of $$iv$$ with the result of $$xor($$'CATS','SEND'$$)$$. This however doesn't seem to work as I get a nonsensical plaintext. What am I missing?

## marked as duplicate by kelalaka, AleksanderRas, Maarten Bodewes♦Jul 15 at 9:06

• Yes, we can also see from this; normally $C_1 \oplus IV = P_1$ if you modify the $IV_{new} = IV \oplus P_x \oplus P_1$ then you can see that $C_1 \oplus IV \oplus P_x \oplus P_1 = P_x$ . – kelalaka Jul 12 at 9:09