Zero-Decryption Relational Engine • TFHE / BGV Schemes Active
Project Icon

Homomorphic Database

Execute complex relational SQL queries, table joins, and analytical aggregations directly over encrypted ciphertext in pure Rust. Untrusted cloud servers execute mathematical predicates without ever learning plaintexts, table contents, or secret keys.

TERMINAL • CLONE & RUN FHE-DB SUITE BASH / POWERSHELL
git clone https://github.com/KELLERBABG/Homomorphic-Database.git && cd Homomorphic-Database && cargo test
LATTICE PARAMETERS • TORUS / RING-LWE NOISE BUDGET
POLYNOMIAL RING DEGREE (N)
8192
COEFFICIENT MODULUS log(Q) = 218 BITS
INHERENT NOISE BUDGET
48.2 BITS
BOOTSTRAPPING MARGIN REMAINING
RELATIONAL CIPHERTEXT JOIN
< 85 MS
RELINEARIZED VECTOR MULTIPLICATION
SERVER PLAIN-TEXT LEAKAGE
0 BYTES
MEMORY DUMP YIELDS RANDOM NOISE

Encrypted SQL Predicate Evaluation Testbench

Select a relational query. Watch FHE-DB compile the SQL predicate into ring polynomial circuits, evaluate multiplication on encrypted column vectors, and track noise growth.

SELECT user_id, credit_score
FROM encrypted_ledger
WHERE credit_score > 720 AND active_debt < 50000;
POLYNOMIAL NOISE CONSUMPTION 28% (No Bootstrapping Required)
[00:00:01] [FHE-CORE] BGV encryption scheme initialized over cyclotomic polynomial Ring Z[X]/(X^8192 + 1).
[00:00:01] [CIPHERTEXT] 50,000 user rows loaded into encrypted column vectors. Zero plaintexts in host RAM.

Lattice Cryptography & Ciphertext Algebra

FHE-DB implements state-of-the-art fully homomorphic algorithms so complex database operations run at native hardware speeds.

LAYER 01

BGV / BFV Exact Relational Algebra

Integer and boolean operations (equality checks, range queries, hash index matching) are evaluated over exact cyclotomic polynomial rings.

bgv::evaluate_equality(c_col, c_target)
LAYER 02

CKKS Fixed-Point Analytics & ML

Encrypted float vectors enable complex statistical aggregations (standard deviation, linear regression, neural inference) without loss of precision.

ckks::mult_and_rescale(&c_vec, scale_factor)
LAYER 03

TFHE Fast Boolean Gate Bootstrapping

For arbitrary nonlinear logic gates (AND, XOR, MUX), TFHE provides sub-10ms programmable bootstrapping that resets noise budgets indefinitely.

tfhe::bootstrap_gate(c_bit_a, c_bit_b)
LAYER 04

SIMD Slot Packing & Batching

Pack up to 4,096 scalar records into a single Ring-LWE ciphertext polynomial, parallelizing SQL filtering operations across thousands of rows per CPU instruction.

packing::simd_pack_batch(&records)
LAYER 05

Relinearization & Key-Switching

Quadratic tensor product expansion during ciphertext multiplication is compressed back to linear size using public relinearization evaluation keys.

relinearize(&c_prod, &eval_key)
LAYER 06

Cryptographic Zero-Knowledge Result Receipts

Clients receive mathematically verified proof certificates demonstrating that the server evaluated the exact query requested without tampering with outputs.

receipt::generate_evaluation_proof(&result)