The self-inflicted degradation of the random number generator in the Debian OpenSSL packages were the main inspiration for this, I think.
https://en.wikipedia.org/wiki/Random_number_generator_attack...
https://en.wikipedia.org/wiki/Random_number_generator_attack...
I'm fairly sure this basic joke predates xkcd by quite a while. For example, here's a Dilbert comic from 2001 with a slight variation on it:
http://dilbert.com/strip/2001-10-25
This Jargon File entry listing several specific "random numbers" has the same theme:
[1] Go to https://xkcd.com/archive/, hover over the title of a comic, and a tooltip will show the date
EDIT: I see 'mikeash beat me to it.