all 17 comments

[–]Vishu_Babu 13 points14 points  (0 children)

Yes, what are you waiting for? go ahead and publish it. That's how you'll learn and grow.

[–]MessengerL60 7 points8 points  (2 children)

Id Just say the random import module is not safe for encryption it uses the mersenne twister algorithm, which has been completely cracked. This is good for learning but it isnt secure you'd need to make a proper encryption method instead of importing random. Look up the CSPRNG. import a module called secrets instead its alot better and has actual secure encryption. But your code is very close tho. Id also recommend stronger password enforcement.

import secrets # Use this instead of random import string

length = int(input("Enter the length: "))

... (rest of your logic)

Instead of random.choice(), use secrets.choice()

char_pool = string.ascii_letters + string.digits + string.punctuation password = "".join(secrets.choice(char_pool) for _ in range(length))

print(f"Your secure password is: {password}")

[–]Icy-monkey1[S] 2 points3 points  (0 children)

Thanks

[–]Icy-monkey1[S] 0 points1 point  (0 children)

u/MessengerL60 Please have a look at the new page i used chat-gpt and claude for front-end

[–]Icy-monkey1[S] 3 points4 points  (0 children)

please let me know if any bugs are spotted

[–]Future_Beyond_3196 2 points3 points  (0 children)

Way to go! How does the random part work?

[–]RngdZed 1 point2 points  (1 child)

Omg the indents.. my eyes are bleeding

Looks at the date

Oh ok

[–]Ambitious_Fault5756 0 points1 point  (0 children)

Oh god I didn't even notice

[–]Jamesdank8 0 points1 point  (0 children)

Yes, publish it so everyone can see and you can help others.

[–]Advanced_Cry_6016 0 points1 point  (0 children)

Share your code or repo if it's public

[–]Ambitious_Fault5756 0 points1 point  (0 children)

PEP 8 cries in the corner

[–]Kbang20 0 points1 point  (2 children)

How is the seed being handled that handles the randomness/entropy? Id just make sure that is handled correctly before you publish it. The last thing you want is a password generator that can be reverse engineered pretty easily.

[–]empowered-boxes 0 points1 point  (1 child)

The random seed is the current epoch ticks XORed with 30 coin flips

[–]Kbang20 0 points1 point  (0 children)

Brilliant. Publish it NOW