Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nasa9084/go-secret
https://github.com/nasa9084/go-secret
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nasa9084/go-secret
- Owner: nasa9084
- License: mit
- Created: 2018-12-18T01:33:28.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-08T01:44:45.000Z (almost 6 years ago)
- Last Synced: 2024-10-05T00:40:52.876Z (about 1 month ago)
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-secret
=========
[![Build Status](https://travis-ci.org/nasa9084/go-secret.svg?branch=master)](https://travis-ci.org/nasa9084/go-secret)
[![GoDoc](https://godoc.org/github.com/nasa9084/go-secret?status.svg)](https://godoc.org/github.com/nasa9084/go-secret)Symmetrically encrypt and decrypt with passphrase using OpenPGP
## SYNOPSIS
``` go
func ExampleEncrypt() {
// a config including sensitive data
type Config struct {
ID string
Password string
}
cfg := Config{
ID: "somethingID",
Password: "somethingPassword",
}
masterPassword := "qwerty"var buf bytes.Buffer
// you can use Encrypter like json.Encoder
if err := secret.NewEncrypter(&buf).Encrypt(cfg, masterPassword); err != nil {
log.Fatal(err)
}
// now buf contains encrypted data
}```