l have two binary sequences, K1 and K2
K1 : 1 0 1
K2 : 0 0 1
l would want to perform binary operations on both sequences K1 and K2 so that one binary number is the output for example the output is 1. Now with the output and K2, l would want to recover K1.
l tried to XOR each digit of the sequences of the same index and use the result to XOR the next digits. For example:
index 1 of both K1 and K2 are 1 and 0, so
1 XOR 0 = 1
index 2 of both K1 and K2 are 0 and 0, so using the previous output
1 XOR 0 XOR 0 = 1
index 3 of both K1 and K2 are 1 and 1, so using the previous output
1 XOR 1 XOR 1 = 1
The final output is 1.
Now, using this output 1 and K2 , l want to recover K1
Any suggestions are welcome
If you want your operation to give just a single bit of output, there won't be enough data to recover $K_1$ given that single bit and $K_2$.
A simple counting argument shows this:
For each fixed choice of $K_2$ there are $8$ different possible $K_1$s, but outputting a single bit can only distinguish between two of them.
(Otherwise you could create a magical compression algorithm by using the file to compress as $K_1$, an sequence of $0$s as $K_2$, and only storing the length of $K_1$ and the single output bit you get).