Git Product home page Git Product logo

passgen's People

Contributors

adamjcavanaugh avatar ruslangx avatar soslan avatar tuxpowered avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

passgen's Issues

Assuring password contains punctuation

When supplying limit_punctuation to password generation, is is not guaranteed that the punctuation will be included in the resulting password. This could be classified as a feature or a bug not sure which a user may consider.

For now, if you want to assure a password contains the special characters from a limited list, you can use this small function. I will likely make an updated patch that does just this shortly.

def random_password(length, type='strong'):
    limit_punctuation="!@#$"
    while True:
        password = passgen(length=length, punctuation=True, limit_punctuation=limit_punctuation)
        print(password)
        if any(char in limit_punctuation for char in password):
            break
    return password

Use -c and -C for small and Big cases

I'm a little lazzy, and not a native on english, so typing --upper and --lower is annoying and a bit difficult, how about -c for small case and -C for upper cases?

Replace random with secrets

passgen.py:168: DeprecationWarning: The random parameter to shuffle() has been deprecated since Python 3.9 and will be removed in a subsequent version.

use random.SystemRandom() or os.urandom for secret generation

uh yeah, using a pseudorandom number generator (PRNG) for secrets (passwords) is not acceptable, if your going to keep this published on pypi, I must strongly encourage the heedence of the documented prng module https://docs.python.org/2/library/random.html

In that random.SystemRandom or os.urandom be used to choose the random value.

Warning

The pseudo-random generators of this module should not be used for security purposes. Use os.urandom() or SystemRandom if you require a cryptographically secure pseudo-random number generator.

The premise of PRNG is that the results are seeded and entirely reproducible, a trivial replay attack can produce the passwords generated here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.