|
|
Subscribe / Log in / New account

Random vs. Cryptographically random are typically separate

Random vs. Cryptographically random are typically separate

Posted Sep 19, 2015 11:12 UTC (Sat) by kleptog (subscriber, #1183)
In reply to: Random vs. Cryptographically random are typically separate by wahern
Parent article: Python and crypto-strength random numbers by default

There's still the documentation question, I see that the warning about it not being cryptographically secure was added in the 2.7 docs, prior to that you had to read the wall of text to discover that. The default behaviour of random() now if you don't seed it is to read 32 bytes of urandom (if available) and use that as seed. If you're not generating lots of random numbers this should be sufficient. You wouldn't want to generate crypto keys that way, but it's not that bad.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds