i have to implement 8-bit(binary) security code with all the combination i.e 256
then the output is XOR with the input and if the result is zero then print the desired result.
Try CRC (cyclic code) concept.
In this concept,at Transmiter end message sequence is encoded with CRC bit.Then same is transmited.
At reciever end again CRC is calulated for recieved message sequence and compared with received CRC bit.IF matched received sequence is error free,else again request for retransmission to transmiter.
Above entire concept is based on modulo-2 i.e XOR operation.