- Page-level encryption: Each 4 KiB page is encrypted individually with a unique nonce
- AEAD algorithms: Support for AEGIS-256 (fast, modern) and AES-GCM (NIST-approved)
- Data integrity: Built-in authentication tags prevent tampering and corruption
- High performance: As little as 6% read overhead and 14% write overhead
- In-memory keys: Encryption keys are never stored on disk
Fintech Applications
Meet regulatory requirements for sensitive financial data
Privacy-Focused Products
Build user trust with strong data protection
Healthcare Apps
Protect patient data and meet HIPAA compliance
AI/ML Applications
Secure training data and model outputs
What’s Encrypted
Encrypted
- All database pages with your data - The database file - Write-Ahead Log (WAL) file
Not Encrypted
- The database header (first 100 bytes)
Generate an Encryption Key
Generate a secure encryption key in hexadecimal format. The key size depends on the cipher you choose:- 256-bit (32 bytes)
- 128-bit (16 bytes)
For AEGIS-256 variants and AES-256-GCM:Output example:
Create an Encrypted Database
1
Launch with encryption
Use the Replace
--experimental-encryption flag and specify your cipher and key in the connection URI:YOUR_HEX_KEY with the key you generated above.2
Create and insert data
Once in the interactive shell, create a table and insert some data:
3
Verify encryption
Exit the shell (type You won’t be able to access the data. The database is encrypted on disk.
.quit) and try to open the database without the key:Open an Encrypted Database
To access an existing encrypted database, provide the same cipher and key used during creation:Supported Ciphers
Turso Database supports multiple variants of two AEAD encryption algorithms, offering different trade-offs between performance and compatibility.AES-GCM
NIST-approved standard for compliance requirements. Widely supported across industries.AEGIS
Modern, high-performance cipher family optimized for speed. Recommended for most use cases.Choosing a cipher:
- Use
aegis128Lfor 128 bit encryption,aegis256for 256 bit encryption (default recommendation) - Use the other AEGIS variants if your hardware supports it
aegis128X2aegis128X4aegis256x2aegis256x4 - For AES, use
aes128gcmfor 128 bit encryption,aes256gcmfor 256 bit encryption
URI Parameters
When creating or opening an encrypted database, use the following URI format:
Example URIs:
Performance
Encryption overhead is minimal, especially for smaller databases:- Read operations: ~6% overhead with AEGIS-256
- Write operations: ~14% overhead with AEGIS-256
- Overall: ~1-3% total time overhead for mixed workloads
Coming Soon
Future encryption features in development:- Key derivation from passphrases: Use memorable passphrases instead of raw keys
- Encrypt existing databases: Migrate unencrypted databases to encrypted format
- Key rotation: Update encryption keys without data loss