package
Version:
v1.10.0
Opens a new window with list of versions in this module.
Published: Apr 21, 2026
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package encrypt provides authenticated encryption for ATB bundles.
Wire format:
[4 bytes magic "ATBE"][1 byte version][16 bytes salt][12 bytes nonce][16 bytes auth tag][N bytes ciphertext]
View Source
const (
Magic = "ATBE"
LegacyVersion byte = 0x01
Version byte = 0x02
SaltSize = 16
NonceSize = 12
TagSize = 16
KeySize = 32
LegacyPBKDF2Iterations = 100_000
PBKDF2Iterations = 600_000
)
View Source
var (
ErrInvalidFormat = errors.New("encrypt: invalid format")
ErrUnsupportedVersion = errors.New("encrypt: unsupported version")
ErrDecryptFailed = errors.New("encrypt: decrypt failed")
)
Decrypt decrypts an encrypted ATB bundle payload.
Encrypt encrypts plaintext using AES-256-GCM with a random salt and nonce.
EncryptWithSaltNonce encrypts plaintext with caller-provided salt and nonce.
This is intended for deterministic test vectors and golden fixtures.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.