Skip to main content

SecurePasswordGenerator is a tool for generating random passwords. It provides both command line utility and underlying python module.

Project description

This is a tool for generating random secure passwords. It provides both command line utility (CLI) and underlying python module.

SecurePasswordGenerator

Python Version securepasswordgenerator · PyPI PyPI - Status Maintenance LICENSE

ViewCount GitHub forks GitHub stars PyPI - Downloads contributions welcome GitHub issues

Table of Contents

Prerequisites

You'll need to have Python installed in order to run SecurePasswordGenerator. Start by downloading and installing Python.

Note: Python 3 is recommended, however SecurePasswordGenerator has been successfully tested with Python 2.6+

Installation

You can install this package from PyPI using pip:

python -m pip install securepasswordgenerator

Usage

Module

To use this package in your Python program, simply import the securepasswordgenerator module and call the generate function with the desired options. Or call predefined functions. Here is an example:

from securepasswordgenerator.password import generate

password = generate(length=12, use_lower_case=True, use_upper_case=True, use_numbers=True, use_special=True, use_hex=False)

This will generate a password that is 12 characters long and includes lowercase letters, uppercase letters, numbers, and special characters.

securepasswordgenerator provides the following methods:

securepasswordgenerator.generate()
# defaults to 8 characters long that includes atleast 1 lowercase, 1 uppercase, 1 number and 1 special character.
securepasswordgenerator.generate(length = 8, use_lower_case = True, use_upper_case = True, use_numbers = True, use_special = True, use_hex = False)
# optins can be provided to generate as you please.
securepasswordgenerator.decent() 
# Generate Memorable Passwords - Perfect for securing your computer or mobile device, or somewhere brute force is detectable.
securepasswordgenerator.strong() 
# Generate Strong Passwords - Robust enough to keep your web hosting account secure.
securepasswordgenerator.fort_knox() 
# Generate Fort Knox Passwords - Secure enough for almost anything, like root or administrator passwords.
securepasswordgenerator.ci_key() 
# Generate CodeIgniter Encryption Keys - Can be used for any other 256-bit key requirement.
securepasswordgenerator.wep_64() 
# Generate 64-bit WEP Keys
securepasswordgenerator.wep_128() 
# Generate 128-bit WEP Keys
securepasswordgenerator.wep_152() 
# Generate 152-bit WEP Keys
securepasswordgenerator.wep_256() 
# Generate 256-bit WEP Keys
securepasswordgenerator.wpa_160() 
# Generate 160-bit WPA Key
securepasswordgenerator.wpa_504()
# Generate 504-bit WPA Key

Sample code:

>>> import securepasswordgenerator as spw
>>> spw.generate()
'ZgnoiV*Q'
>>> spw.generate(15, use_lower_case=False, use_numbers=False, use_special=True)
'<)G,{IH~NDGZ+D@'
>>> spw.decent() 
'CONt8xy4Vw'
>>> spw.strong() 
'm?c$t?WP<y|}vVf'
>>> spw.fort_knox() 
"'>[&;6L8?->vXiKWh>Uoe<Uo-.x,Zb"
>>> spw.ci_key() 
'I9MMEnszZO4mKGJayBXe9kKsEGg7JXBs'
>>> spw.wep_64() 
'866EE'
>>> spw.wep_128() 
'9EBD3954549FC'
>>> spw.wep_152() 
'D5CB8A9668F2153D'
>>> spw.wep_256() 
'E775C1FA7D96CF94DFB19CB9ED534'
>>> spw.wpa_160() 
'1XkW\\eHu5,ox9I&K`I<R'
>>> spw.wpa_504()
"AkW~Z9/)d2rf`JWPU}CcUq*`BTsq8%'i+,~BAp2nf@*t!W&~rlpxq(Grh6>$1rj"

Command Line Utility

To generate a password from the command line, simply run the securepasswordgenerator command and specify the desired options. Here are a few examples:

securepasswordgenerator

This will generate a password that is 8 characters long that includes atleast 1 lowercase, 1 uppercase, 1 number and 1 special character.

securepasswordgenerator 11 -l -n -s -x -p

This will generate a password that is 15 characters long and includes lowercase letters, numbers, special characters, and hex characters.

Here are the available options:

usage: securepasswordgenerator [-h] [-l] [-u] [-n] [-s] [-x] [-p {decent,strong,fort_knox,wpa_160,wpa_504,wep_64,wep_128,wep_152,wep_256}] [length]

positional arguments:
  length                Length of password (default is 8 characters)

optional arguments:
  -h, --help            show this help message and exit
  -l, --lower-case      Use lowercase characters
  -u, --upper-case      Use uppercase characters
  -n, --numbers         Use numbers
  -s, --special         Use special characters
  -x, --hex             Use hex characters
  -p {decent,strong,fort_knox,wpa_160,wpa_504,wep_64,wep_128,wep_152,wep_256}, --password-strength {decent,strong,fort_knox,wpa_160,wpa_504,wep_64,wep_128,wep_152,wep_256}
                        Generate a password with a predefined strength

Note: securepasswordgenerator -p [option] or securepasswordgenerator --password-strength [option] doesn't require any other arguments

Changlog

See the change log here

License

This package is licensed under the MIT License. See the LICENSE file for details.

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

securepasswordgenerator-2.0.0.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

securepasswordgenerator-2.0.0-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

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