r/PythonLearning • • 3d ago

Showcase spgpy v2.0.0 released - A refactored Python library for secure password generation

Hi everyone,

I've just pushed v2.0.0 of spgpy, an open-source Python tool for generating and validating passwords.

GitHub Repository & Full Changelog: https://github.com/toncotales/spgpy

Feedback and contributions are welcome!

0 Upvotes

4 comments sorted by

1

u/jpgoldberg 3d ago

“Every password has at least 2 uppercase letters, 2 lowercase letters, 2 digits and 2 punctuation characters.
Optional "no duplicates" mode: no character appears twice.
Optional "alternate case" mode: no two neighbouring characters are of the same type.”

Each of those features reduces the strength of the generated password.

0

u/Usual-Leek-8531 2d ago

Thanks so much for taking the time to check out the repo and share this feedback! You're completely right from a cryptographic standpoint enforcing character rules and patterns restricts the keyspace and lowers the overall entropy compared to pure uniform randomness.

I originally included those defaults and optional modes to help users satisfy strict legacy password policies, as well as to practice implementing custom constraints in Python. However, adding a pure random mode (or making uniform randomness the default while keeping these rules optional) is a great idea to maximize security.

Thanks again for the insight!

1

u/jpgoldberg 2d ago

I do understand having to tune a password generator to match common policies. Indeed, I've presented on the subject. But ...

  • no password policy has ever required alternating capitalization.

  • The (very rarely used) "no duplicates" constraint is about consecutive characters. Your implementation has no duplicated character in the entire password. This dramatically makes things weaker, as the later characters become extremely predictable.

I would also ask you some questions about your code design choices, but I don't want to hear you parrot what your AI tells you.

0

u/Usual-Leek-8531 2d ago

God bless you brother ❤️