RC4 and Stream Ciphers WEP protects the confidentiality of its data using a stream cipher called RC4. This is a well-known cipher, and the designers were wise to choose it instead of trying to make their own. With a stream cipher, you generate a keystream K and XOR that keystream with the plaintext to get the ciphertext The receiver generates the same keystream, and XORs the ciphertext with K to get back the plaintext This works because XORs cancel: P' = C XOR K = P XOR K XOR K = P So the message that was received is the same one that was sent