How are pseudorandom and truly random numbers different and why does it matter?
superuser.com
superuser.com
Imagine a function like this:
def init_prng(int x):
state = x
def prng():
state = md5(state)
return state
So while this is a good, simple PRNG its very recoverable if you know the initial x (or if the space of possible x values is small, ie a 32-bit number). One of the goals of a PRNG function is to extend the usefulness of truly random data, because fully random data is hard to come by.This is how it looks if I do this:
qasWdfghjzUkilo
Those 15 characters look pretty random.
Yet, if you KNEW a thousand people were following those instructions, then you could build a model of the actual entropy that goes into the password: 1) Where did they start and stop sliding their keyboard 2) What is their keyboard layout 3) Which is the FIRST letter they chose to capitalize? 4) Did they choose to capitalize a second letter, and if so which one?
The above is very low entropy. If a thousand people are following your instructions, you can guess one in WAY less time than brute-forcing 15 random letters.
The issue is that although the result LOOKS random, very low entropy is entering it - you can repeat the steps, if you know the algorithm.
Likewise, pseudorandom number generators take SPECIFIC steps (algorithmically.) If you know the "seed", such as the time-stamp, that they're initiated with, you can simply repeat the steps.
This is a huge vulnerability if the result is supposed to contain a high degree of entropy.
I've simplified a bit, of course. Good pseudorandom algorithms have very good, equal-looking distributions.
But make no mistake: at their heart they're just steps that anyone can follow along with, if they know the entropy entering the algorithm they can come up with the same result.