/SecurePass-A-Password-Manager

Password Manager using Python and SQLite

Primary LanguagePython

Secure-Passwords

Overview

This Python program securely manages website passwords. It encrypts credentials, analyzes password strength, and lets you add, delete, update, and view them (decrypted for a short time). It can also open website login pages or copy passwords to your clipboard. Currently educational, it lays the foundation for a robust password management solution.

Password Manager Program Functions:

main()

  • Purpose: The program's entry point. Initializes the database (commented out for subsequent runs), presents the sign-up/sign-in menu, and handles user interaction based on their choice.
  • Parameters: None
  • Returns: None (exits the program)

sign_up()

  • Purpose: Guides the user through the sign-up process (creating username, setting master password, storing verification key).
  • Parameters: None
  • Returns: None (prints confirmation message and launches main menu)

kdf(master_password, salt_type)

  • Purpose: Derives a strong encryption key from the master password using a Key Derivation Function (KDF) with added salt.
  • Parameters:
    • master_password: The user's master password.
    • salt_type: String specifying the type of salt to be used.
  • Returns: The derived encryption key (bytes)

insert_into_master(username, verification_key)

  • Purpose: Inserts a new user record into the "master" table, storing the username and verification key derived from the master password.
  • Parameters:
    • username: The user's chosen username.
    • verification_key: The KDF-derived key used for verification during sign-in.
  • Returns: None (data is inserted into the database)

sign_in()

  • Purpose: Prompts the user for username and master password, verifies them, derives encryption/decryption key.
  • Parameters: None
  • Returns: None (launches program menu on successful verification)

verification(username, verification_key, encryption_key)

  • Purpose: Verifies user credentials during sign-in against stored information.
  • Parameters:
    • username: Username entered during sign-in.
    • verification_key: Verification key derived from user's master password.
    • encryption_key: Encryption/decryption key derived from master password.
  • Returns: None (prints message indicating successful verification or invalid credentials, launches program menu on success)

program_menu(mt_username, enc_dec_key)

  • Purpose: Presents the main menu with options for managing credentials.
  • Parameters:
    • mt_username: Master username for the current session.
    • enc_dec_key: Encryption/Decryption key derived from the master password.
  • Returns: None

add_credentials(mt_username, enc_dec_key)

  • Purpose: Adds new website credentials after encrypting the password.
  • Parameters:
    • mt_username: Master username for the current session.
    • enc_dec_key: Encryption/Decryption key derived from the master password.
  • Returns: None (prints confirmation message)

delete_credentials(mt_username, enc_dec_key)

  • Purpose: Deletes credentials for a specific website.
  • Parameters:
    • mt_username: Master username for the current session.
    • enc_dec_key: Encryption/Decryption key derived from the master password.
  • Returns: None (prints confirmation message)

update_credentials(mt_username, enc_dec_key)

  • Purpose: Updates the password for a specific website after encrypting the new password.
  • Parameters:
    • mt_username: Master username for the current session.
    • enc_dec_key: Encryption/Decryption key derived from the master password.
  • Returns: None (prints confirmation message)

view_credentials(mt_username, enc_dec_key)

  • Purpose: Retrieves and decrypts all stored credentials, displaying them for a limited time.
  • Parameters:
    • mt_username: Master username for the current session.
    • enc_dec_key: Encryption/Decryption key derived from the master password.
  • Returns: None (credentials are displayed)

website_login_page(mt_username, enc_dec_key)

  • Purpose: Retrieves website URL, opens it in the browser, decrypts and copies password to clipboard (limited time).
  • Parameters:
    • mt_username: Master username for the current session.
    • enc_dec_key: Encryption/Decryption key derived from the master password.
  • Returns: None

password_generator(mt_username, enc_dec_key)

  • Purpose: Generates a random password based on user-specified criteria.
  • Parameters:
    • mt_username: Master username for the current session.
    • enc_dec_key: Encryption/Decryption key derived from the master password.
  • Returns: None (generated password is displayed and offered for addition to password manager)

analyze_password_strength(mt_username, enc_dec_key, password_to_check)

  • Purpose: Analyzes the strength of a given password.
  • Parameters:
    • mt_username: Master username for the current session.
    • enc_dec_key: Encryption/Decryption key derived from the master password.
  • Returns: String indicating password strength ("Weak", "Medium", "Strong")