C ++ → Recursive XOR

I used to deal with cryptography some time ago and thought of my own algorithm.

A part of this I will introduce to you. I call it recursive XOR. The reason behind this is that you encode an entire byte with only one bit.
I will show you the simple principle, which is behind it in a brief example:
We take a byte we want to encrypt (01001110) and a bit (1).
We apply XOR to the first bit of the Plain Byte and the bit. Result is in this case 1. This 1 is now the key for the next XOR link from the second bit from the Plain Byte.

This is what we repeat until we are through:

01001110: Plain Byte
11000101: Key Byte
10001011: Crypted byte

Another example:
01101011: Plain byte
00100110: Key Byte
01001101: Crypted byte

This method lives on that of course this is not only encrypted with one bit but with several bits in succession. The key length is arbitrary.
This method was used in a program for communication, therefore the input in String and Character:

To decrypt the whole, we need the key byte, which we then take with the Crypted Byte Bitwise XOR to get the Plain Byte.
The key byte is obtained by the Crypted by moving this one position to the right (division by two) and the MSB (the bit with the significance 128) equal to the respective key bit. So in example one it would be set in example two however not.

RecXor again in ASM

I will write an article about cryptoanalysis.

Leave a Reply

Your email address will not be published. Required fields are marked *