Skip to content

SidrahRashid/password-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Password Manager

A simple yet secure Password Manager built in Python that allows users to store, encrypt, and retrieve passwords safely using the cryptography library.
This project focuses on data security, encryption, and authentication β€” providing a practical demonstration of secure credential management.


πŸš€ Features

  • πŸ”‘ Secure Encryption β€” All passwords are encrypted using Fernet (symmetric encryption).
  • πŸ‘€ Master Password β€” Access to stored credentials is protected with a master key.
  • πŸ’Ύ Local Storage β€” Encrypted credentials are saved securely in a local file.
  • 🧩 Add & View Mode β€” Easily add new credentials and retrieve stored ones.
  • ⚠️ Error Handling β€” Handles invalid tokens, missing files, and incorrect decryption gracefully.
  • 🧠 Beginner-Friendly Code β€” Simple, readable, and modular structure for easy understanding.

πŸ› οΈ Tech Stack

  • Language: Python 3
  • Libraries:
    • cryptography β€” for encryption & decryption
    • os β€” for file operations
    • getpass β€” for hidden master password input

🧩 How It Works

  1. Key Generation
    • The program generates a secure encryption key (key.key) if it doesn’t exist.
  2. Master Password
    • The key is used to encrypt/decrypt user passwords, acting as a β€œmaster key.”
  3. Add Mode
    • User inputs the account name, username, and password β€” all are encrypted and saved to passwords.txt.
  4. View Mode
    • Decrypts and displays stored credentials in a secure readable format.

πŸ’» Usage

1️⃣ Install dependencies

pip install cryptography

2️⃣ Run the script
python passwordmanager.py

3️⃣ Choose an option
Would you like to add a new password or view existing ones?
(add/view) or q to quit

πŸ“ File Structure
Password-Manager/
β”‚
β”œβ”€β”€ passwordmanager.py    # Main application file
β”œβ”€β”€ key.key               # Encryption key file (auto-generated)
β”œβ”€β”€ passwords.txt         # Encrypted password storage
└── README.md             # Documentation


βš™οΈ Example Output
Would you like to add a new password or view existing ones? (add/view) view
Enter master password:
---------------------------------
Website: Gmail
Username: sidrah123
Password: ********
---------------------------------

🧠 Concepts Learned
Symmetric Encryption using cryptography.fernet
Secure key management
File I/O operations
Exception handling in Python
Designing command-line interfaces

🌟 Future Enhancements
Integrate a password strength checker
Include a random password generator
Switch to SQLite database for storage
Add auto-lock and timeout functionality

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages