encrypt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package encrypt provides at-rest encryption for the Yaad SQLite database. Uses AES-256-GCM to encrypt the entire DB file with a user-provided key. Based on Engram's E2E encryption approach.

Usage:

yaad init --encrypt          # generates key, saves to ~/.yaad/key
yaad init --key <base64key>  # use provided key

The DB is encrypted on disk and decrypted in memory when opened. This is file-level encryption, not SQLCipher (which requires CGO).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptFile

func DecryptFile(path, keyBase64 string) error

DecryptFile decrypts a file in-place using AES-256-GCM.

func EncryptFile

func EncryptFile(path, keyBase64 string) error

EncryptFile encrypts a file in-place using AES-256-GCM.

func GenerateKey

func GenerateKey() (string, error)

GenerateKey creates a new 256-bit encryption key.

func IsEncrypted

func IsEncrypted(path string) bool

IsEncrypted checks if a file appears to be encrypted (not valid SQLite header).

Types

This section is empty.

Jump to

Keyboard shortcuts

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