This is an University project, using Python, with two scripts (encrypt.py / decrypt.py), which take a key and a text file, as a parameter in the terminal, and perform XOR encryption / decryption, using the given key. The program uses the key to encrypt the contents of the text file.
XOR (eXclusive OR) is a logical operator that returns a true value if one, but not both, of its operands is true.
Its function table:
a | b | a ^ b |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |