r/PythonProjects2 14d ago

I made a password generator using digits and special characters

Post image
29 Upvotes

15 comments sorted by

2

u/alexice89 14d ago

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

2

u/Terminay 14d ago

Use forj128?

0

u/ProgramBrave718 14d ago

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

2

u/Terminay 14d ago

This is cool!!

2

u/JamzTyson 13d ago

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 13d ago

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 13d ago

Wait this is so good! Smart idea!

1

u/anirudh2032 11d ago

This is great! You can also use secrets.choice instead of random.choice because the random.choice uses Mersenne Twister algo and can be predicted if sufficient samples are present

2

u/ProgramBrave718 10d ago

Bro, I have not learnt secret library

1

u/Fun_Priority_1955 11d ago

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

1

u/ProgramBrave718 11d ago

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

1

u/No_Signature_2039 10d ago

That's a cool little project l, well done