I have come across a problem that I would ideally like to solve where I would like to add two (problem involves 24-bit but for ease of demonstration 8-bit is fine) numbers together - simple enough, they don't even need to be strictly added, an XOR would be fine. However, I would like this to be reversible, I know you can use an XOR cipher to add a known number to the original and be able to decode it again, but I would like to do something similar but with 2 starting numbers rather than a single one.
Truncating to 8-bit numbers for ease of demonstrating:
I would like to have 10010100 added to 10110110 for instance. I would then like to be able to extract 10010100 from the resulting number to get 10110110 again. I would add n 8-bit numbers, transmit the resultant number and then decode back to n 8-bit numbers + the original number. The transmitted number can be as large as it needs to be, although the smaller the better. I am flexible on how to achieve this, either in hardware or in software. Is this possible? Hopefully I have included sufficient information.
Thanks in advance