A package to generate secure passwords with customizable options and check vulnerability and strength
Project description
SafePassGen
SafePassGen is a Python package for generating secure, customizable passwords with various constraints. It also includes functionality to check the strength and vulnerability of passwords, making it a comprehensive tool for managing password security.
Features
- Generate passwords with specific requirements:
- Include or exclude numbers, lowercase, uppercase, and symbols.
- Option to start passwords with a letter.
- Avoid sequential characters.
- Avoid duplicate characters.
- Generate multiple passwords at once.
- Check password strength and vulnerability:
- Evaluate password length and character variety.
- Check against a list of common passwords and dictionary.
- Identify sequential or repeated characters.
Installation
You can install SafePassGen via pip:
```bash pip install SafePassGen ```
Or clone the repository and install manually:
```bash git clone https://github.com/diegoamengarelli/passgenesis.git cd secure_password pip install . ```
Usage
Basic Usage
```python from securepassword import PasswordGenerator
Create a password generator instance
generator = PasswordGenerator(length=12, include_numbers=True, include_lowercase=True, include_uppercase=True, include_symbols=True, no_duplicates=True, is_sequential=True, begin_with_letter=True, quantity=1)
Generate a password
passwords = generator.generate_passwords() print(passwords) # ['A1b2C3d4E5!'] ```
Advanced Usage
```python
Generate multiple passwords with specific constraints
generator = PasswordGenerator(length=16, include_numbers=True, include_lowercase=True, include_uppercase=True, include_symbols=True, no_duplicates=False, begin_with_letter=False, quantity=5)
passwords = generator.generate_passwords()
print(passwords)
```
Checking Password Strength
```python from securepassword import PasswordStrengthChecker
checker = PasswordStrengthChecker(common_passwords=["password", "123456"]) password = "A1b2C3d4E5!" result = checker.check_strength(password)
print(result) Output: { "strength": "Strong", "score": 5, "suggestions": [] } ```
Configuration Options
`PasswordGenerator`
- length: Length of the password(s) to be generated.
- include_numbers: Include numbers in the password.
- include_lowercase: Include lowercase characters in the password.
- include_uppercase: Include uppercase characters in the password.
- include_symbols: Include symbols in the password.
- no_duplicates: Ensure no duplicate characters within the password.
- begin_with_letter: Ensure the password starts with a letter.
- only_numbers: Generate passwords containing only numbers.
- quantity: Number of passwords to generate.
`PasswordStrengthChecker`
- common_passwords: List of common passwords to check against. (Default: 10000 most common passwords)
- min_length: Minimum length required for a password to be considered strong. (Default: 10 chars)
- dictionary_words: List of dictionary words to check against for potential vulnerability. (Default: English dictionary)
Testing
To run the tests, you can use:
```bash python -m unittest discover -s tests ```
Make sure all tests pass before using the package in a production environment.
Contributing
We welcome contributions to enhance the functionality and usability of SafePassGen. To contribute:
- Fork the repository.
- Create a new branch (`git checkout -b feature-branch`).
- Make your changes.
- Commit your changes (`git commit -m 'Add new feature'`).
- Push to the branch (`git push origin feature-branch`).
- Open a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for SafePassGen-1.0.6-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 64d2c0d994b945677da9b6212c2efad5b25e4378efcdea6eb3c0c343a390f1fd |
|
| MD5 | 49a6d25457aae4af4cadf5bd345357cb |
|
| BLAKE2b-256 | 956ccba9046869d6e02aea6f2406ae4bb77439da8a92885b7d5e8ba8cab1092b |