A mobile-first, responsive web application for secure text encryption and decryption using AES-256-GCM encryption.
- Military-grade Encryption: AES-256-GCM with PBKDF2 key derivation
- Mobile-first Design: Touch-friendly UI that works on all devices
- Dark Security Theme: Professional, modern dark UI
- Server-side Encryption: All crypto operations happen on the server
- Usage Tracking: SQLite database for anonymous usage statistics
- Copy to Clipboard: One-click copy for encrypted/decrypted output
- Real-time Feedback: Loading states and toast notifications
- Node.js 18+ installed
- npm or yarn package manager
-
Clone and install dependencies:
cd text-encrypt-decrypt npm install -
Start the development server:
npm run dev
-
Open in browser: Navigate to http://localhost:3000
Create a .env.local file (optional):
# Database path for SQLite (defaults to ./data/usage.db)
DATABASE_PATH=./data/usage.db- Start the dev server:
npm run dev - Find your local IP:
ipconfig(Windows) orifconfig(Mac/Linux) - Open
http://YOUR_LOCAL_IP:3000on your phone (same WiFi network)
Or use browser DevTools:
- Press F12 → Toggle device toolbar (Ctrl+Shift+M)
- Select iPhone SE or other mobile preset
- Verify responsive layout
┌─────────────────────────────────────────────────────────┐
│ ENCRYPTION │
├─────────────────────────────────────────────────────────┤
│ 1. User enters plaintext + password │
│ 2. Client sends to /api/encrypt │
│ 3. Server generates random salt (32 bytes) │
│ 4. Server generates random IV (16 bytes) │
│ 5. PBKDF2 derives 256-bit key from password + salt │
│ 6. AES-256-GCM encrypts plaintext │
│ 7. Server returns: base64(salt + IV + authTag + data) │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ DECRYPTION │
├─────────────────────────────────────────────────────────┤
│ 1. User enters ciphertext + password │
│ 2. Client sends to /api/decrypt │
│ 3. Server extracts salt, IV, authTag from ciphertext │
│ 4. PBKDF2 derives key from password + salt │
│ 5. AES-256-GCM decrypts and verifies authTag │
│ 6. Returns plaintext or error if password is wrong │
└─────────────────────────────────────────────────────────┘
- Passwords are never logged or stored
- Plaintext is never persisted
- Random salt/IV for each encryption (prevents rainbow table attacks)
- PBKDF2 with 100,000 iterations (slows brute-force attacks)
- GCM auth tag (detects tampering)
MIT License - feel free to use and modify!