-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.

4

1 に答える 1

7

Diff1との値を知っているだけでは、 A、B、または C のいずれかを見つけるのに十分な情報がありませんDiff2

256 ** 3 つの異なる可能な入力と 256 ** 2 つの可能な出力しかないため、各出力には、その出力を与える可能性のある 256 の異なる可能な入力があります。ここで、A、B、および C は任意の値です。しかし、そのうちの 1 つがわかれば、残りの 2 つを計算できます。

事実上、2 つの別個の未知のキー (A と C) を使用して、プレーンテキスト (B) で XOR 暗号化を 2 回使用しています。XOR 暗号化を元に戻すことは明らかに不可能です。出力に有用な情報はまったくありません (キーが一様にランダムに選択され、再利用されないと仮定します)。

ただし、見つけることができA XOR Cます:

Diff1 ^ Diff2
于 2010-05-28T18:41:27.793 に答える