Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spirosoik/go-secreter
A secreter interface to hash in database or use the transit engine of Vault
https://github.com/spirosoik/go-secreter
aws azure encryption golang keyvault kms transit-engine vault
Last synced: about 1 month ago
JSON representation
A secreter interface to hash in database or use the transit engine of Vault
- Host: GitHub
- URL: https://github.com/spirosoik/go-secreter
- Owner: spirosoik
- License: apache-2.0
- Created: 2021-02-12T11:36:05.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-13T09:34:39.000Z (almost 4 years ago)
- Last Synced: 2024-06-20T17:31:44.080Z (6 months ago)
- Topics: aws, azure, encryption, golang, keyvault, kms, transit-engine, vault
- Language: Go
- Homepage:
- Size: 3.32 MB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![PkgGoDev](https://pkg.go.dev/badge/github.com/spirosoik/go-secreter)](https://pkg.go.dev/github.com/spirosoik/go-secreter)
[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/spirosoik/go-secreter)# Secreter
A secreter interface to provide encryption in transit.## Supports
- Local (simple encryption)
- Vault transit engineIn Progress:
- AWS KMS
- Azure Key Vault`note: for Local must be a base64-encoded key, of length 32 bytes when decoded`
## Example
```bash
make run-example
```Encrypt and decrypt sensitive info example:
```golang
// Secreter initialise
secreter, err := encrypt.New(context.Background(), encrypt.Config{
SecretType: encrypt.LocalSecret,
SecretKey: "fyktabT5I8fFK-mkSbbxIsfsbcnP-4QFa5awWmyuGqs=",
})// Encrypt
secret, err := secreter.Encrypt(encrypt.Options{
Plaintext: "sensitive",
})// Decrypt
plaintext, err := secreter.Decrypt(encrypt.Options{
CipherText: secret,
})
```Check the full example [here](example/main.go)
If you want to generate keys for encryption you can use the following [binaries here](key-generator/)