You remember that XOR gate is used in the half adder to compute the sum of two b
ID: 3868753 • Letter: Y
Question
You remember that XOR gate is used in the half adder to compute the sum of two bits on how two bits x and y add to the sum (1 XOR 1 = 0).
The XOR operation can be generalized to define the XOR of two n bits numbers A and B if this operation is done bit by bit. For example, if there are two binary 4 bits numbers A = 1011 and B = 1101 (they are unsigned here), then A XOR B = 0110 by applying XOR bit by bit.
XOR is used for simple encryption operation to convert a plain text to cryptic or unintelligent text. It is used in WiFi 802.11b due to its simplicity. Also, this simplicity causes WiFi security problem.
A) Given a mask M = 10110101 of 8 bits, compute manually P1 XOR M = C1 and P2 XOR M = C2 with P1 = 0xAB and P2 = 0xCD in hex.
B) Prove that C1 XOR C2 = P1 XOR P2 is true in general whatever values P1 and P2 are (whether they are 0xAB and 0xCD as in (a)).
Compute also in particular P1 XOR P2 with P1 and P2 and M as given in (a).
C) Suppose M is a 32 bit numbers, P1 and P2 are also 32 bit numbers. A sender encrypts P1 and P2 to C1 and C2 and send that publicly to hope that nobody will know what his/her secret p1 and P2 are. A cracker reads C1, and C2 publicly, and by chance gets P1.
This cracker claims that he/she now can compute P2 given C1, C2, and P1. Is his/her claim correct? Answer yes or no and justify your answer by proving or disproving this (hint: consider P1 XOR C1 XOR C2).
Explanation / Answer
A) Given a mask M = 10110101 of 8 bits, compute manually P1 XOR M = C1 and P2 XOR M = C2 with
P1 = 0xAB and P2 = 0xCD in hex.
A in hex is 1010 in binary
B in hex is 1011 in binary
P1 XOR M = 10101011 10110101 =>
C1 = 00011110
C in hex is 1100 in binary
D in hex is 1101 in binary
P2 XOR M = 11001101 10110101 =>
C2 = 01111000
===============================================================================
B) Prove that C1 XOR C2 = P1 XOR P2 is true in general whatever values P1 and P2 are (whether they are 0xAB and 0xCD as in (a)).
Lets know about XOR ( ),
We know that X X is 0 AND We know that X 0 is X
So, C1 XOR C2
C1 and C2 we know is P1 XOR M and P2 XOR M
=> C1 XOR C2
=> P1 XOR M XOR P2 XOR M
=> P1 XOR P2 XOR M XOR M
=> As discussed above M XOR M = 0
So, P1 XOR P2 XOR 0
=> As discussed above P XOR 0 = P
=> ( P1 XOR P2 ) XOR 0
= P1 XOR P2
Hence Proved
===============================================================================
C) This cracker claims that he/she now can compute P2 given C1, C2, and P1. Is his/her claim correct? Answer yes or no and justify your answer by proving or disproving this
Answer is YES, Lets see How
We know that ,
C1 = P1 XOR M
C2 = P2 XOR M
If A cracker reads C1, and C2 publicly, and by chance gets P1.
So if he knows P1 , He might Compute M
by using C1 = P1 XOR M
And when he knows M, he can compute P2 using C2 = P2 XOR M
So Craker is Correct, he will be able to Compute P2 if he knows C1, C2 and P1
Thanks, let me know if there is any concern/Doubts. I will surely respond
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.