Depleting entropy
Depleting entropy
Posted Oct 10, 2026 23:04 UTC (Sat) by cesarb (subscriber, #6266)In reply to: Weird dichotomy by mb
Parent article: Python's two modules for random numbers
It actually *can*, in theory (if you had 2048 bits of unpredictability in your CSPRNG, and read 2048 bits from it, on average there's a single possible internal state which matches the output, so your entropy is zero), but the only way to exploit it is brute force. So as long as the entropy was large enough before the CSPRNG generated its first output, it should be fine even when the theoretical entropy is depleted.
(It's easier to see with smaller numbers: seed your CSPRNG with only 10 bits of entropy, use it to generate 10 bits of output, and you should be able to easily find the correct seed for that output by trying all 2**10 possible seeds. If you generated only 9 bits of output, there should be two possible seeds which match the output, so you have 1 bit of entropy left. With only 8 bits of output, there should be four possible seeds, so 2 bits of entropy left. And so on.)
