views:

128

answers:

3

Similarily to RC4 (RC4_PRNG+XOR ), would it be secure to use another CSPRNG(Cryptographically secure pseudorandom number generator)[Isaac, BlumBlumShub, etc) instead of RC4's and XOR the data with the resulting keystream?

+1  A: 

Well, it depends.

Most encryption algorithms do significantly more than XOR. But that's because the key is shorter than the plaintext. If the key is as large as the plaintext, and truly random, then it is impossible to crack it (it's called a One Time Pad).

So, you need to explain more.

But I'm going to guess that you're key length is not the same as your input length, and that even if it was, almost certainly the random number service you are using is not truly secure, so I'd advise against your approach (furthermore, it goes without saying (maybe) that the problem with OTP is key-exchange).

Noon Silk
I mean if in theory using an existing CSPRNG could be as secure as the provided key, when XORing the input data? I mean in RC4's case there was a weakness in the PRNG and I'm only wondering a case where the best effort is brute force.
kuratkull
@user287669: What? I don't understand what you are saying.
Noon Silk
+1  A: 

Swapping out the CSPRNG in this scheme would probably be just as secure, and have the exact same set of assumptions, weaknesses and practical issues.

crazyscot
+1  A: 

Essentially this is just using Blum Blum Shub (or whatever PRNG) as a stream cipher. This isn't how they're designed to be used, and they might be weak to attacks that make sense in a stream cipher context but not in a CSPRNG context (eg. related-key attacks).

If this is what you want, you're better off just using a modern stream cipher. For example, DJB's Salsa20 is well-regarded.

caf