Help us shape the future of Go! Take the 2026 Go Developer Survey

secretbox

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package secretbox seals small secrets (such as API keys) at rest with AES-256-GCM, keyed from the server's secret in a caller-chosen domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveKey

func DeriveKey(secret, domain string) []byte

DeriveKey makes a 32-byte key from the server's secret in its own MAC domain.

func Open

func Open(key, aad, blob []byte) ([]byte, error)

Open reverses Seal. It fails when the key, aad or blob differ.

func Seal

func Seal(key, aad, plain []byte) ([]byte, error)

Seal encrypts plain and authenticates aad. The result is nonce||ciphertext.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL