How xor Encryption Works
Key and text
Xor encryption uses a key(password) to encrypt text. Ascci
All letters/symbols/numbers are represented by a number from 0 to 256. This is called the ASCII number.
Binary
In an XOR encryption program each letter of the key and the text are converted to ASCII, then to binary (0’s and 1’s).
XORing
The 0 or 1 from the key is XORed against the 0 or 1 of the text. If the key is shorter than the text, is repeats. XORing a 0 against a 0 gives a 1. See the below truth table for all
a | b | a XOR b
----+----+---------
0 | 0 | 1
0 | 1 | 0
1 | 0 | 0
1 | 1 | 1
Converting back
The binary that is the result is then put back into ASCII then text.
