o be largely a cosmetic enhancement since, as described below, the underlying vulnerability meant that an eavesdropper could still derive the key by analysing roughly 4 million transmitted frames, whether 40-bit or 104-bit keys were used. The input data stream, known in cryptographic terminology as the plaintext, is combined with a pseudo-random key bit stream in an XOR (exclusive OR) operation to create the encrypted ciphertext. WEP creates the key bit stream using the RC4 algorithm to make a pseudo-random Chapter Eight Input counters S[i]+S[j] Output key byte S[i] + S[j] Figure 8-2: Key Stream Generation Using the RC4 Algorithm selection of bytes from a sequence S that is a permutation of all 256 possible bytes. As shown in Figure 8-2, RC4 selects the next byte in the key stream by; Step (1) incrementing the value of a counter i, Step (2) incrementing a second counter, j, by adding the value of S(i), the i'th byte in the sequence, to the previous value of j, Step (3) looking up the values of the two bytes S(i) and S(j), indexed by the two counters, and adding them together modulo 256, Step (4) outputting the byte K indexed by S(i) + S(j), i.e. K=S(S(i) - + S(j)). The values of bytes S(i) and S(j) are then exchanged before returning to step (1) to select the next byte in the key stream. The initial permutation of bytes in S is determined by a key scheduling algorithm which uses a similar manipulation of bytes within S, starting with the identity permutation of bytes (0, 1, 2, 3, 4, ..., 255), but at each Step when the counter j is incremented, a byte from the 64-bit or 128-bit encryption key is also added to the counter. WEP also provides limited message integrity checking using a cyclic redundancy check (CRC-32; see Glossary) to compute a 32-bit integrity check value (ICV) which is appended to the data block before encryption. The full WEP computational sequence is then as follows (see Figure 8-3); Step (1) the ICV is computed for the data block to be transmitted in the frame Wireless LAN Security Plaintext Pla