Citadel
An encrypted-first embedded database engine written in Rust.
Every page is encrypted at rest. Encryption is not an afterthought - it's the foundation.
Encrypted at Rest
AES-256-CTR or ChaCha20, HMAC-SHA256 per page. No plaintext ever touches disk.
Full SQL Engine
CREATE/DROP TABLE, JOINs, subqueries, aggregates, indexes, parameterized queries.
ACID Transactions
Copy-on-Write B+ tree with shadow paging. Snapshot isolation, no WAL.
P2P Encrypted Sync
Merkle tree diffing over Noise protocol. Forward secrecy with ephemeral keys.
Cross-Platform
Windows, Linux, macOS, and more. C FFI and WebAssembly bindings.
Self-Contained
Single-file database. No external services, no runtime, no config.
Quick Start
cargo add citadel citadel-sqluse citadel::{DatabaseBuilder, Argon2Profile};
use citadel_sql::Connection;
let db = DatabaseBuilder::new("my.db")
.passphrase(b"secret")
.argon2_profile(Argon2Profile::Interactive)
.create()?;
let mut conn = Connection::open(&db)?;
conn.execute("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL);")?;
conn.execute("INSERT INTO users (id, name) VALUES (1, 'Alice');")?;
let result = conn.query("SELECT * FROM users;")?;