Skip to main content

pwdpy

pwdpy is a set of tools to facilitate password handling. It can be used in command line and as a python module.

Installation

pwdpy requires Python 3.x.

pwdpy can be installed with pip:

$ pip install pwdpy

Usage (command line)

pwdpy accepts several arguments configuring its outcome. Overall synopsis is:

$ pwdpy {generate, entropy, strengthen} [-h]

$ pwdpy generate [-h] [-l LENGTH] [-q QUANTITY] [-p] [-d] [-le] [-nu] [-nl] [-cf FILE] [-o FILE]

$ pwdpy entropy [-h] [-pwd PASSWORD]

$ pwdpy strengthen [-h] [-pwd PASSWORD] [-shf] [-inc] [-mp MAX_PREFIX] [-ms MAX_SUFIX]

$ pwdpy generate_wordlist [-h] [-q QUANTITY] [-l LENGTH] [-lg LANGUAGE] [-sep SEP] [-u] [-wl WORDLIST]

Commands: generate Generates a random password based on the arguments

**entropy**       Calculate the entropy of a password

**strengthen**    Strengthen your password

**generate_wordlist**    Generates a random wordlist

ALL Arguments:

-h, --help Display help message

-l, --length LENGTH The length of the password (default: 8)

-q, --quantity QUANTITY Generate QUANTITY passwords. (default: 1)

-sc, --special_characters Use special characters (default: False)

-d, --digits Use digits (default: False)

-le, --letters Use letter (default: False)

-nu, --no-upper Don't use upper case letters (default: False)

-nl, --no-lower Don't use lower case letters (default: False)

-cf, --charset-file FILE Charset file will be used instead of the arguments specification

-o FILE, --output FILE The output file will be created with the passwords.

ENTROPY Arguments:

-pwd, --password PASSWORD password that will be tested

STRENGTHEN Arguments:

-pwd, --password PASSWORD password that will be strengthened

-shf, --shuffle shuffle the password after strengthened (default: False)

-inc, --increase increase the number of characters in the password (default: False)

-mp, --max_prefix MAX_PREFIX max number of characters to add as prefix (default: 5) can only be used with --increase

-ms, --max_sufix MAX_SUFIX max number of characters to add as sufix (default: 5) can only be used with --increase

GENERATE WORDLIST Arguments:

-q QUANTITY, --quantity QUANTITY quantity of passwords to generate (default: 1)

-l LENGTH, --length LENGTH the length of the password (default: 8)

-lg LANGUAGE, --language LANGUAGE language of the words (default: english)

-sep SEP, --separator SEP word separation (default: space)

-u, --upper
use upper case words (default: False)

-wl WORDLIST, --wordlist WORDLIST path to to the wordlist file (default: None)

Examples

Below are some examples of pwdpy usage.

GENERATE:

One password with letters and digits:

$ pwdpy generate -le -d 
    MT06aRK1

One password with 12 digits:

$ pwdpy generate -l 12 -d
    304751766483

One password with all characters possibility:

$ pwdpy generate -le -d -p
    PY>8OH+y

A list containing 3 passwords with all characters possibility:

$ pwdpy generate -q 3 -le -d -p
    ['Xw]6ua77', 'SfmCrlg)', 'I9):o8Oa']

One password with all characters possibility from the charset file:

$ pwdpy generate -cf ./wordlist.txt
    }=W8jb4y

ENTROPY:

Calculing one password entropy:

$ pwdpy entropy -pwd "PY>8OH+y"
    52.44

$ pwdpy entropy -pwd "Isaac"
    28.5

STRENGTHEN:

Strengthen one password:

$ pwdpy strengthen -pwd "Isaac"
    15Á4C

$ pwdpy strengthen -pwd "Isaac" -inc
    <uQ0@îsá4c~

Strengthened and using shuffle

$ pwdpy strengthen -pwd "Python" -shf
    ý%IÕqN

GENERATE WORDLIST:

Generate one wordlist with 13 words:

$ pwdpy generate_wordlist -l 13
    dollhood obligatum weirded triangularly meanness uncrediting ologies pomological refixture accessible clapperclaws winzeman montesinos

Generate one wordlist with portuguese upper words:

$ generate_wordlist -lg portuguese -u
    ANDRÔMEDA CUCURBITÁCEO ISOAMÍLICO APLACÁVEL ARQUEÔMETRO GERVAIS CRUSTACÍTICO EUGLIPTO

Python module

pwdpy Python module provides one function that is called generate.

| generate(quantity=1, length=12, special_characters=True, digits=True, letters=True, l_upper=True, l_lower=True, charset=[], charset_file="",output_file="", **kwargs) -> str or list

It returns a string with *length* characters. *special_characters*, *digits*
and *letters* arguments specify whether special characters, digits and letters
should be used. *l_upper* and *l_lower* specifies letter wich case the letter can be.

A list of charsets can be passed, instead of using the default it will uses the parameter.

You can configure an output using *charset_file*, that file will be
created or replaced with the generated passwords

| entropy(password: str) -> float

It returns a float of bits that was the result of applying the Shannon formula.

| strengthen(password: str, shuffle=False, increase=True, max_prefix=5, max_sufix=5) -> str

It returns a string the strengthen password,
can be added a prefix and/or sufix by using *max_prefix* and *max_sufix*
and the password can be shuffle using *shuffle*.

| generate_wordlist(quantity=1, length=8, language="english", sep=" ", case="lower", wordlist: str = None) -> str orlist

It returns a string with *length* of words.
The words are select by *language* and separeted by *sep*.
Define case of the words using *case*.
Or you can pass your own wordlist using *wordlist*.

License

MIT License

Metadata

Release files for pwdpy 1.0.1

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

Source distribution (sdist)

Source distribution for pwdpy 1.0.1
File Size Uploaded
pwdpy-1.0.1.tar.gz 12.3 kB Details

Built distribution (wheel)

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

Total release size: 23.8 kB

Release files / pwdpy-1.0.1.tar.gz

Download URL pwdpy-1.0.1.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e15405774b5bb7c47f7327f6e12c3d0a9dac64b1aa531a7470e8ed47df9e471f
BLAKE2b-256 checksum
How to use checksums
ea99c7a7ab60474851570ebffda9114a6e48ad8e85fb9e7eab1634f5a2089263
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release files / pwdpy-1.0.1-py3-none-any.whl

Download URL pwdpy-1.0.1-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78fe6e115d79d223a3d77da57535ab03c2e377066632634f74fdca4299162132
BLAKE2b-256 checksum
How to use checksums
aae5b5eccd0f504bc706ec71f6566ae28b0941e35b7de619b55d0ecf8d365128
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1

2 release files

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