WEP Security
WEP stands for 'Wired Equivalent Privacy'. It was created to protect data confidentiality exchanged among authorized users of a wireless-lan from casual eavesdropping. It is considered as a pre-RSNA (robust security network association) security method, as it has been deprecated due to its inability to meet security goals. There are two types of WEP security: WEP-40 and WEP-104. The number denotes the number of bits in its key.
WEP MPDU format
Encrypted frame body:
- Protected frame in Frame Control is set to 1.
- WEP ICV = 32-bits in length (1 octet is 8 bits)
- IV (initialisation vector) field with subfields:
3-octet IV
2-bit Key ID
6-bit Pad
The Key ID subfield contents selects 1 of 4 possible secret key values for use in decrypting the frame body. When key-mapping is used, Key ID field value is ignored.
The contents of Pad is 0s.
WEP State
WEP uses only encryption keys and performs no data authentication, therefore, it doesn't use data integrity keys. There are two types of encryption keys: key-mapping keys and default keys.
Key-mapping key
It is an unnamed key corresponding to a distinct TA-RA pair. It's used to WEP-encapsulate or decapsulate MPDUs transmitted by TA to RA, regardless of the presence of other key types. When this type of key is used, the Key ID subfield in the MPDU is set to 0 on transmit, and is ignored on receive.
Default key
If a key-mapping key is not configured for a WEP MPDU's TA-RA pair, then a default key is used to encapsulate or decapsulate the MPDU.
WEP algorithms
There are two algorithms used in WEP security.
The first is the ICV algorithm, which is used to verify the packet's integrity. It is computed using the CRC-32, and is calculated over the plaintext MPDU data (PDU) field.
The second algorithm is the WEP encryption algorithm. It uses the ARC4 stream cipher from RSA Security as its encryption and decryption algorithm. The ARC4 uses a pseudorandom number generator (PRNG) to generate a key stream that it XORS with a plaintext data stream to produce cipher text, or to recover plaintext from a cipher text.
WEP Seed construction
WEP constructs a per-MPDU key, called a seed, by concatenating an encryption key to an IV.
WEP-40:
- bits 0-39 of WEP key correspond to bits 24-63 of the seed.
- bits 0-23 of the IV correspond to bits 0-23 of the seed.
WEP-104:
- bits 0-103 of the WEP key correspond to bits 24-127 of the seed.
- bits 0-23 of IV correspond to bits 0-23 of the seed.
The seed is inputted to ARC4, in order to encrypt or decrypt the WEP data and ICV fields. The WEP implementation encapsulating an MPDU's plaintext data selects a new IV for every MPDU it WEP-protects, and uses the IV from the received MPDU's Init vector subfield for decapsulating an MPDU.
WEP MPDU cryptographic encapsulation
WEP applies 3 transformations to the plaintext MPDU to effect the WEP cryptographic encapsulation (Image):
WEP computes the ICV over the plaintext data and appends this after the MPDU data (Image).
WEP encrypts the MPDU plaintext data and ICV using ARC4 with a seed constructed (Image).
WEP encodes the IV and key ID into the IV field, prepended to the encrypted data field (Image).
WEP MPDU decapsulation
WEP applies 3 transformations to the WEP MPDU to decapsulate its payload (Image):
WEP extracts the IV and key ID from the received MPDU. If a key-mapping key is present for the TA-RA pair, then this is used as the WEP key. Otherwise, the key ID is extracted, identifying the default key to use (Image).
WEP uses the constructed seed to decrypt the Data field of the WEP MPDU, which produces plaintext data and an ICV (Image).
WEP recomputes the ICV and bit-wise compares it with the decrypted ICV from the MPDU. If the two are bit-wise identical, then WEP removes the IV and ICV from the MPDU, which is accepted as valid. If they differ in any bit position, WEP generates an error indication to MAC management (Image).














