GoXor is an encryption method written in the Go programming language, and is based on a xor cipher in conjunction with a one-time pad.
- Install and configure Go for you operating system. See Here
- Once Go is installed and configured, run this command to install the
goxor
tool
go get github.com/penguingovernor/goxor
To ensure that installation went smoothly run the go test
tool
go test -v github.com/penguingovernor/goxor/xor
After installing, you can use goxor help
to get documentation:
goxor help
goxor
has two sub-commands: encrypt and decrypt.
Example:
# Encrypts input hello.txt using a one time pad as the key, 'goxor' as the signature, outputs out.xor and out.xor.key
goxor encrypt -i hello.txt
# Decrypts input out.xor using out.xor.key as the key, this will output to stdout
goxor decrypt -i out.xor -k out.xor.key
The goxor encrypt
command can encrypt files. It supports the following flags:
-
--input=
or-i
: The file to be encrypted. If the file cannot be found then the input is treated as a string. If omittedgoxor encrypt
will read from stdin -
--output=
or-o
: The desired file name to output the encrypted data to. Omitting this flag mode causesgoxor encrypt
to output to out.xor. If the string 'stdout' is passed togoxor encrypt --output
then the encrypted data is written to stdout -
--key_out
or-K
: The desired file name to output the key to. Omitting this flag causesgoxor encrypt
to output to out.xor.key. If the string 'stdout' is passed togoxor encrypt --key_out
then the key is written to stdout -
--signature
or-s
: The file or string to use as the encryption signature. If omitted the stringgoxor
is used as the signature. If stdin is passed then the input from stdin is used as the signature. -
--key
or-k
: The file or string to use as the encryption key. If omitted a one time pad is used as the key. If stdin is passed then the input from stdin is used as the key.
The goxor decrypt
command can decrypt files. It supports the following flags:
-
--input=
or-i
: The file to be decrypted. -
--output=
or-o
: The desired file name to output the decrypted data to. Omitting this flag mode causesgoxor decrypt
to output to stdout. -
--key
or-k
: The file to use as the decryption key.