# Why can a symmetric encryption algorithm be considered a pseudo-random number generation algorithm?

I have a question from my teacher: "Why can a symmetric encryption algorithm be considered a pseudo-random number generation algorithm?

Can anyone explain it to me?

And sorry if my english is not good!

• In general, it can't. Apr 7, 2020 at 14:05
• Hint: what's the outcome of encrypting a moderate number of incremental values with a symmetric encryption algorithm (that has the same plaintext and ciphertext space, like a block cipher)?
– fgrieu
Apr 7, 2020 at 14:05
• is it the brute-force attack? Apr 7, 2020 at 14:16
• What would happen if you would encrypt a stream of zero bits? How does the ciphertext behave? Apr 7, 2020 at 22:53
• Also would a symmetric encryption algorithm that securely encrypted a message and then appended 1kB of all-0 bytes still be a secure symmetric encryption scheme? Apr 8, 2020 at 9:34

Here are two standard (and equivalent) definitions of confidentiality in symmetric encryption. If Alice sends Bob a message and Eve manages to see it in transit, Eve cannot (without an unreasonable amount of computation):

1. Learn any fact about the plaintext other than possibly its length (semantic security);
2. Tell the ciphertext apart from random data of the same length (ciphertext indistinguishability).

The latter criterion indirectly answers to your question. One way to implement a pseudorandom number generator is just to encrypt arbitrary inputs—say, encrypt the all zeroes string and use the ciphertexts as the pseudorandom output.

This also works in the opposite direction—if you have a secure pseudorandom generator, you can build a secure cipher out of it (called a stream cipher) by XORing its output with the messages. So in that sense, encrypting messages confidentially and generating secure pseudorandom numbers are equivalent problems.

Well, like the comments say, it can't. But maybe i can give you a hint, to what i may be related. Shanon worked on perfect security. One of his principes is, that the decrypt and encrypt text are stochatic stochatically independent. Some symmetric system (e.g. one time pad) are perfect secure.

I don't know the context of your teachers question, but this may give you an idea, where you can find an answer.

As you might know, a symmetric encryption algorithm is defined by a single key shared by two parties and the messages are encrypted and decrypted by this same key. We have two kinds of symmetric encryption algorithms: Stream Ciphers and Block Ciphers.

A Stream Cipher works as a Pseudo Random Number Generator (PRNG), then uses the generated number to perform a XOR with your plaintext to get the ciphertext.

So you can use any Stream Cipher as a PRNG by using your plaintext as the seed, then encrypting sucessivelly the result of the encryption during the generation process. You can also perform this using Block Ciphers, but they are much slower than Stream Ciphers.

In 2019 I developped an algorithm which uses a Stream Cipher, Salsa20, as a CSPRNG. https://github.com/mafone/RKHC.