0
$\begingroup$

I have been studying C/C++ and I read that if one wants unpredictable random data in a program, it is needed that a random generation function be supplied with truly and unpredictable random data (as of /dev/hwrng).

But this confused me because for cryptographic things a normal and non-cryptographic PRNG should be avoided.

Does supplying a truly random and unpredictable seed to a non-cryptographic PRNG (such as MT19937) will result in a unpredictable stream?

$\endgroup$

2 Answers 2

3
$\begingroup$

No. Let's say the PRNG of period $N$ has linear complexity $L,$ where for LFSRs and LFSR derived PRNGs with nonlinear mixing functions we have $L=n^c$ for some constant $c\geq 1.$ The Mersenne Twister itself is predictable, given a long enough output of bits, namely $624$ bits, while its period is $N=2^{19937} − 1.$

So the output stream is definitely predictable.

$\endgroup$
1
  • $\begingroup$ And what if we only output 500 bits per seeding? $\endgroup$
    – Paul Uszak
    Dec 8, 2022 at 5:06
0
$\begingroup$

No, it does not guarantee security.

For PRNG, to be secure, it surely needs a random seed and good probability properties. However, it is also required to have predictable values (both future and previous).

For example Mersene-Twister algorithm you mentioned, generates linearly dependent random outputs. With enough data you can solve a linear equation of next output.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.