Skip to main content

LamaForge Encrypted Password Manager/User Auth

Project description

LFPWM

If you are using it for the first time, you must create a user data table.

Developed in: VSCode

LamaForge PW Manager pip Package Documentation

Summary: Lamaforge PW Manager is a secure Pypi package for password storage and user authentication. This program allows users to create a custom user instance with the predefined User class. Another feature is that you can easily create and store encrypted data of your own or take input from a user of the developer's application.

Passwords are encrypted before they are stored locally. The database used for this application is SQLite3. SQLite3 uses a database created on your local machine and is equally as safe as any other database.

Link to repository: https://github.com/gonhunterx/LFPWM

(For specific use examples of methods and parameters go to the Example Usage in Python section)

Step 1 (in terminal):

pip install LFPWM

Step 2a: (In your .py file)

from LFPWM.users import User  

Step 2b: (In your .py file)

from LFPWM.users import PasswordManager as pm

(These steps will allow you to access all functionality of the LFPWM Package.)

After installation,

LFPWM pip package usage:

Password Manager (PasswordManager)

The PasswordManager class in the LFPWM package is designed to handle the encryption and decryption of passwords. It utilizes the Fernet symmetric encryption scheme from the cryptography library.

Methods:

encrypt_password(password: str) -> bytes Encrypts the given plaintext password.

Parameters:

password (str): The plaintext password to be encrypted. Returns: The encrypted password.

decrypt_password(encrypted_password) -> str Decrypts the given encrypted password.

Parameters:

encrypted_password: The encrypted password. str: The decrypted plaintext password.

User Class (User)

The User class represents a user entity and includes methods for managing user information and storing encrypted passwords.

Methods:

set_username(new_username: str) Updates the username for the user.

Parameters:

new_username (str): The new username to set.

set_password(new_password: str) Updates the password for the user.

Parameters:

new_password (str): The new password to set.

insert_data(title: str, data: str) Inserts encrypted password data into the UserData table.

Parameters:

title (type: string): The title associated with the stored password. data (type: string): The plaintext password to be encrypted and stored.

get_data() Retrieves and decrypts stored password data from the UserData table, then prints it.

remove_data(data_to_delete: str)

Deletes password data associated with a given title.

Parameters: data_to_delete(str): The title of the data to be deleted.

Example Usage In Python: from LFPWM.sql_db import create_connection from LFPWM import User

Create a user instance

user = User("example_user", "example_password")

Set a new username

user.set_username("new_username")

Set a new password

user.set_password("new_password")

Insert data into UserData table

user.insert_data("Email", "user@example.com")

Retrieve and print stored data

user.get_data()

Remove data by title

user.remove_data("Email")

Encrypt your own data for use

Item_to_encrypt = “Hello World”
encrypted_item = PasswordManager.encrypt_password(Item_to_encrypt)
print(encrypted_item)

This will print as an encrypted token. You can also use the PasswordManager’s decrypt_password static method. This will allow you to view the original value behind an encrypted one.

You can use it like this:

decrypted_item = PasswordManager.decrypt_password(encrypted_item)
print(decrypted_item)

This will print “Hello World” (The decrypted value of encrypted_item)

This example demonstrates some possible use cases of the User, and PasswordManager classes and their associated methods. You can integrate these functionalities into your own projects for secure password management and other data storage uses for small to medium-sized projects.

Full scale use case:

from LFPWM.users import User

if __name__ == "__main__":
    # Register a new user
    user = User.register("john_doe", "secure_password")

    if user:
        # Log in with the registered user
        logged_in_user = User.login("john_doe", "secure_password")

        if logged_in_user:
            # Insert some password data
            logged_in_user.insert_data("Email", "john_doe@example.com")
            logged_in_user.insert_data("Bank", "1234")

            # View stored password data
            print("Stored password data:")
            logged_in_user.get_data()

            # Remove password data
            logged_in_user.remove_data("Bank")

            # View updated password data
            print("Stored password data after removal:")
            logged_in_user.get_data()

            # Set a new username
            logged_in_user.set_username("john_smith")

            # Set a new password
            logged_in_user.set_password("new_secure_password")

            # Log out
            print("Logging out.")
            logged_in_user = None
        else:
            print("Login failed.")
    else:
        print("Registration failed.")

The output for this file:

Registration successful.
Stored password data:
Email john_doe@example.com
Bank 1234
Stored password data after removal:
Email john_doe@example.com
Logging out.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

LFPWM-1.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

LFPWM-1.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file LFPWM-1.1.0.tar.gz.

File metadata

  • Download URL: LFPWM-1.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for LFPWM-1.1.0.tar.gz
Algorithm Hash digest
SHA256 63d81b45b6173c6bb0eecad954a3787ac4b62e334a44652b925a8dc40e04157b
MD5 3b2f11960e30996ddfa68db3ccd106c4
BLAKE2b-256 170224873a2d254a7de2a9aae4925a48ad6e5f935ef40973a4aa3501b1a2b920

See more details on using hashes here.

File details

Details for the file LFPWM-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: LFPWM-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for LFPWM-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2d4c94ef5c7b0d27fc113037767e9ea5a9bc7694f8350bef1b042bcde2be6c5
MD5 deda7bacd78b72bcdf4b06033bc5a248
BLAKE2b-256 022eefd139994935c94b7cfe1c152990e6239a08b976ef7ad52571ce356ac709

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page