Cryptography Overview
46 RSA BSAFE Crypto-C Developers Guide
Figure 3-6 Output Feedback Mode (OFB)
Stream Ciphers
A stream cipher processes the input data one unit at a time. A unit of data is generally a
byte, or sometimes even a bit. In this way, encryption or decryption can execute on a
variable length of input. The algorithm does not have to wait for a specified amount
of data to be input before processing, nor does it have to append and encrypt extra
bytes.

RC4

The RC4 cipher is a symmetric stream-encryption algorithm developed by Ronald
Rivest and proprietary to RSA Security. It is actually a keyed pseudo-random
sequence. It uses the provided key to produce a pseudo-random number sequence
which is then XORed with the input data. This means that the encryption and
decryption operations are identical.
The number of key bits is variable and ranges from eight to 2048 bits. Using the RC4
cipher with a key size of less than 40 bits is not recommended.
Because RC4 encryption is an XOR between the message bytes and the pseudo-
random byte stream generated from the key, the same key should not be used more
than once. Otherwise, if some of the bytes of one input message are known (or easy to
2nd message
block
2nd cipher
block
Key (K)
Block Cipher
Initialization
Vector (IV)
1st message
block
1st cipher
block
XOR
Block Cipher
Key (K)
XOR