A password generating library
Project description
Password Generator Library
The Password Generator library provides a convenient way to generate secure and strong passwords. It utilizes the zxcvbn library to evaluate the strength of the generated passwords and provides insights into their crack time estimates at different brute force speeds.
Installation
To use the Password Generator library, you need to install the required dependencies. You can do this using pip:
pip install pandas zxcvbn
Usage
To use the Password Generator library, follow the steps below:
-
Import the
Generator
class from thepassword_generator
module:from password_generator import Generator
-
Create an instance of the
Generator
class:generator = Generator()
-
Generate password suggestions by calling the
generator
method:generator.generator(number_of_suggestions, password_length)
number_of_suggestions
(int): The number of password suggestions to generate.password_length
(int): The length of each password.
-
Retrieve the top password suggestions by calling the
get_top_passwords
method:top_passwords = generator.get_top_passwords(n)
n
(int): The number of top password suggestions to retrieve.
The
get_top_passwords
method returns a list of dictionaries, where each dictionary represents a top password suggestion. Each dictionary contains the following keys:'Sl.No.'
: The serial number of the suggestion.'suggested password'
: The suggested password.'score'
: The strength score of the password.'@100/hr'
: The crack time estimate at 100 guesses per hour.'@36,000/hr'
: The crack time estimate at 36,000 guesses per hour.'@196,000/hr'
: The crack time estimate at 196,000 guesses per hour.'@792.9M/hr'
: The crack time estimate at 792.9 million guesses per hour.
-
Display the top password suggestions using your preferred method.
-
You can also access the complete results of the password generation and strength evaluation by accessing the
results
attribute of theGenerator
instance:all_results = generator.results
The
results
attribute is a list of dictionaries, where each dictionary represents a password suggestion. The keys and values in each dictionary are the same as mentioned above.
That's it! You can now use the Password Generator library to generate strong and secure password suggestions.
Example
Here's an example that demonstrates the usage of the Password Generator library:
from password_generator import Generator
def main():
generator = Generator()
generator.generator(10, 12) # Generate 10 password suggestions of length 12
top_passwords = generator.get_top_passwords(5) # Retrieve the top 5 password suggestions
for password in top_passwords:
print(password['suggested password'])
if __name__ == "__main__":
main()
This example generates 10 password suggestions of length 12 and retrieves the top 5 suggestions. The top password suggestions are then printed.
Remember to handle any exceptions that may be raised by the library methods and adjust the parameters according to your specific requirements.
Note
While the Password Generator library provides strong and secure password suggestions, it's important to follow additional best practices for password security, such as using unique passwords for each account, regularly updating passwords, and enabling two-factor authentication whenever possible.
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 password-generator-library-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6743bf908e37099c99883260f392a8aba58fe8e070b85ee0c1b2da576c7fb97f |
|
MD5 | 4d32eb79a2d79675fab142bc8302a6ea |
|
BLAKE2b-256 | bacce675209fcd30d0e218558618ff24166c4d8ab6051d46cc54026e9fea675c |
Hashes for password_generator_library-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a58974a0a259642bd481800cc19b6e2a997086c360676b652b8161b1f907510 |
|
MD5 | bf4ddfebb89b2b1788c1ca988c714298 |
|
BLAKE2b-256 | c7c4ee03f9775cd2bdd62809c47b050d2034e3894900ffe77e3c996f81d0c0db |