The short answer is you cannot.
The answer is a little longer - it depends on the OS. I assume you are using Linux. In theory, the linux entropy pool can be easily drained using the following script:
#!/bin/bash while true; do
Running this script ultimately blocks operations that use /dev/random but not /dev/urandom . Urandom does not read directly from the entropy pool, it uses PRNG and reloads it (by default) every 60 seconds using /dev/random . So what happens when the entropy pool dries? Nothing. The PRNG will not be reloaded, but it will still generate new numbers, not cryptographically strong ones.
The only time this exception can be thrown is right after the system boots for the first time. I think this is rather unlikely ... Of course, other operating systems may handle this issue differently, but while you are using Linux, you should not worry about that.
qzb
source share