Skip to content

afzaalis/local-password-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python Security License Platform

πŸ” Local Password Manager

A secure, zero-knowledge CLI password manager with military-grade encryption

Fernet PBKDF2 SHA-256


✨ Features

Feature Description
πŸ”’ Zero-Knowledge Your passwords are never stored in plain text
πŸ” Fernet Encryption AES-128-CBC + HMAC-SHA256 for data protection
πŸ”‘ PBKDF2HMAC 480,000 iterations for secure key derivation
πŸ”„ Recovery System Recovery key + security questions for account recovery
πŸ’» Cross-Platform Works on Windows, Linux, and macOS
🎨 Beautiful CLI Colorful terminal interface with ASCII art
πŸ“¦ Modular Design Clean, maintainable codebase

οΏ½ Screenshots

Login Screen

                          β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ                          
                    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ                    
                β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆ                
              β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆ              
            β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆ            

    ╔═══════════════════════════════════════════════════════════════════════════╗
    β•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—    β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—      β•‘
    β•‘   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—     β•‘
    β•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘     β•‘
    β•‘   β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•     β•‘
    β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

    ═══════════════════════════════════════════════════════════════════════════
    β•‘ ⚠  WARNING: UNAUTHORIZED ACCESS IS STRICTLY PROHIBITED ⚠               β•‘
    ═══════════════════════════════════════════════════════════════════════════

πŸš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Installation

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

# Install dependencies
pip install -r requirements.txt

# Run the application
python main.py

First Run

  1. Create Master PIN - This is your main password (minimum 4 characters)
  2. Set Security Questions - Choose 3 questions for identity verification
  3. Save Recovery Key - Store this key safely! It's your only way to recover access

οΏ½ Usage

Main Menu

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚            MENU UTAMA               β”‚
    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    β”‚  [1] πŸ“‹ View All Passwords          β”‚
    β”‚  [2] βž• Add New Password            β”‚
    β”‚  [3] πŸ” Search Password             β”‚
    β”‚  [4] πŸ—‘οΈ  Delete Password            β”‚
    β”‚  [5] πŸ”„ Change Master PIN           β”‚
    β”‚  [6] πŸšͺ Exit                        β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Commands

Command Description
1 Display all stored passwords in a table
2 Add a new password entry (Service, Username, Password)
3 Search passwords by service name or username
4 Delete a password entry
5 Change your Master PIN
6 Exit the application

πŸ”’ Security Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      USER INPUT                              β”‚
β”‚                    (Master PIN)                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     PBKDF2HMAC                               β”‚
β”‚  β€’ Algorithm: SHA-256                                        β”‚
β”‚  β€’ Iterations: 480,000 (OWASP 2023 Standard)                β”‚
β”‚  β€’ Salt: 32 bytes cryptographically random                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   FERNET ENCRYPTION                          β”‚
β”‚  β€’ AES-128-CBC for confidentiality                          β”‚
β”‚  β€’ HMAC-SHA256 for authentication                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     data.vault                               β”‚
β”‚              (Encrypted Binary File)                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Security Features

  • Zero-Knowledge: Passwords are encrypted locally; even if someone gets your vault file, they can't read it without the PIN
  • Key Derivation: Uses PBKDF2 with 480,000 iterations to resist brute-force attacks
  • Authenticated Encryption: Fernet provides both encryption and authentication
  • Secure Recovery: Two-factor recovery using both Recovery Key and Security Questions

πŸ”‘ Recovery System

If You Forget Your PIN

  1. Run python main.py
  2. Type R when prompted for PIN
  3. Enter your Recovery Key (format: XXXX-XXXX-XXXX-XXXX-XXXX)
  4. Answer at least 2 out of 3 security questions correctly
  5. Create a new PIN or view your current PIN

Recovery Key Tips

  • βœ… Write it on paper and store in a safe
  • βœ… Store in a different password manager
  • βœ… Keep in a physical vault
  • ❌ Don't store on the same computer
  • ❌ Don't share with anyone
  • ❌ Don't take photos with unsecured devices

πŸ“ Project Structure

password-manager/
β”œβ”€β”€ main.py                     # Entry point
β”œβ”€β”€ requirements.txt            # Dependencies
β”œβ”€β”€ README.md                   # Documentation
β”œβ”€β”€ .gitignore                  # Git ignore rules
β”‚
└── password_manager/           # Main package
    β”œβ”€β”€ __init__.py            # Package metadata
    β”œβ”€β”€ config.py              # Configuration & constants
    β”œβ”€β”€ crypto.py              # Encryption & key derivation
    β”œβ”€β”€ storage.py             # Database operations
    β”œβ”€β”€ auth.py                # Authentication
    β”œβ”€β”€ recovery.py            # Recovery system
    β”œβ”€β”€ menu.py                # Menu handlers
    β”œβ”€β”€ ui.py                  # User interface
    └── styles.py              # Colors & ASCII art

Module Responsibilities

Module Purpose
config.py Constants, paths, security settings
crypto.py Encryption, decryption, hashing, key derivation
storage.py CRUD operations for vault files
auth.py Login and vault creation
recovery.py Security questions and recovery process
menu.py Handler for each menu option
ui.py Display functions and formatting
styles.py ANSI colors and ASCII art

⚠️ Important Security Notes

Files Generated (DO NOT COMMIT!)

File Description
data.vault Your encrypted passwords
salt.key Unique salt for encryption
recovery.vault Encrypted recovery data
security.vault Encrypted security questions

These files are already in .gitignore and should NEVER be committed to version control.

Best Practices

  1. Use a strong Master PIN - Combine letters, numbers, and symbols
  2. Keep backups - Copy your .vault and .key files to secure locations
  3. Store Recovery Key safely - This is your only way to recover if you forget the PIN
  4. Don't share files - Each installation should have its own vault

�️ Development

Requirements

cryptography>=41.0.0

Running Tests

# Run the application
python main.py

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“œ License

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


πŸ™ Acknowledgments

  • cryptography - Python cryptographic library
  • Fernet - Symmetric encryption recipe
  • PBKDF2 - Password-Based Key Derivation Function

Made with ❀️ for secure password management

⚠️ Use at your own risk. Always maintain backups of your vault files.

About

Program CLI untuk menyimpan password secara aman menggunakan enkripsi **Zero-Knowledge** dengan arsitektur modular.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages