https://github.com/systemslibrarian/crypto-lab-ckks-lab
Browser-based CKKS approximate FHE demo — encrypted floating-point arithmetic, homomorphic neural network inference, rescaling, and the complete FHE trilogy (TFHE + BGV/BFV + CKKS). Part of the crypto-lab suite.
https://github.com/systemslibrarian/crypto-lab-ckks-lab
approximate-arithmetic browser-crypto ckks crypto-lab cryptography encrypted-inference fhe homomorphic-encryption machine-learning microsoft-seal privacy privacy-preserving-ml rlwe typescript vite
Last synced: 1 day ago
JSON representation
Browser-based CKKS approximate FHE demo — encrypted floating-point arithmetic, homomorphic neural network inference, rescaling, and the complete FHE trilogy (TFHE + BGV/BFV + CKKS). Part of the crypto-lab suite.
- Host: GitHub
- URL: https://github.com/systemslibrarian/crypto-lab-ckks-lab
- Owner: systemslibrarian
- Created: 2026-04-12T19:46:41.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-16T20:08:36.000Z (about 2 months ago)
- Last Synced: 2026-04-16T21:33:41.126Z (about 2 months ago)
- Topics: approximate-arithmetic, browser-crypto, ckks, crypto-lab, cryptography, encrypted-inference, fhe, homomorphic-encryption, machine-learning, microsoft-seal, privacy, privacy-preserving-ml, rlwe, typescript, vite
- Language: TypeScript
- Homepage: https://systemslibrarian.github.io/crypto-lab-ckks-lab/
- Size: 85.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# crypto-lab-ckks-lab
## 1. What It Is
CKKS Lab demonstrates CKKS (Cheon-Kim-Kim-Song, ASIACRYPT 2017) — the Fully Homomorphic Encryption scheme for approximate arithmetic on real numbers. Unlike BGV/BFV which produce exact integer results, CKKS deliberately introduces small approximation errors to enable efficient floating-point arithmetic on encrypted data. A CKKS ciphertext encodes a vector of real numbers (n/2 slots for polynomial degree n) and supports vectorized addition and multiplication directly on ciphertexts. CKKS is the FHE scheme behind encrypted machine learning inference — the ability to evaluate a neural network on encrypted input without the server ever seeing the plaintext data.
## 2. When to Use It
- ✅ Encrypted neural network inference on private user data
- ✅ Encrypted statistics (mean, variance, dot products) on real-valued data
- ✅ Logistic regression and linear model scoring on encrypted inputs
- ✅ Privacy-preserving genomics (continuous-valued statistical tests)
- ❌ Exact integer arithmetic — use BGV or BFV instead
- ❌ Arbitrary boolean logic — use TFHE instead
- ❌ Applications requiring exact results (financial, cryptographic) — CKKS approximation error will silently produce wrong answers
- ❌ Real-time inference on large models — CKKS is significantly slower than plaintext computation (seconds to minutes for production models)
## 3. Live Demo
Link: https://systemslibrarian.github.io/crypto-lab-ckks-lab/
Six exhibits: what CKKS is and why approximation is the right choice for ML, CKKS encode/encrypt/add with approximation error shown honestly, homomorphic multiplication and rescaling with modulus level tracking, encrypted neural network inference end-to-end (2-layer network on encrypted inputs), precision and error accumulation across multiple operations, and the complete FHE trilogy comparison (TFHE + BGV/BFV + CKKS) with decision tree and library guide.
## 4. How to Run Locally
```bash
git clone https://github.com/systemslibrarian/crypto-lab-ckks-lab
cd crypto-lab-ckks-lab
npm install
npm run dev
```
## 5. Part of the Crypto-Lab Suite
Part of [crypto-lab](https://systemslibrarian.github.io/crypto-lab/) — browser-based cryptography demos spanning 2,500 years of cryptographic history to NIST FIPS 2024 post-quantum standards.
Whether you eat or drink or whatever you do, do it all for the glory of God. — 1 Corinthians 10:31