#K76597. XOR Encryption Key Determination
XOR Encryption Key Determination
XOR Encryption Key Determination
You are given a number of encryption tasks. Each task consists of an original binary message and its corresponding ciphertext, both having the same length. The encryption key is determined by performing a bitwise XOR operation between the two binary strings.
The XOR operation on binary digits is defined as follows: for each bit position, if the bits are different, the resulting bit is 1; if they are the same, the resulting bit is 0. In mathematical terms, if \(M\) is the original message and \(C\) is the ciphertext, then the key \(K\) is given by:
\(K = M \oplus C\)
Your task is to compute the encryption key for each test case and output the result.
inputFormat
The input consists of multiple test cases. The first line contains a single integer \(T\) representing the number of test cases. Each test case is described in one line with the following format:
N message ciphertext
where:
- \(N\) is an integer denoting the length of the binary strings.
message
is the original binary string.ciphertext
is the encrypted binary string.
Both binary strings are of equal length \(N\).
outputFormat
For each test case, output a single line containing the encryption key. The encryption key is the bitwise XOR of the original message and the ciphertext.
## sample2
4 1010 1101
3 011 101
0111
110
</p>