Go to file
Evan Chen 220dd90b01
continuous-integration/drone/tag Build is passing Details
build: add drone build
2021-11-17 10:50:00 +08:00
cmd/xorenc build: add drone build 2021-11-17 10:50:00 +08:00
.drone.yml build: add drone build 2021-11-17 10:50:00 +08:00
.gitignore build: add drone build 2021-11-17 10:50:00 +08:00
README.md build: add drone build 2021-11-17 10:50:00 +08:00
go.mod init 2021-11-17 09:44:15 +08:00
make.sh build: add drone build 2021-11-17 10:50:00 +08:00
xorencrypt.go feat: add default key 2021-11-17 09:50:25 +08:00
xorencrypt_test.go feat: add default key 2021-11-17 09:50:25 +08:00

README.md

XOR Encrypt

a simple xor encryption that encodes to base64 for url safe

Usage

msg := "test"
key := "key"
enc := Encrypt(msg, key)
dec, _ := Decrypt(enc, key)
fmt.Printf("%s -> %s -> %s\n", msg, enc, dec)

Helper cli

usage: xorenc [e|d] msg key

$ xorenc e test secret
BwAQBg==

$ xorenc d BwAQBg== secret
test

Install

sudo rm -f /usr/local/bin/xorenc
sudo sh -c "curl -fsSL RELEASE_URL | tar -C /usr/local/bin/ -xz"