RC4
Rivest's 1987 byte-oriented stream cipher, once ubiquitous and now prohibited in TLS
Overview
RC4 is a stream cipher designed by Ron Rivest in 1987. It was used in WEP, WPA-TKIP, early TLS and many other systems because of its simplicity and speed, but statistical biases in its output have made it insecure.
RC4 maintains a 256-byte permutation S and two indices. The key-scheduling algorithm initialises S to the identity and swaps entries based on the key. The output generator then repeatedly increments one index, adds the indexed value to the other, swaps the two entries, and outputs the byte at the sum of the two values. No nonce is defined; protocols often concatenated an IV with the key, which proved fatal in WEP.
The algorithm was a trade secret until it was leaked in 1994, which is why it is also known as ARC4 or ARCFOUR. NextSSL includes RC4 for legacy interoperability; RFC 6229 provides test vectors. It is still found in old protocols. Its simplicity made it easy to implement in early hardware and software.
History
1987–2015RC4 designed by Ron Rivest
RC4 source posted anonymously
Fluhrer, Mantin and Shamir break WEP's use of RC4
RC4 prohibited in TLS by RFC 7465
Security notes
RC4 is broken. Its early keystream bytes are biased, related-key weaknesses broke WEP within minutes, and plaintext-recovery attacks against TLS led RFC 7465 to prohibit RC4 in TLS in 2015. Do not use it for new data.
Typical uses
Variants in NextSSL
1| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| RC4 rc4 |
broken | key 1–256 · nonce 0 | RFC 6229, ARC4 | root |
Frequently asked questions
Which RC4 variants does NextSSL include?
NextSSL registers 1 RC4 variant: rc4.
Families with similar names
Other stream ciphers
All 37Related
ARX stream cipher with a one-time Poly1305 MAC; fast and constant-time in software
RC2, RC5 and RC6Ron Rivest's family of block ciphers, from the 1987 RC2 to the AES finalist RC6
AES-CTRCounter mode: turns AES into a fast, parallel stream cipher
ChaChaBernstein's ARX stream cipher; ChaCha20 secures much of today's TLS, SSH and VPN traffic