tags:

views:

117

answers:

1

Assume:

unsigned char A = 10;
unsigned char B = 11;
unsigned char C = 12;


unsigned char Diff1 = A ^ B;
unsigned char Diff2 = B ^ C;

//find any of A or B or C using Diff1 and Diff2

Question is: There were 3 values initially for which we found 2 differences. Is there any way we can find any of A or B or C using 2 differences Diff1 and Diff2?

I know XOR is not reversible unless you know the key, but keeping in view that unsigned __int8 is 0...255 maximum 256 different values.

stay well.

+5  A: 

You don't have enough information to find any of A, B or C from just knowing the values of Diff1 and Diff2.

There are 256 ** 3 different possible inputs and only 256 ** 2 possible outputs so for each output there are 256 different possible inputs that could have given that output - where A, B and C could be any value. But once you know any one of them you can calculate the other two.

Effectively you are using XOR encryption twice on a plaintext (B) with two separate unknown keys (A and C). An XOR encryption is provibly impossible to reverse - there is no useful information at all in the output (assuming the key is chosen uniformly at random and never reused).

You can find A XOR C though:

Diff1 ^ Diff2
Mark Byers
what about knowing the first and last and xoring the values in mid to lower size:unsigned char A=10; unsigned char B=11;unsigned char C=12;unsigned char D=13;unsigned char E=11;unsigned char X= A ^ B;unsigned char X= X ^ C;unsigned char X= X ^ D;unsigned char X= X ^ E;Assume we know A, E, and X. Can we find values of B or C or D?thanks.
Jason z
Any chance of answer?
Jason z
knowing A, E, and X you can figure out Y which equals (B ^ C ^ D), but not what B, C, or D is without more information.
MerickOWA