Your Personalized Credential Manager
π Project Insights
| π Stars | π΄ Forks | π Issues | π Open PRs | π Closed PRs | π οΈ Languages | π₯ Contributors |
This project is now OFFICIALLY accepted for:
π Exciting News...
π This project is now an official part of GirlScript Summer of Code β GSSoC 2025! πππ» Weβre thrilled to welcome contributors from all over India and beyond to collaborate, build, and grow .
π©βπ» GSSoC is one of Indiaβs largest 3-month-long open-source programs that encourages developers of all levels to contribute to real-world projects π while learning, collaborating, and growing together. π±
π With mentorship, community support, and collaborative coding, it's the perfect platform for developers to:
β¨ Improve their skills π€ Contribute to impactful projects π Get recognized for their work π Receive certificates and swag!
π I canβt wait to welcome new contributors from GSSoC 2025 to this Secure-Creds project family! Letβs build, learn, and grow together β one commit at a time. π₯π¨βπ»π©βπ»
A Secure Credential Manager built using the MERN stack (MongoDB, Express, React, Node.js) with advanced cryptographic features to ensure maximum security. It uses CryptoJS and bcrypt for encryption and hashing, and JWT for session management.
- π User Authentication using hashed passwords (
bcrypt) - π JWT-based Session Management (expires after 15 minutes)
- π Multi-Factor Authentication (MFA) - TOTP, Email, SMS
- π Protected Routes: Only authenticated users can access sensitive routes
- π Password Verification required to perform sensitive operations (even with valid session)
- π Credential Encryption using a unique key per credential
- π QR Code Generation for TOTP authenticator setup
- π Backup Codes for emergency MFA access
- π Encryption Keys are never stored in the database or backend memory
- π Sensitive data is cleared from memory immediately after use
- π Add / View / Delete credentials securely
β οΈ Mitigates session hijacking via enforced re-verification using password- π± Responsive Design - Works on desktop and mobile devices
- π¨ Modern UI/UX with intuitive navigation
- Dark Mode available
- Frontend: React, Axios
- Backend: Node.js, Express.js
- Database: MongoDB with Mongoose
- Encryption/Hashing: CryptoJS, bcrypt
- Auth & Session: JSON Web Tokens (JWT)
- Security Principles: Zero knowledge encryption, protected routes, memory safety
- Passwords are hashed using bcrypt before storing in DB.
- On successful login, a JWT token is issued, valid for 15 minutes.
- All sensitive backend routes require a valid JWT token.
- Unauthorized users are blocked.
- Each operation requires password confirmation, even if JWT is valid.
- This ensures protection in case the session token is hijacked.
- Each credential is encrypted with a unique key:
key = SHA256(salt + credentialUID + userPassword) - The key is never stored.
- The encrypted data is stored, but key is derived on-the-fly during decryption.
- Sensitive keys, raw passwords, and decrypted data are immediately removed from memory after use.
- After Deleting
- Node.js (v18 or higher)
- npm (v8 or higher)
- MongoDB (Local installation or MongoDB Atlas)
- Git
git clone https://github.com/Abhishek-Verma0/PETV83L-Abhishek-Verma-Secure-Credential-Manager-With-Key-Encryption.git
cd PETV83L-Abhishek-Verma-Secure-Credential-Manager-With-Key-Encryptioncd server
npm installCreate a .env file in the server directory:
# ================================
# REQUIRED CONFIGURATION
# ================================
# Database Configuration
MONGODB_URL=mongodb://localhost:27017/credentialmanager
# For MongoDB Atlas: mongodb+srv://username:password@cluster.mongodb.net/credentialmanager
# JWT Secret (Use a strong, random string)
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production-min-32-chars
# Server Port
PORT=5000
# ================================
# OPTIONAL - EMAIL MFA CONFIGURATION
# ================================
# Gmail Configuration (Recommended)
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-gmail-app-password # NOT your regular password - use App Password
EMAIL_FROM=noreply@credentialmanager.com
# Alternative Email Providers
# EMAIL_HOST=smtp.your-provider.com
# EMAIL_PORT=587
# EMAIL_SECURE=false
# ================================
# OPTIONAL - SMS MFA CONFIGURATION (Twilio)
# ================================
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=your-twilio-auth-token
TWILIO_PHONE_NUMBER=+1234567890
# ================================
# DEVELOPMENT SETTINGS
# ================================
NODE_ENV=development# start backend server
npm startCreate a .env file in the client directory:
env
# API Configuration
VITE_API_URL=http://localhost:5000
VITE_PORT=5173
# Start frontend server
npm run dev- Access the Application
- Open your browser and go to
http://localhost:5000 - Register a new account or login with existing credentials
- Open your browser and go to
- Enable 2-Factor Authentication on your Gmail account
- Generate App Password:
- Go to Google Account Settings
- Security β 2-Step Verification β App passwords
- Select "Mail" and generate a 16-character password
- Update .env file:
EMAIL_USER=youremail@gmail.com EMAIL_PASS=abcd-efgh-ijkl-mnop # 16-character app password
For other email services, modify the configuration in server/services/emailService.js:
// Outlook/Hotmail
service: 'hotmail'
// Yahoo
service: 'yahoo'
// Custom SMTP
host: 'smtp.your-provider.com'
port: 587
secure: false- Sign up for Twilio: https://www.twilio.com/
- Get a phone number from Twilio Console
- Find your credentials:
- Account SID (starts with AC...)
- Auth Token
- Phone Number (format: +1234567890)
- Update .env file:
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx TWILIO_AUTH_TOKEN=your-auth-token-here TWILIO_PHONE_NUMBER=+1234567890
- Install MongoDB on your system
- Start MongoDB service:
# macOS (with Homebrew) brew services start mongodb-community # Linux (Ubuntu) sudo systemctl start mongod # Windows # Start MongoDB service from Services panel
- Use connection string:
MONGODB_URL=mongodb://localhost:27017/credentialmanager
- Create account at MongoDB Atlas
- Create a cluster
- Get connection string and replace
<username>,<password>, and<cluster-url> - Use connection string:
MONGODB_URL=mongodb+srv://username:password@cluster.mongodb.net/credentialmanager
{
"bcrypt": "^6.0.0", // Password hashing
"bcryptjs": "^3.0.2", // Alternative password hashing
"cors": "^2.8.5", // Cross-origin resource sharing
"dotenv": "^17.0.0", // Environment variables
"express": "^5.1.0", // Web framework
"jsonwebtoken": "^9.0.2", // JWT authentication
"mongoose": "^8.16.1", // MongoDB object modeling
"nodemailer": "^6.10.1", // Email sending
"qrcode": "^1.5.4", // QR code generation for MFA
"speakeasy": "^2.0.0", // TOTP implementation
"twilio": "^4.23.0" // SMS sending
}{
"axios": "^1.10.0", // HTTP client
"react": "^19.1.0", // UI library
"react-dom": "^19.1.0", // React DOM rendering
"react-qr-code": "^2.0.18", // QR code display component
"react-router-dom": "^7.6.3" // Client-side routing
}- π Password Hashing: bcrypt with salt rounds
- π JWT Authentication: 15-minute token expiration
- π‘οΈ Multi-Factor Authentication: TOTP, Email, SMS
- π Credential Encryption: AES-256 with unique keys per credential
- π« Memory Safety: Sensitive data cleared immediately after use
- π Protected Routes: Authentication required for sensitive operations
- π« Backup Codes: Emergency access codes for MFA
- π± TOTP (Time-based One-Time Password): Works with Google Authenticator, Authy, 1Password
- π§ Email MFA: Verification codes sent to registered email
- π² SMS MFA: Verification codes sent via text message
- π« Backup Codes: 10 single-use emergency codes
- π Easy Management: Enable/disable, regenerate codes
- Email: Uses Ethereal test service (no real emails sent)
- SMS: Mock mode (codes logged to console)
- Database: Local MongoDB recommended
- Hot Reload: Both client and server support hot reload
- Environment: Set
NODE_ENV=production - Email: Configure real email service
- SMS: Configure Twilio for real SMS
- Database: Use MongoDB Atlas or secure MongoDB instance
- SSL/HTTPS: Required for production
- Environment Variables: Use secure secret management
-
MongoDB Connection Failed
Solution: Check if MongoDB is running and connection string is correct -
JWT Token Expired
Solution: Login again - tokens expire after 15 minutes for security -
Email MFA Not Working
Solution: Use Gmail App Password, not regular password -
SMS MFA Not Working
Solution: Verify Twilio credentials and phone number format -
Port Already in Use
# Check what's using the port lsof -i :5000 # Kill the process kill -9 [PID]
Enable verbose logging:
DEBUG=true
LOG_LEVEL=debugPETV83L-Abhishek-Verma-Secure-Credential-Manager-With-Key-Encryption/
βββ π client/ # Frontend React application
β βββ π public/ # Static assets
β β βββ lock-icon.svg
β βββ π src/
β β βββ π auth/ # Authentication context
β β β βββ AuthContext.jsx
β β βββ π components/ # Reusable UI components
β β β βββ Button.jsx
β β β βββ Footer.jsx
β β β βββ FormInput.jsx
β β β βββ MFASettings.jsx # MFA setup and management
β β β βββ MFAVerification.jsx # MFA login verification
β β β βββ Navbar.jsx
β β β βββ PasswordPrompt.jsx
β β β βββ ProtectedRoute.jsx
β β β βββ ScreenshotPrevention.jsx
β β βββ π pages/ # Main application pages
β β β βββ Dashboard.jsx
β β β βββ ForgotPassword.jsx
β β β βββ Landing.jsx
β β β βββ Login.jsx
β β β βββ MFAPage.jsx
β β β βββ Register.jsx
β β β βββ ResetPassword.jsx
β β βββ π service/ # API service layer
β β β βββ auth.js
β β β βββ credentials.js
β β β βββ mfa.js # MFA API calls
β β βββ π styles/ # Component styles
β β β βββ dashboard.css
β β β βββ mfaSettings.css
β β β βββ mfaVerification.css
β β β βββ responsive.css
β β β βββ ...
β β βββ App.jsx # Main app component
β β βββ main.jsx # App entry point
β βββ package.json
β βββ vite.config.js
βββ π server/ # Backend Node.js application
β βββ π middleware/ # Express middleware
β β βββ auth.js # JWT authentication
β β βββ mfa.js # MFA verification
β βββ π models/ # MongoDB models
β β βββ Credential.js
β β βββ User.js # Enhanced with MFA fields
β βββ π routes/ # API routes
β β βββ auth.js # Authentication routes
β β βββ credentials.js # Credential CRUD operations
β β βββ mfa.js # MFA setup and verification
β β βββ passwordReset.js
β βββ π services/ # External service integrations
β β βββ emailService.js # Email OTP and notifications
β β βββ smsService.js # SMS OTP via Twilio
β βββ index.js # Server entry point
β βββ package.json
βββ π screenshots/ # Application screenshots
βββ π MFA_SETUP_GUIDE.md # Detailed MFA setup guide
βββ π README.md # This file
















