Skip to main content

Password Tools

Project description

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

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

pwdpy-1.0.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pwdpy-1.0.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file pwdpy-1.0.1.tar.gz.

File metadata

  • Download URL: pwdpy-1.0.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for pwdpy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e15405774b5bb7c47f7327f6e12c3d0a9dac64b1aa531a7470e8ed47df9e471f
MD5 6cdd7c907ff790a2d0b8ed087deb6bd0
BLAKE2b-256 ea99c7a7ab60474851570ebffda9114a6e48ad8e85fb9e7eab1634f5a2089263

See more details on using hashes here.

File details

Details for the file pwdpy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pwdpy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for pwdpy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78fe6e115d79d223a3d77da57535ab03c2e377066632634f74fdca4299162132
MD5 8a460fa9e5d7f7829290ee60d18ce49f
BLAKE2b-256 aae5b5eccd0f504bc706ec71f6566ae28b0941e35b7de619b55d0ecf8d365128

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page