Introducing BYOK Encryption in Turso Cloud
Bring-Your-Own-Key encryption, previously Enterprise-only, is now available to self-service Turso Cloud customers starting on the Pro Plan. The database file and WAL are encrypted on disk and in S3, with each 4 KiB page encrypted individually under a unique nonce using AEAD ciphers (AEGIS, AES-GCM, ChaCha20-Poly1305). Keys are supplied per connection, held only in memory and never stored by Turso, so a lost key means a lost database. Encrypted databases are created and opened via CLI flags and support branching and point-in-time recovery with the same key and cipher.
Related posts
- Encrypting SQLite Databases with Turso: Local, Cloud, and BYOK
Turso mediumAdeptTurso offers two SQLite encryption models: native, open-source page-level encryption in its Rust rewrite of SQLite (still behind an --experimental-encryption flag, hex keys) and production-ready BYOK on Turso Cloud, where a base64 key is supplied per connection and never persisted by Turso. Both use AEAD ciphers (AEGIS, AES-GCM, plus ChaCha20-Poly1305 in Cloud only) and encrypt every page and the WAL. AEGIS-256 benchmarks show 0.5–2.8% mixed-workload overhead and roughly 9–14% write overhead. The guide recommends aes256gcm when compliance needs a NIST-approved cipher and aegis256 otherwise, and shows per-tenant databases with separate keys for cryptographic multi-tenant isolation. Native rekeying isn't supported yet, so key rotation means a dump-and-reimport into a new database.
- Introducing Fast, Native Encryption in Turso Database
Turso mediumAdeptTurso Database, a Rust rewrite of SQLite, now supports native encryption at rest using AEAD ciphers (AEGIS-256 and AES-GCM). Each page is encrypted individually with a fresh nonce, and the nonce and auth tag are stored in SQLite's per-page reserved space. Database and WAL files are encrypted, while the 100-byte header is not. Keys are supplied per connection via URI and kept only in memory. Benchmarks with AEGIS-256 show about 6% read and 14% write latency overhead on larger databases and under 3% on total runtime, with key derivation, rekeying and encrypting existing databases still planned.
- Why we chose Turso to secure AI credentials
Turso mediumAdeptEden, a gateway and control plane for database, API and AI traffic, uses Turso's in-process SQLite-compatible storage with AES-256-GCM whole-database encryption so a single Rust binary can run beside the workloads it governs without a separate Postgres. Whole-database encryption was chosen over column-level encryption, which is fragile across migrations and still leaks schema and row counts. To avoid forking the product, a compatibility layer (TursoPool, TursoConnection) mimics the tokio_postgres client surface and rewrites Postgres SQL at the connection boundary: bind parameters, NOW(), row locks, INTERVAL arithmetic, casts, JSON aggregation and ON CONFLICT predicates. File-backed deployments refuse to start without a 64-hex-character key and run with WAL and synchronous=NORMAL, and tests assert the on-disk file has no plaintext SQLite header.
- How Alien uses Turso to make BYOC deployments reliable
Turso mediumAdeptAlien's pull-mode BYOC operator, which runs inside customer cloud accounts and must survive restarts, network loss and half-applied deployments, replaced hand-rolled JSON state files with an embedded, encrypted Turso database. JSON files worked for a single deployment-state document but broke down once the operator had to handle approvals, buffered telemetry, command routing context and schema migrations, all needing transactional and partial updates across independent loops. A small schema (key/value state, approvals, telemetry buffer) opened from Rust with AEGIS-256 encryption at rest now serves as the durable coordination point between the sync, deployment, telemetry and command loops, with no extra service for customers to run.
- SQLite Encryption in Production: Key Management, Migration, and Real-World Use Cases
Turso mediumAdeptProduction SQLite encryption with Turso fails most often at the key, not the cipher. Generate keys from a CSPRNG (hex for local Turso Database, base64 for Turso Cloud, a common gotcha), keep them in a secret manager, and use one key per tenant. Rotation currently means export, reimport and a brief cutover window because native rekeying isn't available. Migrations from SQLCipher, SEE or plaintext SQLite are dump-and-reimport. AES-256-GCM is recommended over AEGIS for HIPAA and PCI-DSS because auditors expect a NIST-approved cipher, alongside a checklist of the key-management artifacts auditors want to see.