Skip to content

This is a command-line password manager designed to securely store and encrypt passwords. The program enables users to store, retrieve, and manage credentials while ensuring maximum security and privacy. It leverages Fernet encryption from Python’s cryptography module to encrypt and decrypt passwords safely.

Notifications You must be signed in to change notification settings

palchhinparihar/Personal-Password-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 Personal Password Manager

📌 Description

This is a command-line password manager designed to securely store and encrypt passwords. The program enables users to store, retrieve, and manage credentials while ensuring maximum security and privacy. It leverages Fernet encryption from Python’s cryptography module to encrypt and decrypt passwords safely.

Users input website links, and the script automatically extracts platform names and usernames, encrypts passwords, and stores them in a CSV file. Stored credentials can be retrieved and decrypted whenever necessary, making it both efficient and user-friendly.

This project was developed as part of CS50P – Introduction to Programming with Python, focusing on essential programming concepts such as file handling, encryption, regular expressions, and user input validation.


🚀 Features

  • Automatic Platform & Username Extraction from URLs 🌐
  • Secure Password Encryption using Fernet cryptography 🔐
  • Encrypted Storage in CSV format 📂
  • Password Decryption on Demand for retrieving saved passwords 🔑
  • Tabulated Output for better readability 📊
  • Graceful Exit Handling to confirm before quitting ✅
  • Unit Testing for Key Functions 🧪

🛠️ How It Works

  1. Encryption Key Generation – If no encryption key exists, the script generates one and saves it in key.key.
  2. User Input – Users enter website links (e.g., https://github.com/username).
  3. Platform & Username Extraction – The script extracts the platform name and username from the link using regex.
  4. Password Input & Encryption – Users provide a password, which is encrypted using Fernet encryption before being stored in passwords.csv.
  5. Viewing Stored Passwords – Users can choose to display stored credentials. The encrypted passwords are decrypted before display.
  6. Graceful Exit Handling – The script confirms before exiting and provides an option to view saved passwords before quitting.
  7. Testing Implementation – A test_project.py file contains unit tests to verify encryption, decryption, and data handling.

📦 Modules Used

This project utilizes several Python modules:

  • cryptography.fernet – Provides Fernet encryption for secure password storage.
  • csv – Handles storing and retrieving credentials in a structured format.
  • re – Implements regex-based extraction of platform names and usernames.
  • sys – Allows controlled program exit handling.
  • os – Manages file operations, such as checking and creating the encryption key.
  • tabulate – Formats stored credentials in a readable tabular format.

📂 File Structure

📂 project
 ├── key.key              # Encryption key (auto-generated)
 ├── passwords.csv        # Encrypted passwords
 ├── project.py           # Main script
 ├── test_project.py      # Test script
 ├── README.md            # Documentation
 ├── requirements.txt     # Dependencies list

📜 File Descriptions

  • project.py: The core script handling user input, encryption, decryption, and data storage.
  • test_project.py: Unit test file verifying the correctness of encryption, decryption, and file operations.
  • key.key: Automatically generated encryption key required for encrypting and decrypting passwords.
  • passwords.csv: Securely stores encrypted user credentials in a structured format.
  • requirements.txt: Lists required dependencies for running the project.
  • README.md: Documentation explaining the project’s functionality, features, and structure.

🤔 Design Decisions

While designing this password manager, several key decisions were made:

  • Using CSV for Storage: CSV was chosen for its simplicity and human-readability while ensuring encrypted passwords remain secure.
  • Fernet Encryption: Ensures that passwords are stored safely with a symmetric encryption algorithm.
  • Automatic Platform Detection: Regex-based extraction improves user experience by reducing manual input.
  • Graceful Exit Handling: The program prompts users before exiting, ensuring they don’t accidentally close it without saving credentials.

The primary goal was to balance security, usability, and efficiency, ensuring a seamless experience for users while maintaining strong password protection.


🧪 Testing

Unit testing is implemented in test_project.py using the pytest module to verify key functions such as:

  1. Encryption & Decryption – Ensures passwords encrypt and decrypt correctly.
  2. Platform & Username Extraction – Validates regex-based extraction.
  3. File Handling – Tests reading and writing of credentials.

⚠️ Security Considerations

🔑 Do not delete key.key, as it is required for decryption. 🔑 Keep passwords.csv secure and avoid sharing it. 🔑 Use a strong master password for added security.

About

This is a command-line password manager designed to securely store and encrypt passwords. The program enables users to store, retrieve, and manage credentials while ensuring maximum security and privacy. It leverages Fernet encryption from Python’s cryptography module to encrypt and decrypt passwords safely.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages