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
goxortool
go get github.com/penguingovernor/goxorTo ensure that installation went smoothly run the go test tool
go test -v github.com/penguingovernor/goxor/xorAfter installing, you can use goxor help to get documentation:
goxor helpgoxor 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.keyThe 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 encryptwill read from stdin -
--output=or-o: The desired file name to output the encrypted data to. Omitting this flag mode causesgoxor encryptto output to out.xor. If the string 'stdout' is passed togoxor encrypt --outputthen the encrypted data is written to stdout -
--key_outor-K: The desired file name to output the key to. Omitting this flag causesgoxor encryptto output to out.xor.key. If the string 'stdout' is passed togoxor encrypt --key_outthen the key is written to stdout -
--signatureor-s: The file or string to use as the encryption signature. If omitted the stringgoxoris used as the signature. If stdin is passed then the input from stdin is used as the signature. -
--keyor-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 decryptto output to stdout. -
--keyor-k: The file to use as the decryption key.