Skip to content

koppi/xor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A C implementation of the simple XOR cipher for encrypting and decrypting arbitrary files.

Clone, compile and install

git clone https://github.com/koppi/xor && sudo make -C xor release install

or

curl -L 'https://github.com/koppi/xor/raw/master/xor.c' | gcc -O3 -x c -o /usr/local/bin/xor -

Usage

xor -e abc.key -i abc.txt -o abc.enc # to encrypt
xor -d abc.key -i abc.enc -o abc.txt # to decrypt

where:

  • abc.txt is the plaintext file,
  • abc.key is the single-use pre-shared key,
  • abc.enc is the encrypted file.

Hint

To speed up the key stream generation of the Linux pseudo-random number generator, install haveged:

sudo apt -y install haveged

With a key that is truly random, the result is a one-time pad, which is unbreakable in theory.

Author

About

Symmetric encryption / decryption in C.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors