🔐 Simple Go-API useful to store sensitive data using the AuricVault PCI/HIPAA compliant encryption service.
$ go get -u github.com/lfaoro/auricvault
import "github.com/lfaoro/auricvault"
# Provide a .env file in your project with the following variables or export them.
# the .env file will be automatically parsed.
$ cat > .env << EOF
AURIC_URL="https://vault01.auricsystems.com/vault/v2/"
AURIC_URL2="https://vault02.auricsystems.com/vault/v2/" # optional
AURIC_CONFIGURATION=""
AURIC_MTID=""
AURIC_MTID_SECRET=""
AURIC_SEGMENT=""
EOF
// Instance a new Vault, choose the retention period
vault := auricvault.New(auricvault.Forever)
// If you want to see Debug information
auricvault.SetDebug()
data := "VISA,475055XXXX314032,0818"
// Encrypt using an auto-generated token
token, err := vault.Encrypt(data)
if err != nil {
log.Fatal(err)
}
fmt.Println("token: ", token)
// Encrypt using your own token
token, err := vault.Encrypt(data, "khR8pew41q0URCxtivea")
if err != nil {
log.Fatal(err)
}
fmt.Println("token: ", token)
// Retrieve the string data from the vault using the token
data, err := vault.Decrypt("khR8pew41q0URCxtivea")
if err != nil {
log.Fatal(err)
}
fmt.Println(data)
Some AuricVault API features and settings have been omitted in favor of simplicity. If you require any of the omitted features implemented, please open an issue.
Any help and suggestions are very welcome and appreciated. Start by opening an issue.
- Fork the project
- Create your feature branch
git checkout -b my-new-feature
- Commit your changes
git commit -am 'Add my feature'
- Push to the branch
git push origin my-new-feature
- Create a new pull request against the master branch