Randomness in cryptography

Pawel Gielmuda
2 min readMay 31, 2022

Although it seems randomness is everywhere, it’s quite to hard generate lots of pure #random numbers which is essential for #cryptography and #security. I recommend a yt from #Numberphile where it is well explained: Random Numbers — Numberphile — YouTube.
A great example of giving a random number by people (most of us will give 7) shows that this is non-intuitive for humans.

How to generate random numbers? There are 3 ways to do that:
- when it is based on physical phenomena then it is called True Random Number Generation (TRNG)
- when it is mathematically generated then it is called Pseudo-Random Number Generation (PRNG)
- when a mathematical function is seeded with a true random number then it is called Seeded PRNG.

TRNGs are the best but achieving good throughput of generation in a completely deterministic environment like a computer is hard work. That’s why humans invited mathematical functions which imitate randomness (PRNGs). However, those functions have some long periods so to avoid such drawbacks quite a good solution is a merge of the two above — PRNGs with a seed generated by TRNG.

Why it is so important? To have a big ‘key space’ that defines the security of the crypto-system. I’ve already discussed the One Time Pad cipher where it is ideally secure if only the random sequence is good quality. For other crypto-technics, it is similarly important and it is used i.e. to generate the secret key, initialization vector, or prepare a secure pin/password.

--

--