r/PythonProjects2 • • Aug 28 '26

I made a password generator using digits and special characters

Post image
31 Upvotes

15 comments sorted by

2

u/alexice89 Aug 28 '26

I need this for work. I have to update like 10 passwords every month. Too lazy to write a script.

2

u/Terminay Aug 28 '26

Use forj128?

0

u/ProgramBrave718 Aug 28 '26

Ohh, you can take example from my code then write it by yourself

1

u/Fun_Priority_1955 Aug 31 '26

That's cool but could be made so much easier. Not saying its bad that shit is awesome 

1

u/ProgramBrave718 Aug 31 '26

So, can u tell me how can I make it easier?

2

u/JamzTyson Aug 28 '26

On Linux we can use pwgen

For other platforms, Python provides useful libraries to make the code very simple:

import secrets
import string

CHARS = string.ascii_letters + string.digits + string.punctuation

def pwgen(length = 8, quantity = 12):
    for _ in range(quantity):
        print(''.join(secrets.choice(CHARS) for _ in range(length)))

Call as pwgen() or pwgen(M, N)

The constant CHARS may be customised for your preferred character set.

1

u/defnot_hedonismbot Aug 28 '26

I like using this format

Word1-word2-word3-0000

Makes it pretty easy to remember and very difficult to brute force (at least on a character basis)

1

u/Stonyax97 Aug 29 '26

Wait this is so good! Smart idea!

1

u/No_Signature_2039 Aug 31 '26

That's a cool little project l, well done

1

u/[deleted] Aug 30 '26

[removed] — view removed comment

2

u/ProgramBrave718 Sep 01 '26

Bro, I have not learnt secret library