[Tutor] Does the secrets module in Python 3.6 use a hardware RNG like that provided in Intel CPUs?

Simon Connah sc_opensource at yahoo.com
Fri Mar 9 17:07:14 EST 2018


Hi,
I was reading through the secrets documentation in Python 3.6 and noticed that it uses /dev/urandom but I'm unsure if that means it'll use a hardware RNG or just one provided by the operating system (Linux / Windows / etc) in software. The question is is it possible to determine the source of the randomness from os.urandom if there was ever a flaw found in a particular hardware RNG? Plus systems could have a third party hardware RNG that was an external addon card or similar which might be better than the one found in Intel CPUs.
I'm just a bit curious about the whole "will always use the strongest source for pseudo-random numbers" when research could change that assumption overnight based on discovered flaws.
This is probably a really stupid question and if it is I apologise but I'm somewhat confused.
Thanks for any help.


More information about the Tutor mailing list