salt

command module
v0.0.0-...-a4b3153 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2020 License: MIT Imports: 12 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL