Skip to content

nerdylua/password-manager-web

Repository files navigation

πŸ” CryptLock - Zero-Knowledge Password Manager

Next.js Firebase TypeScript Tailwind CSS License: MIT

A secure, zero-knowledge password manager with end-to-end encryption.
Your master password never leaves your device, ensuring complete privacy and security.

πŸš€ Live Demo β€’ πŸ”’ Security

πŸ“‹ Table of Contents


🎯 Problem Statement

The Challenge

Most people have 100+ online accounts but reuse only 5-7 passwords. Traditional password managers store your master password or have recovery mechanisms, meaning they can potentially access your data.

Why Your Passwords Are Safe from Everyone

CryptLock uses true zero-knowledge architecture - we literally cannot see your passwords, even if we wanted to.

Dual Authentication System

  • Account Password: Firebase authentication for app access (recoverable via email)
  • Master Password: Vault encryption key that never leaves your device (unrecoverable by design)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Your Device   β”‚    β”‚   CryptLock      β”‚    β”‚   Your Vault    β”‚
β”‚                 β”‚    β”‚   Servers        β”‚    β”‚                 β”‚
β”‚ Master Password │───▢│                 │───▢│ Encrypted Blob β”‚
β”‚ (Never Sent!)   β”‚    β”‚ Cannot Read This β”‚    β”‚ (Unreadable)    β”‚
β”‚                 β”‚    β”‚                  β”‚    β”‚                 β”‚
β”‚ AES-256 Key     ┼──▢│ Only Stores      ┼─-─▢│ Encrypted Data  β”‚
β”‚ (Local Only)    β”‚    β”‚ Encrypted Data   β”‚    β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Your Passwords Are Protected From:

  • βœ… Hackers: Even if CryptLock is breached, your data remains encrypted
  • βœ… Governments: No backdoors or master keys exist - we cannot be forced to decrypt
  • βœ… CryptLock Employees: Our team cannot access your passwords
  • βœ… Future Threats: Quantum-resistant by design
  • ⚠️ Trade-off: Forgotten master password = permanent data loss (this ensures your security)

πŸ”’ Security Architecture

Zero-Knowledge Design Principles

graph TD
    A[User Master Password] --> B[PBKDF2 Key Derivation]
    B --> C[AES-256 Encryption Key]
    C --> D[Client-Side Encryption]
    D --> E[Encrypted Data Blob]
    E --> F[Firebase Firestore]
    
    G[Server/Firebase] -.-> H[Never Sees Plain Text]
    I[CryptLock Team] -.-> H
Loading

Encryption Flow

  1. Master Password β†’ PBKDF2 (100,000+ iterations) β†’ AES-256 Key
  2. Client-Side Encryption β†’ Encrypted Blob β†’ Firebase Storage
  3. Only your device can decrypt with the original master password

Technical Implementation

  • πŸ” AES-256-CBC encryption with unique IVs
  • πŸ”‘ PBKDF2 key derivation (100,000+ iterations) with unique salts
  • 🚫 No plain-text storage on servers
  • πŸ›‘οΈ Firestore security rules prevent unauthorized access
  • πŸ”’ Master password never transmitted or stored anywhere

πŸ“Έ Screenshots

🏠 Landing Page

Screenshot 2025-05-31 042845 Zero-knowledge security with beautiful, modern design

πŸ“Š Security Dashboard

Screenshot 2025-05-31 031509 Real-time security insights and vault management

✨ Features

  • πŸ”‘ Password Generation - Cryptographically secure password generation with customizable criteria
  • πŸ“Š Security Dashboard - Real-time password strength evaluation and security insights
  • πŸ“ Multi-Type Storage - Store passwords, secure notes, credit cards, and identity information
  • 🚨 Security Monitoring - Password strength tracking and security recommendations
  • πŸ”„ Real-Time Sync - Encrypted data synchronization with optimized performance
  • πŸ’Ύ Offline Support - Works without internet connection with local caching
  • πŸ“± Cross-Platform Ready - Responsive web app design
  • πŸ›‘οΈ Route Protection - Automatic authentication guards and session management

🌐 Browser Extension

CryptLock includes a powerful browser extension that automatically detects password fields and saves them to your vault with one click.

✨ Extension Features

  • 🎯 Auto-Detection - Automatically finds password fields on any website
  • πŸ’Ύ One-Click Save - Save passwords directly from any website
  • πŸ”’ Zero-Knowledge - Passwords go directly to your encrypted vault
  • 🌍 Universal - Works on Gmail, GitHub, banking sites, and more
  • 🚫 No Local Storage - Extension never stores passwords locally

πŸ“¦ Installation

  1. Download: Visit your CryptLock homepage and click "Download Extension"
  2. Extract: Unzip the downloaded file to a folder
  3. Install:
    • Chrome/Edge: Go to chrome://extensions/ β†’ Enable Developer mode β†’ Load unpacked
    • Firefox: Go to about:debugging β†’ Load Temporary Add-on β†’ Select manifest.json
  4. Use: Visit any website, type in password fields, click "Save to CryptLock"

πŸ“ Extension files are in the /extension folder

πŸš€ Quick Start

Prerequisites

1. Clone & Install

# Clone the repository
git clone https://github.com/nerdylua/password-manager-web.git
cd password-manager-web

# Install dependencies
npm install
# or
yarn install

2. Environment Setup

Create a .env.local file in the root directory:

# Firebase Configuration
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key_here
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id

# Optional: Firebase Emulator (for development)
NEXT_PUBLIC_USE_EMULATOR=false

3. Run Development Server

npm run dev
# or
yarn dev

πŸŽ‰ Success! Visit http://localhost:3000 to see CryptLock in action!

πŸ—οΈ Tech Stack

Frontend

  • Next.js 15 (App Router)
  • TypeScript
  • Tailwind CSS
  • shadcn/ui components
  • Framer Motion
  • Lucide React icons
  • React Hook Form

Backend & Services

  • Firebase Authentication
  • Cloud Firestore
  • Firebase Hosting (optional)

Security & Crypto

  • CryptoJS (AES-256-CBC)
  • PBKDF2 key derivation
  • zxcvbn password analysis
  • Client-side encryption

Development

  • ESLint + Prettier
  • TypeScript strict mode
  • next-themes (theme switching)
  • Vercel deployment

πŸ“‚ Project Structure

password-manager-web/
β”œβ”€β”€ πŸ“ app/                     # Next.js App Router
β”‚   β”œβ”€β”€ πŸ“ api/                # API routes
β”‚   β”‚   └── download-extension/ # Extension download endpoint
β”‚   β”œβ”€β”€ πŸ“ auth/               # Authentication pages
β”‚   β”‚   β”œβ”€β”€ login/             # Login page
β”‚   β”‚   β”œβ”€β”€ register/          # Registration page
β”‚   β”‚   └── forgot-password/   # Password recovery
β”‚   β”œβ”€β”€ πŸ“ dashboard/          # Security dashboard
β”‚   β”œβ”€β”€ πŸ“ vault/              # Main vault interface
β”‚   β”œβ”€β”€ layout.tsx             # Root layout with providers
β”‚   β”œβ”€β”€ page.tsx               # Landing page
β”‚   β”œβ”€β”€ globals.css            # Global styles
β”‚   β”œβ”€β”€ not-found.tsx          # 404 page
β”‚   β”œβ”€β”€ global-error.tsx       # Global error handling
β”‚   └── favicon.ico            # Site favicon
β”œβ”€β”€ πŸ“ components/             # Reusable UI components
β”‚   β”œβ”€β”€ πŸ“ ui/                # shadcn/ui base components
β”‚   β”œβ”€β”€ AddItemModal.tsx       # Add/edit vault items
β”‚   β”œβ”€β”€ DeleteConfirmModal.tsx # Deletion confirmation
β”‚   β”œβ”€β”€ ErrorModal.tsx         # Error handling UI
β”‚   β”œβ”€β”€ RouteGuard.tsx         # Authentication guard
β”‚   β”œβ”€β”€ theme-provider.tsx     # Theme context provider
β”‚   β”œβ”€β”€ theme-toggle.tsx       # Theme switcher
β”‚   β”œβ”€β”€ master-password-education.tsx # Master password guidance
β”‚   β”œβ”€β”€ header-mobile.tsx      # Mobile navigation
β”‚   β”œβ”€β”€ animated-counter.tsx   # Animated statistics
β”‚   β”œβ”€β”€ floating-card.tsx      # Floating UI elements
β”‚   └── parallax-section.tsx   # Parallax effects
β”œβ”€β”€ πŸ“ extension/              # Browser extension
β”‚   β”œβ”€β”€ πŸ“ icons/             # Extension icons
β”‚   β”œβ”€β”€ manifest.json         # Extension manifest
β”‚   β”œβ”€β”€ popup.html            # Extension popup UI
β”‚   β”œβ”€β”€ popup.js              # Popup functionality
β”‚   β”œβ”€β”€ background.js         # Background script
β”‚   β”œβ”€β”€ content.js            # Content script
β”‚   └── styles.css            # Extension styles
β”œβ”€β”€ πŸ“ hooks/                  # React hooks & contexts
β”‚   β”œβ”€β”€ AuthContext.tsx       # Authentication & user state
β”‚   └── use-mobile.ts         # Mobile detection hook
β”œβ”€β”€ πŸ“ lib/                    # Core utilities & services
β”‚   β”œβ”€β”€ firebase.ts           # Firebase configuration
β”‚   β”œβ”€β”€ encryption.ts         # Zero-knowledge encryption
β”‚   β”œβ”€β”€ vault-service.ts      # Vault CRUD with real-time sync
β”‚   β”œβ”€β”€ password-strength.ts  # Security analysis
β”‚   β”œβ”€β”€ crypto-worker.ts      # Web worker for encryption
β”‚   β”œβ”€β”€ auth-utils.ts         # Authentication utilities
β”‚   β”œβ”€β”€ firebase-errors.ts    # Firebase error handling
β”‚   β”œβ”€β”€ security-config.ts    # Security configuration
β”‚   └── utils.ts              # General utilities
β”œβ”€β”€ πŸ“ public/                 # Static assets
β”œβ”€β”€ πŸ“ scripts/                # Build & utility scripts
β”‚   └── analyze-bundle.js     # Bundle analysis
β”œβ”€β”€ πŸ“ .next/                  # Next.js build output
β”œβ”€β”€ πŸ“ node_modules/           # Dependencies
β”œβ”€β”€ πŸ“„ middleware.ts           # Next.js middleware
β”œβ”€β”€ πŸ“„ next.config.js          # Next.js configuration (JS)
β”œβ”€β”€ πŸ“„ next.config.ts          # Next.js configuration (TS)
β”œβ”€β”€ πŸ“„ package.json            # Project dependencies
β”œβ”€β”€ πŸ“„ package-lock.json       # Locked dependencies
β”œβ”€β”€ πŸ“„ tsconfig.json           # TypeScript configuration
β”œβ”€β”€ πŸ“„ tailwind.config.ts      # Tailwind CSS configuration
β”œβ”€β”€ πŸ“„ postcss.config.mjs      # PostCSS configuration
β”œβ”€β”€ πŸ“„ eslint.config.mjs       # ESLint configuration
β”œβ”€β”€ πŸ“„ components.json         # shadcn/ui configuration
β”œβ”€β”€ πŸ“„ .gitignore             # Git ignore rules
β”œβ”€β”€ πŸ“„ LICENSE                # MIT License
└── πŸ“„ README.md              # This file

🀝 Contributing

We welcome contributions! Please fork the repository and submit a pull request.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ”‘ Remember: Your master password cannot be recovered due to our zero-knowledge architecture. Keep it safe!

Built with ❀️ using Next.js, Firebase, and cutting-edge cryptography.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •