Documentation
¶
Overview ¶
Package encryption provides envelope encryption for Go systems.
Architecture ¶
The library uses envelope encryption: data is encrypted with a Data Encryption Key (DEK), and the DEK is encrypted with a system Key Encryption Key (KEK).
- cipher/: pluggable symmetric encryption interface and implementations (AES-256-GCM)
- systemkey/: system key (KEK) management abstractions and filesystem loaders
- envelope/: pure in-memory envelope encryption engine
- postgres/: stateless PostgreSQL keystore and key lifecycle management
- postgres/migrations: PostgreSQL migration SQL generator
- hash/: deterministic HMAC-SHA256 blind indexing
Package encryption provides envelope encryption for Go systems.
This package defines shared sentinel errors used across all sub-packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeyNotFound = errors.New("encryption key not found") ErrKeyExists = errors.New("encryption key already exists") ErrEncryption = errors.New("encryption failed") ErrDecryption = errors.New("decryption failed") ErrInvalidKeySize = errors.New("invalid key size") ErrKeyRevoked = errors.New("encryption key has been revoked") ErrKeyDestroyed = errors.New("encryption key has been destroyed") )
Sentinel errors used across the encryption library.
Functions ¶
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cipher defines the symmetric encryption interface used throughout the encryption library.
|
Package cipher defines the symmetric encryption interface used throughout the encryption library. |
|
aesgcm
Package aesgcm provides an AES-256-GCM implementation of the cipher.Cipher interface.
|
Package aesgcm provides an AES-256-GCM implementation of the cipher.Cipher interface. |
|
cmd
|
|
|
migrate-gen
command
Command migrate-gen generates SQL migration files for the PostgreSQL keystore.
|
Command migrate-gen generates SQL migration files for the PostgreSQL keystore. |
|
Package envelope implements pure in-memory envelope encryption using a two-tier key hierarchy: system keys (KEKs) protect data encryption keys (DEKs), and DEKs protect application data.
|
Package envelope implements pure in-memory envelope encryption using a two-tier key hierarchy: system keys (KEKs) protect data encryption keys (DEKs), and DEKs protect application data. |
|
examples
|
|
|
basic
command
Example: in-memory envelope encryption with envelope.Envelope.
|
Example: in-memory envelope encryption with envelope.Envelope. |
|
pii
command
Example: GDPR PII encryption and crypto-shredding lifecycle with PostgreSQL.
|
Example: GDPR PII encryption and crypto-shredding lifecycle with PostgreSQL. |
|
secrets
command
Example: Secret encryption with key rotation and historical audit retention.
|
Example: Secret encryption with key rotation and historical audit retention. |
|
migrations
Package migrations exposes the embedded PostgreSQL keystore migration.
|
Package migrations exposes the embedded PostgreSQL keystore migration. |
|
Package testutil provides test helpers for encryption testing.
|
Package testutil provides test helpers for encryption testing. |
Click to show internal directories.
Click to hide internal directories.