Score:-1

predict random keys using python

bt flag

How can I write a program in python to predict the random key (urandom) that is used for encryption? I tried to search and I couldn’t find anything related to guessing and predicting urandom in python

fgrieu avatar
ng flag
The fact that the question is about "writing a program", in a specified language (and one rather not adapted to the task, which likely would involve acquiring side-channel data), towards attacking a highly system-specific and version-specific Operating System component, all without specifying these, leads me to the conclusion that this question is off-topic.
Score:3
my flag

We hope that's impossible; urandom is supposed to use a cryptographically strong random number generator, and so (without the internal rng state) we hope that you can't do it.

Score:2
pl flag

It might be possible to write a program that has some success with this if the program executes a side-channel attack on the underlying pseudorandom generator of /dev/urandom. If the system that we are running on is starved of entropy (think headless server without a hardware random number generator), it is not inconceivable that a process running on the same system might be able to gather side-channel information (from process timing or any other internal sensors available to it) that allows reconstructing the state of the internal RBG and maybe some of the data that is being mixed into the entropy pool from outside. It could then use that information to predict the pseudorandom output of the generator.

However, doing this would still easily qualify as a research project and if successful (even to a modest degree, for instance showing an ability to predict some RBG output in an entropy-starved laboratory setting after one initial good seeding of the state) it would likely yield a nice paper. Until someone writes that paper, there is no certainty that something like this is doable. Given that, the chances of finding an implementation of such an attack on the internet are currently effectively zero.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.