XOS>> xor>> 返回
项目作者: koppi

项目描述 :
Symmetric xor encryption / decryption in C
高级语言: C
项目地址: git://github.com/koppi/xor.git
创建时间: 2015-07-03T12:59:21Z
项目社区:https://github.com/koppi/xor

开源协议:

下载


XOR cipher

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

Makefile CI CodeQL Join the chat at https://gitter.im/koppi/xor

Clone, compile and install

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

(Note: using simply make instead of make release will produce debug versions of the tools with the address sanitizer and undefined behavior sanitizer enabled.)

or

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

Usage

  1. xor -e abc.key -i abc.txt -o abc.enc # to encrypt
  2. 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.

Hints

  • to speed up the key stream generation of the Linux pseudo-random number generator, install haveged:
  1. 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