kscarlett / secret

The gophercises secret storage exercise

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🔐 Secret

Build Status Coverage Status Go Report Card

This project is based on the Gophercises lesson. I have made my own changes though.

DANGER

This project implements cryptography and has not been audited. I also do not claim to know what I'm doing when it comes to cryptography, so under no circumstances should you assume that this is safe to use in production! If you are looking for a proper secret storage solution, use Vault instead.

Usage

Secret can be used as a library in Go, or it can be used as a CLI application, using the wrapper.

Adding and retrieving a secret from Go is as simple as the following (error handling omitted for simplicity):

s := secret.NewInMemory("demo-password")
err := s.Set("example-key", "23819d20-9b07-4b20-8a6e-a3c533fa4994")
exampleKey, err := s.Get("example-key")

The same can be done on the command line like this:

$ echo "TODO"
TODO

Installing

go get -u github.com/kscarlett/secret

Changes from Gophercises

  • Use SHA256 instead of MD5 to turn the passphrase into the AES key in order to use AES-256 instead of AES-128.
  • Add tests

About

The gophercises secret storage exercise

License:MIT License


Languages

Language:Go 100.0%