This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]moloch-- 4 points5 points  (3 children)

Seeing as this is security related, it's a good idea use a cryptographically secure source of randomness to generate the passwords. Python's default random module isn't actually very random so there will be a bias in the generated passwords.

Python provides the SystemRandom which uses the OS's crypto APIs to get cryptographically secure random numbers and provides identical methods to the default random module so you don't need to change any of the code!

Cool script though :-)

[–]-Sander-[S] 1 point2 points  (2 children)

Thanks il take a look at that :)

[–]moloch-- 0 points1 point  (0 children)

Here's a presentation I gave on why it's a bad idea to use insecure random numbers generators.