Given that someone needs my encryption key to predict the output, can I encrypt arbitrary data (zeroes, system logs, personal photos) with AES and a secure passphrase, and use the result as a RSA/SSH/whatever key as if it was the output of a secure random number generator ?

1 Answer 1


Secure random data should not be predictable. Since encrypted data can be predicted from input text and encryption key they can never be a secure random source.

Apart from that the whole purpose of encryption is to hide the original content. The primary purpose is not to look like random data. This means you can not use the output from some arbitrary encryption and treat it as pseudorandom data. To do this you would need algorithms which are specifically designed to produce output which looks statistically random.

  • 1
    While I agree result of encryption of given text with certain key (which usually is deterministic) cannot be really random, I would argue with any decent cipher it can be used as csprng (if encryption key is not known for an attacker). For example, ctr and derived modes of block cipher operation depend on it.
    – Cthulhu
    Aug 30, 2015 at 14:03
  • @Cthulhu: you are right that some encryption algorithms result in statistically random data. I've adapted the response accordingly. Aug 30, 2015 at 14:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .