# Is there any way to find out two numbers such that the XOR between them is a given number?

I have the following operation I took from a cryptanalysis I'm performing for a specific CBC encryption where the challenger has provided the key:

C1 = Encryption (K, IV⊕P1)P1 = IV ⊕ Decryption (K, C1)

I know the value of Decryption (K, C1) and I also know it is equal to IV⊕P1.

Can I compute the value of IV or P1 without brute force?

Is there any way to find out two numbers such that the XOR between them is a given number?

No. When $$(G,\odot)$$ is a group, if one knows the value $$z=x\odot y$$, and nothing else about $$x$$ or $$y$$, then $$x$$ individually can be any element of the group; same for $$y$$. This applies here, for the group $$(\{0,1\}^b,\oplus)$$, where $$b$$ is the block size in bits.

Can I compute the value of IV or P1 without brute force?

Perhaps. In CBC encryption, the IV is usually public (that, or the receiver has some mean to find it that is not part of CBC encryption per se). It often is the first block of the ciphertext message.

• Nice, thanks! It is related to my answer in crypto.stackexchange.com/questions/1129/…
– Maf
Apr 16 '20 at 17:22
• If you know $\text{IV}\oplus p_i$ for many values of $p_i$, and the $p_i$ are not random, something might be possible. This would be similar to many-times-pad. But there is no hint about that in the question.
– fgrieu
Apr 16 '20 at 17:32