datasec

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package datasec provides at-rest encryption for secrets stored in SQLite.

The key lives in dataDir/secrets.key (mode 0600) and IS included in backup archives — the encrypted DB is useless without it, so a backup that left it out would not restore to a working panel on a fresh host. The trade-off is that a backup archive is as sensitive as the key itself: treat it accordingly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(s string) (string, error)

Decrypt returns plaintext; values without enc:v1: pass through (legacy rows).

func Encrypt

func Encrypt(s string) (string, error)

Encrypt returns s unchanged when empty; otherwise an enc:v1:… blob.

func EncryptFile

func EncryptFile(path string) ([]byte, error)

EncryptFile reads path and returns encrypted bytes (AES-GCM, random nonce prepended).

func Init

func Init(dataDir string) error

Init loads or creates the per-install encryption key. Call once before opening the store.

Types

This section is empty.

Jump to

Keyboard shortcuts

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