Skip to content

Password Generator and Strength Checker python package

License

Notifications You must be signed in to change notification settings

GreyTeamToolbox/passwords-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GreyTeamToolbox logo
Github Build Status License Created
Release Released Commits since release

Overview

THIS IS A WORK IN PROGRESS AND IS NOT YET READY FOR USE

This script is designed to generate secure passwords and evaluate their strength. It calculates password strength based on entropy, character variety, and rule-based penalties, and includes optional dictionary checks for common passwords. It can also analyze passwords from a file or assess the strength of user-provided passwords.

Features

  • Password Generation: Generate random, secure passwords based on customizable character policies.
  • Strength Evaluation: Check the strength of passwords based on entropy and rule-based criteria.
  • Batch Verification: Verify the strength of multiple passwords from a file.
  • Custom Dictionary Support: Use a custom dictionary to check for common or weak passwords.
  • Detailed Reporting: Get detailed feedback and an estimated crack time for each password on both CPU and GPU.

Requirements

  • Python 3.6+

  • tabulate library: Install via pip

    pip install tabulate

Usage

The script provides several options for generating passwords, checking strength, and analyzing passwords from a file. Below are examples of each usage mode.

1. Generate Passwords

Generate a specified number of passwords of a given length:

python password_script.py -l 16 -c 5
  • -l, --length: Specify the password length (default: 16).
  • -c, --count: Specify the number of passwords to generate (default: 1).

2. Verify a Specific Password

Check the strength of a specific password:

python password_script.py --verify "YourPassword123!"

3. Generate and Verify Passwords

Generate passwords and then evaluate their strength:

python password_script.py -l 16 -c 5 --verify-generated

4. Verify Passwords from a File

Check the strength of each password listed in a file:

python password_script.py --file passwords.txt

The passwords.txt file should contain one password per line.

5. Use a Custom Dictionary

Provide a custom dictionary file for password strength checking:

python password_script.py --verify "password" --dictionary custom_dict.txt

6. Save Results to a File

Save generated passwords or verification results to a specified file:

python password_script.py -l 16 -c 5 --verify-generated --save results.txt

Output

The output will display each password's strength information in a table format with the following columns:

  • Password: The generated or provided password.
  • Strength: The classification of password strength (Weak, Moderate, Strong, Very Strong).
  • Entropy (bits): The calculated entropy of the password.
  • Score: The password’s strength score.
  • Score (%): The percentage of the maximum score achieved.
  • Crack Time (CPU): Estimated time to crack the password using a CPU.
  • Crack Time (GPU): Estimated time to crack the password using a GPU.

Example Output

+-------------------------------+-------------+-------------------+----------+-------------+------------------------+-------------------------+
| Password                      | Strength    | Entropy (bits)    | Score    | Score (%)   | Crack Time (CPU)       | Crack Time (GPU)        |
+-------------------------------+-------------+-------------------+----------+-------------+------------------------+-------------------------+
| thisis another random password| Weak        | 141.01            | 50       | 50.00%      | 89.21 septillion years | 892.06 sextillion years |
+-------------------------------+-------------+-------------------+----------+-------------+------------------------+-------------------------+

Configuration

The script's configuration includes default values for password policies and scoring:

  • Password Policies: Customize policies such as character types (uppercase, lowercase, numbers, special characters), length bonuses, and penalties.
  • Scoring Criteria: Adjust the scoring based on password length, character variety, entropy, and rule-based penalties.

These settings can be modified in the Config class in the script.

Error Handling

  • File Not Found: If the specified file or dictionary file cannot be found, a warning is printed, and the script falls back to default settings.
  • Empty Character Set: If no character type is enabled for password generation, an error is raised.
  • Save Errors: If an error occurs while saving results, a message is displayed with details about the issue.

About

Password Generator and Strength Checker python package

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  
  •  

Packages

No packages published

Languages