How are “random” passwords generated

1.10K viewsMathematicsOther

I mean if it’s generated by some piece of code that would imply it follows some methodology or algorithm to come up with something. How could that be random? Random is that which is unpredictable.

In: Mathematics

20 Answers

Anonymous 0 Comments

A computer is indeed a very deterministic device and generating something “random” on it is quite a challenge, but it can be done.
You need 2 things:

1.
A pseudo-random number generator (PRNG).

This is an algoritm that generates a result (the output) based on an input (the seed). As the name implies, it is not really random and the same input will always result in the same output, however, one of the properties it has is that it is a one-way function. Based on the output, it is impossible to determine the input, and a slight change in intput will drastically alter the output. (It is comparable with a hash function.)

2.
A random source for your input seed

You need randomness to create a random number. Sounds weird, but not all ramdomness is alike. This source needs to fluctuate and it doesn’t matter if it is not completely random, as long as the fluctiations are unpredicable. In a computer this could be: CPU temperature, noise on the audio channel, pixel noise from a camera, bits of an unallocated memory location, etc…

If 2 is used as (part of) the seed for 1, then the output generated is random enough to be called random. This random output is then converted to characters to create a password.

With the same seed, you will generate the same password, but the point is that this seed is unpredictable because of the slight pertubations and therefore it is very unlikely to be generated again.

You are viewing 1 out of 20 answers, click here to view all answers.