7
$\begingroup$

Maybe this is a newbie question:

Stream cypher, will XOR message bits with one-time pad bits. Suppose I have a pseudorandom number generator, like a Mersenne Twister or something similar. I could use the pseudorandom string to XOR the message. Use the password as the seed of the generator. Same password = same pseudorandom sequence. Could hashing blocks of the pseudorandom sequence create a stronger one-time pad stream?

$\endgroup$
2
  • $\begingroup$ Am I reading things right that you want to seed your stream cipher with your password and hash the pad before it get's XORed? This may add some cryptanalytic defence but I doubt add more brute-force protection. $\endgroup$
    – SEJPM
    Commented Jul 19, 2015 at 21:25
  • $\begingroup$ not worried about brute force... let's set that aside for now. Thanks $\endgroup$
    – 9F48
    Commented Jul 19, 2015 at 21:45

1 Answer 1

8
$\begingroup$

First things first: a PRNG (Pseudo Random Number Generator) can not provide a one-time pad.

As a reminder: a one-time pad…

  1. has to be truly random,
  2. must be at least as long as the plaintext,
  3. is never reused in whole or in part, and
  4. is kept completely secret.

Only when all four points are met, we´re talking about OTP.

Your PRNG idea fails to meet those parameters as it is neither truly random, nor as long as the plaintext. Also, when not using a CSRNG (Cryptographically Secure Random Number Generator), you´re bound to reuse it in part due to the repeating internal state of regular PRNG algorithms.

Example: the “Mersenne Twister” PRNG you mentioned as example is not cryptographically secure. Given a small amount of output, it´s relatively easy to compute all future outputs. In other words: it´s rather predictable and nothing you want to use when it comes to cryptography. Such algorithms were not build to be cryptographically secure! They were designed for things like Monte-Carlo simulations.

Keeping it short (and actively ignoring other potential issues like missing authentication etc.): the security of your “cipher” will stand and fall with the security of your PRNG – which means that whatever you create with a regular PRNG, can not be considered to be cryptographically secure.

Honestly, when I look at the well-vetted options available (various cryptographically secure stream-ciphers, numerous secure block ciphers which can be run in CTR mode, etc.) I can only wonder why you would even think about creating your own, home-brew solution based on some PRNG. You can trust in the fact that trying to create a stream cipher based on a simple PRNG is a really bad idea.

Same goes for your related key generation ideas… there is a reason why solutions exist!

$\endgroup$
4

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.