Initially, I thought one use-case could be hiding ciphertext in ciphertext, which requires a dummy key that will result in a dummy plaintext while the real key reveals the real plain text.
However, the answer to this specific question being asked uses the same "original message" with the same ciphertext that resulted from XOR'ing it with a private key, which would be the computation of the same private key by XOR'ing those two! This breach would be equal to reusing the private key on a new message (as XOR'ing two ciphertexts signed with the same key would also compute the private key. This type of XOR operation is akin to the one-time pad cipher, assuming no padding and all strings are of same length.
Here is an example using a random 31-bit binary string:
- plain text = 1001011110010111101001010000101
- private key = 1111011011010110110101101101111
- ciphertext = 0110000101000001011100111101010
(i.e. ciphertext is computed by plaintext
${\oplus}$ private key
Test that answers the question being asked:
ciphertext ${\oplus}$ plain text = private key.
The associativity and commutativity of XOR is pretty interesting, among other qualities that can be seen here: https://en.wikipedia.org/wiki/Exclusive_or
Side note: One exercise I developed and found useful for exploring XOR is expanding the 1-bit truth table of XOR to 2-bits which will quadruple the combinations from 4 to 16, and then mapping all the possible combination pairs (inputs) into respective XOR operations, which will reveal that every ciphertext repeats n number of times, where n is equal to square root of the number of combinations which is the bit-length multiplied by 2 and raised to the power of 2 (i.e. in this case 2 bits, multiplied by 2, is 4, raised to the second power is 16, the square root of which is 4.
This fits with the notion that any arbitrary ciphertext computed will repeat exactly n number of times where n is equal to the square root of the message space multiplied by the keyspace. So from a range of 2^n possible messages, multiplied by 2^n possible keys, the square root of that sum is 2^n. (of which every one of them will have uniquely ordered inputs into the XOR function which result in the identical ciphertext output).