Skip to main content

A simple utility package for passwords

Project description

passwordler

Documentation Status

This package provides password management tools in Python. The package consists of four functions:

  • generate_password: This function creates a random password containing a mix of upper and lower case letters, numbers, and symbols. The inclusion of numbers and symbols can be controlled through parameters.
  • password_strength: This function tests the strength of a string to be used as a password. It determines password strength by assessing the length and the amount of capital letters, numbers and special characters used.
  • encrypt_password: Encrypts a password using a simple substitution cipher. This function applies a character mapping based on a shuffled character set, providing basic encryption.
  • decrypt_password: Decrypts a message that was encrypted using the encrypt_password function. It reverses the encryption process by mapping each character of the encrypted message back to its original character.

This Python package is useful for users seeking an integrated solution for password management, offering a user-friendly experience. With key functionalities consolidated in one package, users can effortlessly generate strong passwords, evaluate their strength, and grasp encryption and decryption methods through our straightforward substitution cipher.

passwordler in the Python Ecosystem

There are many password related packages already on the PyPI server. We have selected a few key examples that complete the same functions as our package. An example of a package that is similar to our password_creator function can be found here. Similarly, there are also other packages that check for the strength of passwords, one of which can be seen here, this is similar to our password_strength function. There is also a password encryption package which does the same thing as our password_encryption functions. However, there were no password decryption specific function on PyPI. The advantage of our package lies in its comprehensive suite of password-related functions, complemented by an original and intuitive algorithm that demonstrates the fundamental principles of password encryption and decryption.

Installation

To use the release 2.0.0, clone the repository to your local machine. In the root directory run the following commands to install passwordler locally:

$ conda create --name passwordler python=3.11 -y
$ conda activate passwordler
$ pip install poetry
$ poetry install
$ pip install passwordler

Using passwordler in Python

After installing passwordler with pip, you can use its functions in Python as follows:

  1. Encrypting a Password:

    from passwordler.encrypt_password import encrypt_password
    
    # Encrypt a password with a default seed
    encrypted_password = encrypt_password("YourPasswordHere")
    print(encrypted_password)  # Prints the encrypted password
    

    If you want to use a specific seed for the encryption, you can pass it as a second argument:

    # Encrypt a password with a specific seed
    encrypted_password = encrypt_password("YourPasswordHere", 42)
    print(encrypted_password)  # Prints the encrypted password using the specified seed
    
  2. Decrypting a Password:

    To decrypt a password that was encrypted with the encrypt_password function, use the decrypt_password function with the same seed used for encryption:

    from passwordler.decrypt_password import decrypt_password
    
    # Decrypt a password
    decrypted_password = decrypt_password(encrypted_password, 42)
    print(decrypted_password)  # Prints the decrypted password, which should match "YourPasswordHere"
    
  3. Evaluating Password Strength:

    The password_strength function evaluates the strength of a password based on length, use of uppercase letters, numbers, and special characters:

    from passwordler.password_strength import password_strength
    
    # Evaluate the strength of a password
    strength = password_strength("YourPasswordHere")
    print(strength)  # Prints the strength of the password (e.g., 'Your password is: Strong')
    

    Remember to replace "YourPasswordHere" with the actual password you wish to process in the above examples. The password_strength function will rate the password as 'Weak', 'Good', or 'Strong' based on its complexity and common password patterns.

  4. Generating a Password:

    generate_password allows you to create a secure password of customizable length and complexity, with options to include or exclude special characters and numbers.

    from passwordler.generate_password import generate_password
    # Encrypt a password with a default seed
    password = generate_password()
    print(password)  # Prints the generated password
    

    The function has three default parameters: length=12, include_special_characters=True, include_numbers=True. You can change these parameters to generate a password of your liking.

         generate_password(45, False, False)  # Generates a password of length 45 without special characters and numbers
    

Running Tests

To ensure passwordler is functioning correctly on your system, you can run the test suite with pytest. First, ensure you have pytest installed:

$ pip install pytest

If you have cloned the repository and want to run the tests, navigate to the root directory of the project and execute:

$ pytest

To show test coverage report

$ pytest --cov=passwordler --cov-report term

Contributing

For information about how to contribute to this package, please review our Contributing document. All contributors must abide by our Code of Conduct

License

This packages uses the MIT License, more information can be found here

Credits

passwordler was created with cookiecutter and the py-pkgs-cookiecutter template

Contributors

  • Michelle Hunn
  • Kiersten Gilberg
  • Rory White
  • Yiwei Zhang

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

passwordler-0.0.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

passwordler-0.0.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file passwordler-0.0.1.tar.gz.

File metadata

  • Download URL: passwordler-0.0.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for passwordler-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ca65ff3725a46c709adb9c98d19fbca57eaef4344b87585f6f6796595dd1a156
MD5 c064a0889246e91178152d8034911744
BLAKE2b-256 772bb739f5935ef62f12f44fdb54b88f35a77a367c3c51ffad0a62579c741736

See more details on using hashes here.

File details

Details for the file passwordler-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: passwordler-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for passwordler-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 481434e2163eeee4ce14aa2fc6a56be6ca84c357204f016173f586fb0c66c4b3
MD5 6fda9685dcf432f7e9ded85f0cdc0ef1
BLAKE2b-256 ee777207404829de035d1b015ad935ea74223de0c55d048123ada3a03b50091a

See more details on using hashes here.

Supported by

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