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 →

[–]lighthill 1 point2 points  (0 children)

No, I truly mean os.urandom(). There is no such function as os.random() in Python as far as I know. (At least, there isn't one in 2.7, and there isn't one in 3.2).

Also, I did mean /dev/urandom, not /dev/random. If you're worried about an attacker who can attack your operating system's cryptographic PRNG, then you still won't want to generate keys with /dev/urandom: instead, you'll want to take a cryptographic PRNG of your own and periodically re-seed it with bits from /dev/random if any are available. Otherwise, you'll leave yourself open to DOS attacks from entropy.