A C implementation of the simple XOR cipher for encrypting and decrypting arbitrary files.
git clone https://github.com/koppi/xor && sudo make -C xor release installor
curl -L 'https://github.com/koppi/xor/raw/master/xor.c' | gcc -O3 -x c -o /usr/local/bin/xor -xor -e abc.key -i abc.txt -o abc.enc # to encrypt
xor -d abc.key -i abc.enc -o abc.txt # to decryptwhere:
abc.txtis the plaintext file,abc.keyis the single-use pre-shared key,abc.encis the encrypted file.
To speed up the key stream generation of the Linux pseudo-random number generator, install haveged:
sudo apt -y install havegedWith a key that is truly random, the result is a one-time pad, which is unbreakable in theory.
- Jakob Flierl - koppi