Skip to content

opxyc/minivault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniVault to store secret key-value pairs

Note: For Learning Purpose.

All credits to Gophercises.

MiniVault is a package that can be used to store/retrieve secrets to/from a file. It encrypts the file contents using the key that you provide.

MiniVault uses AES for encryption and crypto/cipher package's cipher.Stream to create DecryptReader and EncryptWriter which can decrypt while reading from a file and encrypt while writing to a file respectively.


The repo also contains a command line tool (in cmd/) written using the minivault package.

Usage

minivault [command]

Available Commands:
  get         Gets a secret from your secret storage
  ls          Lists all keys stored
  passwd      Change current key of your secret storage
  rm          Removes a key and it's value from secret storage
  set         Sets a secret in your secret storage

Flags:
  -f, --file string   the path to file where secrets are stored

If -f is not provided, it stores secrets to $HOME/.secrets on Unix and %USERPROFILE%\\.secrets on Windows.

Example:

$> minivault set github_api_key 0imfnc8mVLWwsAawjYr4Rx-Af50DDqtlx
encoding key :
Value set successfully!

$> minivault get github_api_key
encoding key :
0imfnc8mVLWwsAawjYr4Rx-Af50DDqtlx

Installation / Tryout

git clone https://github.com/opxyc/minivault && cd minivault
go install cmd/cli.go

Now, ideally, it should generate a new executable cli in $GOPATH/bin. It can be renamed accordingly (Go does not currently provide an option to give a custom name for the binary generated during installation - as of 1.7).

About

minivault is a package that can be used to store/retrieve secrets to/from a file. It encrypts the file contents using the key that you provide.

Resources

Stars

Watchers

Forks

Contributors

Languages