Skip to main content

This python module provides support for password generation.

Project description

jk_pwdgen

Introduction

This python module provides support for password generation.

Information about this module can be found here:

Why this module?

Every user needs strong passwords for various services used. Especially system administrators need passwords of good quality. This python module provides ways to easily generate strong passwords locally.

Limitations of this module

The implementations provided here makes use of default implementations of random number generators in Python. This is a Mersenne Twister and uses /dev/urandom. The quality of randomness is limited to the quality of the underlying implementation in Python. We should assume that the underlying implementation in Python is sufficiently tested and does not contain severe bugs. However it is important to realize that the quality of this underlying implementation is a limiting factor.

What is a (sufficiently) good password

Good passwords ...:

  • should be random. The more random the better. Passwords that contain words which can be found in a human readable dictionary aren't very good.
  • should contain numbers. This increases the complexity.
  • should contain special characters. This increases the complexity as well.
  • should not contain a high variety of characters. This as well increases the complexity.

The password generator provided here aims to meet these criteria.

How to use this module

Import this module

Please include this module into your application using the following code:

import jk_pwdgen

Instantiate a password generator

Now you can instantiate a password generator (and configure it as desired):

pwdGen = jk_pwdgen.PasswordGenerator()
pwdGen.setLength(24)

Generate a password

A password can then be generated like this:

print(pwdGen.generate())

How to use the standalone tool

Run the password generator

This module comes with a standalone program named pwdgen.py. After installing this module you should be able to invoke it via command line. It basically performs exactly those steps described above in order to generate a password. Just execute pwdgen.py such as this:

$ pwdgen.py
mS-UMb5JGSd.LVwszF54Hw~v
$ _

Help text

For more details run pwdgen.py -h to display this help text:

pwdgen [options] - Generate strong passwords.

  Description:

    This tool assists in the generation of strong passwords. Generation is based on the Python
    random number generator random.Random. According to the Python documentation this RNG is
    based on Mersenne Twister and os.urandom(), so it should provide sufficient randomness for
    password generation.

    This tool will verify that passwords generated are of sufficient by verifying that the
    correct number of special characters as well as enough numeric characters are present in
    the password generated.

    In order to use this password generation tool just run it. On each run it will generate
    one or more passwords (depending on arguments specified). All passwords are printed to
    STDOUT line by line.

  Options:

    -h    --help                       Display this help text.
    -n n                               Number of passwords to generate. (Default: 1)
    -l n  --length n                   Length of password to generate. (Default: 24)
          --minNumberOfNumericChars n  Minimum number of numeric characters. (Default: 2)
          --numberOfSpecialChars n     Minimum number of special characters. (Default: 3)
          --prohibitedChars s          Prohibites characters. (Default: "0l")

  Author:

    Jürgen Knauth <jk@binary-overflow.de>

  Return codes:

    0  Everything is okay.
    1  An error occurred.

  License:

    This program is free software: you can redistribute it and/or modify it under the terms of
    the Apache Software License as published by Apache Software Foundation in version 2. For
    more details see the Apache Software License, which should be vailable at:
    https://www.apache.org/licenses/LICENSE-2.0

Contact Information

This work is Open Source. This enables you to use this work for free.

Please have in mind this also enables you to contribute. We, the subspecies of software developers, can create great things. But the more collaborate, the more fantastic these things can become. Therefore Feel free to contact the author(s) listed below, either for giving feedback, providing comments, hints, indicate possible collaborations, ideas, improvements. Or maybe for "only" reporting some bugs:

License

This software is provided under the following license:

  • Apache Software License 2.0

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

jk_pwdgen-0.2024.11.3.2.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

jk_pwdgen-0.2024.11.3.2-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file jk_pwdgen-0.2024.11.3.2.tar.gz.

File metadata

  • Download URL: jk_pwdgen-0.2024.11.3.2.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for jk_pwdgen-0.2024.11.3.2.tar.gz
Algorithm Hash digest
SHA256 dd9ce0967ee667b47d7600a748ab1da59146c1b1bdc646158c19b61f912161b3
MD5 78f8565fd94ab11358de9cee8807feb5
BLAKE2b-256 6d9efda6d11d7d611fbd57dad5999d0e2552c521e50f068c71b78b112cb829b7

See more details on using hashes here.

File details

Details for the file jk_pwdgen-0.2024.11.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jk_pwdgen-0.2024.11.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ec214d957a5928eb92d72d54c3a4953792b2512814a66968741ccb95f8ee7e5c
MD5 56a651dfac8267dd87d1b5d87e63289b
BLAKE2b-256 734d7408c487725ee1fe65401ece8e5a770ba5f7ac5bc9bd9c5285d41adae74e

See more details on using hashes here.

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