Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 1.57 KB

README.md

File metadata and controls

65 lines (46 loc) · 1.57 KB

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