Importance of Random number in Cryptography
Ever wondered why just a mere random number is so important?
I have been there, let me demystify that for you.
If you can predict something, find pattern in it, you can hack it.
In simple words,"Predictable is hackable"
Random number does exactly opposite, they are unpredictable.
Uses,
- Key:Random number is important in generation of key, which is base of encryption.
2.Initialisation Vector(IV):Also know as initial value, if used even the same string with same encryption key will have different final encrypted string every time.
Sometimes also used the initial value for hashing, but in that context it is fixed and reused.
3.Nonce:Number used once (N-once), get it?
It's generally append of sequentially incremental value and random unpredictable number.
Used in encryption, hashing, IV, two-factor authentication and many other things.
4.Salt:Salt is added to plaintext before encryption, which is then needed to decrypt along with the key. Makes it hard to hack.
Now, these are all random numbers with just different names in different context.
Types of random number1. Psuedo Random number(PRNG)
Psuedo RNGs are software generated numbers using deterministic, predictable algorithm.
They are not random in true sense, but still provide a good degree of randomness, but a no no for cryptography.
2.True Random numbers (TRNG)
True RNGs are truly random. They are hardware generated values. Their entropy source is something physical, such as noise, thermal noise, shot noise, jitter of electronic circuit.
Anything that is random in nature can be used as entropy source, making it truly random.
TRNG is must needed for cryptography.