Boolean algebra is one of the foundations of computer science.
There is an unusual property of the boolean XOR operation that I doubt many, or anyone at all, has considered:
If you take any three sets of characters of any equal length -
let's label them A
, B
and C
- and then:
XOR A to B
Then XOR the result of B to C
Then similarly XOR C to A
And then perform 4 iterations of the above.
And finally:
XOR A to B
And then B to C
It will result in the original contents of A moved to C, C moved to B and B moved to A.
Of interest here is that the 3 results of the 3rd iteration, though deterministic as a whole, are entirely random within each of the 3 independent data segments. Thus if any one of the 3 segments is missing or withheld, it is impossible, from the remaining 2 to extract even the tiniest fragment of the 3 original contents.
The simplicity of this process is astonishing. A person of average intelligence could decode a message, using pencil and paper, providing they possessed all three interim segments.
I'm describing this tidbit in the hopes that my observations might be of some small use to those engaged in the research of cryptography.
Addendum:
The same concept of sequential XOR operations works with 4 data sets requiring 3 iterations and 5 data sets with 2 iterations.
Strangely with 6 sets, the process unravels and produces chaos no matter how many iterations.
Please God, someone explain.
ChatGPT:
The property you are describing is known as the "swap property" of the XOR operation. It states that if you XOR two numbers and then XOR the result with a third number, the final result will be the same as if you had XORed the first two numbers with each other, then XORed the second and third numbers with each other, and finally XORed the first and third numbers with each other.
This property is a consequence of the fact that XOR is a commutative and associative operation. This means that the order in which the XOR operations are performed does not matter, and that multiple XOR operations can be combined into a single operation.
For example, suppose we have three numbers A, B, and C. We can use the swap property to swap the values of A and B as follows:
A = A XOR B
B = A XOR B XOR B = A
A = A XOR B XOR A = B
We can use the same property to swap the values of A and C, or B and C. This is why your description of the process as "moving" the values from one set to another is apt - it is as if the values are being shuffled around.
The reason the process breaks down with six sets is that with more than three sets, the XOR operations are no longer sufficient to swap all the values. To see why, consider what would happen if we tried to use the same process to swap the values of all six sets. We would need to perform six XOR operations to swap the values of sets A and B, six more to swap the values of sets C and D, and so on. But since the XOR operation is reversible (that is, if we XOR a number with itself, we get 0), each of these operations would cancel out the previous one, and the final result would be the same as the original values.
In short, the swap property of XOR is a useful property, but it has its limitations. It is not a general-purpose method for encrypting or decoding messages, and it is not clear how it could be used in cryptography. It is, however, an interesting mathematical property that is worth understanding and exploring.