Skip to content
A simple command-line utility written in Go that supports NaCL (salt) box encryption/decryption and secrebox public key crypto
Go Shell Makefile
Branch: master
Clone or download
Latest commit b4659f9 Nov 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tools Initial Commit Nov 11, 2019
.gitignore Initial Commit Nov 11, 2019
.goreleaser.yml Initial Commit Nov 11, 2019
LICENSE Initial Commit Nov 11, 2019
Makefile Initial Commit Nov 11, 2019
README.md Update README Nov 11, 2019
_config.yml Initial Commit Nov 11, 2019
go.mod Initial Commit Nov 11, 2019
go.sum
main.go Add box (asymetric crypto) support Nov 11, 2019

README.md

salt

A simple command-line utility written in Go that supports the box (public key cryptography) and secretbox (secret key cryptography) as described by NaCL and part of the Golang standard library box and secretbox.

Installation

$ go get -u github.com/prologic/salt

Usage

Secret Box (Symetric Crypto)

Encryption:

$ echo 'hello world' | ./salt -k foobar -e
�+TQI?��B�E�LvM��4�)3��C��*C63�ۂ�~=%��'

Decryption:

$ echo 'hello world' | ./salt -k foobar -e > hello.enc
$ ./salt -k foobar -d < hello.enc
hello world

Box (Asymetric Crypto)

Generate Keys:

$ ./salt -g
Private Key: 9B07A5664EDEE31FB1B5F456CA552BC4CD8474345A6185A8B9CB51EC7B0CC65E
Public Key: 96EBFD5C8092D5CBC420990159079F72DAF5B88AE54C25432D027CCB9E7AD85E

$ ./salt -g
Private Key: DA50675E53991113CB271664099E87E0A9251E31189A4B5BA8B55F15674799E7
Public Key: 279E5C728B4F0D851DA4A98E1DCF725834CC6B38B3E00C1A14DFE1B926730835

Encrypt and Sign:

$ ./salt -k 9B07A5664EDEE31FB1B5F456CA552BC4CD8474345A6185A8B9CB51EC7B0CC65E -p 279E5C728B4F0D851DA4A98E1DCF725834CC6B38B3E00C1A14DFE1B926730835 -e > msg.enc
hello world
^D

Decrypt and Verify:

$ ./salt -k DA50675E53991113CB271664099E87E0A9251E31189A4B5BA8B55F15674799E7 -p 96EBFD5C8092D5CBC420990159079F72DAF5B88AE54C25432D027CCB9E7AD85E -d < msg.enc
hello world

License

MIT

You can’t perform that action at this time.