Somebody wrote:
> A 128 key is more than enough for the forseeable future. However your
> original code used a fixed key with RC4. Since RC4 is a stream cipher
> this is horribly insecure.
>
> A stream cipher is effectively a random stream of bytes derived from the
> key. This is XOR'ed with the data to form the encrypted data or XOR'ed
> with the encrytpted data to get the original data back. The result of
> this is that if you know the data and the encrypted data for one record
> you can recover part of the random stream. You can then decrypt that
> part of any other record without any knowledge of the key!
This is a VERY flawed exposition of stream ciphers. What precisely
do you mean by " ... that part of any other record ...?
" The concept
of "record" does not apply to stream ciphers -- stream ciphers are
effective block ciphers run in OFB mode with a block size of 1 octet.
If you are talking about the case of reusing a single key -- that,
combined with knowledge of a plaintext/ciphertext pair does directly
yield a bad result -- so don't reuse keys. Key reuse is a BAD THING(tm)
in any case.
Knowledge of a plaintext/ciphertext segment yields ZERO knowledge of
any of the rest of the stream. There was a weakness identified with
the use of poor key material in which partial key bits are sometimes
leaked in RC4 -- the solution is to use a good RNG and/or whitening
of the key material, and/or run the key stream for some number of
bytes as a convention in use of the cipher.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]