Skip to main content

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.

Metadata

Release files for securepasswordgenerator 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for securepasswordgenerator 2.0.0
File Size Uploaded Provenance
securepasswordgenerator-2.0.0.tar.gz 6.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for securepasswordgenerator 2.0.0
File Interpreter ABI Platform
securepasswordgenerator-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / securepasswordgenerator-2.0.0.tar.gz

Download URL securepasswordgenerator-2.0.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
86a89301651c3415c9a1e9f051d5322fb489fecac3544e7d4534b5e972bacf06
BLAKE2b-256 checksum
How to use checksums
170d21227d2b60781483ac86b6d060a14db61363b7fc0d9f0922c004e173029a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / securepasswordgenerator-2.0.0-py3-none-any.whl

Download URL securepasswordgenerator-2.0.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba870d24652fea557b37c72e498a3b5d52292ae3f05fee9bfc7b912d57abd5e6
BLAKE2b-256 checksum
How to use checksums
77dec3114fdd1c61a54af61c4dd9075b656e4be771ba7ca5358b8d2f031f073b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Security for securepasswordgenerator 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page