End-to-end encrypted journaling app with a zero-knowledge server. Only the user can read their journal entries.
- End-To-End Encrypted (e2ee) all journal entries are e2ee on the client side before sent to server
- Zero-Knowledge Server The server never see your plain text, passkey or your master key
- Date based journaling All journals are indexed by date, you may revisit your entries via calendar
- NextJS app router
- TailwindCSS
- TipTap Editor
- ReactBits Components
- NextJS api routes
- MongoDB
- Web Crypto API
- AES-GCM for encrypting journals
- PBKDF2 for key derivation from passkey
- User signs up with username, password, and a passkey.
- A master key is randomly generated on the client side.
- KEK (key encryption key) is derived from the user's passkey.
- The master key is encrypted using KEK and stored on the server.
- Server now knows about:
- Encrypted master key
- master key IV
- Salt
- iterations
- On login the encrypted master key is decrypted on client side using user's passkey.
- All journal entries are encrypted and decrypted using master key.
The master key is not by any chance recoverable. Therefore store your passkey in a safe location. Losing passkey will result in losing access to your data.
git clone "https://github.com/Aarav-S2005/PrivatePages.git"
cd PrivatePages
pnpm install
pnpm dev
- create a .env.local file in root folder
- fill up the following
MONGO_URI=mongodb://localhost:27017/
JWT_SECRET=<JWT SECRET>
FRONTEND_URL=http://localhost:3000/
NEXT_PUBLIC_API_URL=http://localhost:3000/api
EMAIL_USER=<YOUR EMAIL>
EMAIL_PASS=<YOUR EMAIL APP PASSWORD (DO NOT PASTE YOUR ACTUAL GMAIL PASSWORD)>