2-5 RC4 - Simplified RC4
2-5 RC4 - Simplified RC4
RC4 is a stream cipher which was invented by Ron Rivest in the year 1987.
RC4 means ‘Rivest Cipher 4’ and it is also known as ‘Ron’s Code 4’.
The RC4 cipher is the most widely used stream cipher. It is used in various
applications that encrypts and decrypts a bit or byte of data at a time.
For example, if 10 bytes of a file is to be transmitted, then RC4 has to
generate 10 key streams for encrypt ing the plaintext bytes.
Moreover, it is used by important protocols such as SSL, TSL, WPA and
WEP, etc. because of its simplicity and efficiency.
The RC4 is an efficient algorithm because it is 5 times faster than DES, 15
times faster than triple DES and 50 times faster than RC2.
Principle of RC4
In this algorithm, the S array is initialized. After that, the index values of S array
are filled into S array.
After filling the values, the values in the S array are permuted.
In order to permute the values, the following steps are executed in the KSA.
• Increment i
In this algorithm, the actual key stream is generated which could be used for
performing encryption operation in the sender side.
Encryption and Decryption
Steps of encryption
4. Now the amount of key stream generated is equal to the amount of bytes
for doing encryption operation.
Steps of decryption
1. Use the same key that was used in the encryption operation.
2. Generate a key stream by running the KSA and PRGA algorithms. 3. XOR is
the key stream with the ciphertext to generate the plaintext
5. XOR with key stream with the plaintext data to generate the encrypted
stream