Files
sqlite3/vfs/adiantum/README.md
Nuno Cruces 07241d064a Adiantum encrypting VFS improvements. (#80)
Encrypt temporary files.
2024-04-21 01:56:38 +01:00

1.5 KiB

Go "adiantum" SQLite VFS

This package wraps an SQLite VFS to offer encryption at rest.

Warning

This work was not certified by a cryptographer. If you need vetted encryption, you should purchase the SQLite Encryption Extension, and either wrap it, or seek assistance wrapping it.

The "adiantum" VFS wraps the default SQLite VFS using the Adiantum tweakable and length-preserving encryption.

In general, any HBSH construction can be used to wrap any VFS.

The default Adiantum construction uses XChaCha12 for its stream cipher, AES for its block cipher, and NH and Poly1305 for hashing. Additionally, we use Argon2id to derive 256-bit keys from plain text.

The VFS encrypts all files except super journals: these never contain database data, only filenames, and padding them to the block size is problematic.

Temporary files are encrypted with random keys, as they may contain database data. To avoid the overhead of encrypting temporary files, keep them in memory:

PRAGMA temp_store = memory;

Important

Adiantum is typically used for disk encryption. The standard threat model for disk encryption considers an adversary that can read multiple snapshots of a disk. The only security property that disk encryption (and this package) provides is that the only information such an adversary can determine is whether the data in a sector has or has not changed over time.