WIRELESS ASSIGNMENT 03
WIRELESS ASSIGNMENT 03
ASSIGNMENT: 03
PART 1
NAME: SYEDA BANEEN BATOOL
REGISTRATION NO: SP22-BCT-045
CLASS: BCT-6A
SUBMITTED TO: SIR ZULFIQAR ALI
Question No 1:
1. Explain the working of WPA, including WPA-Personal (WPA-PSK) and WPA-Enterprise.
Wi-Fi Protected Access (WPA) is a security protocol developed to enhance the protection of wireless
networks. It was introduced as a replacement for the weaker WEP (Wired Equivalent Privacy) and
provides improved data encryption and user authentication. WPA is commonly used in two modes:
WPA-Personal (WPA-PSK) and WPA-Enterprise. Here's how they work:
1. Overview of WPA
Encryption: WPA uses the Temporal Key Integrity Protocol (TKIP) to dynamically generate
unique encryption keys for each packet of data, making it more secure than WEP's static
keys.
2. WPA-Personal (WPA-PSK)
Definition: "Pre-Shared Key" (PSK) mode is intended for home networks or small businesses.
Working:
1. Key Setup:
2. Encryption:
3. Authentication:
Advantages:
Disadvantages:
o The same passphrase is shared across all users, reducing individual accountability.
3. WPA-Enterprise
1. Authentication Protocol:
EAP methods (e.g., EAP-TLS, PEAP) ensure that individual users authenticate
with unique credentials (e.g., usernames and passwords, digital certificates).
2. Key Setup:
3. Encryption:
4. Session Keys:
Each user session is assigned a unique encryption key, ensuring better data
security.
Advantages:
Disadvantages:
3. Discuss the role of TKIP (Temporal Key Integrity Protocol) and AES (Advanced Encryption
Standard) in WPA.
Role: TKIP was introduced as an interim solution to address the weaknesses of WEP while
using the same hardware.
Key Features:
1. Dynamic Key Generation: Generates a new key for each data packet to prevent key
reuse.
2. Message Integrity Check (MIC): Detects and prevents tampering with data packets.
3. Per-Packet Key Mixing: Enhances security by mixing keys with additional data to
produce unique keys.
Advantages:
Limitations:
Role: AES was introduced in WPA2 as a more robust encryption standard to replace TKIP.
Key Features:
1. Block Cipher: AES encrypts data in fixed 128-bit blocks, making it highly secure.
2. Multiple Key Sizes: Supports 128-bit, 192-bit, and 256-bit key lengths.
3. Encryption Mode (CCMP): AES in WPA2 uses CCMP (Counter Mode with Cipher
Block Chaining Message Authentication Code Protocol) for strong encryption and
integrity.
Advantages:
Limitations:
4. Explain the key management process in WPA (Key Distribution, Pairwise Master Key, and Group
Key).
The key management process in WPA (Wi-Fi Protected Access) ensures secure communication by
distributing and managing encryption keys used to encrypt and decrypt data. It involves several key
components and steps, including Key Distribution, Pairwise Master Key (PMK), and Group Key
management.
1. Key Distribution
Purpose: Ensures secure delivery of encryption keys between the Access Point (AP) and
wireless clients.
Process:
1. When a device connects to the AP, the AP and the client establish a secure channel
for exchanging keys.
2. Key exchange uses the 4-Way Handshake protocol to ensure confidentiality and
mutual authentication.
3. The keys used for encrypting communication are derived rather than transmitted
directly, preventing interception.
Definition: The PMK is a key shared between the client and the AP, used as the basis for
deriving encryption keys.
Derivation:
o In WPA-Personal (WPA-PSK): The PMK is derived from the shared passphrase using
the PBKDF2 (Password-Based Key Derivation Function 2) algorithm.
o Used to create the Pairwise Transient Key (PTK), which encrypts unicast
communication between the AP and the client.
Security: The PMK is never directly transmitted over the network, reducing the risk of
interception.
Definition: The GTK is a shared key used to encrypt multicast and broadcast traffic sent by
the AP to all clients.
Distribution:
o The AP generates the GTK and securely distributes it to all connected clients using
the 4-Way Handshake.
Rotation:
Strengths
o Dynamic Keying: WPA uses dynamic keys with the Temporal Key Integrity Protocol
(TKIP), reducing the risk of key reuse, unlike WEP's static keys.
2. Stronger Authentication:
3. Encryption:
o TKIP and AES (in WPA2) provide stronger encryption methods than WEP’s RC4, with
AES offering robust security against modern attacks.
o WPA implements a 4-Way Handshake that ensures the integrity of the keys and
prevents replay attacks.
Weaknesses
o TKIP (used in WPA) is more secure than WEP but is still vulnerable to attacks such as
FMS (Fluhrer, Mantin, and Shamir) and Brute-Force methods.
o WPA2 with AES is much stronger but still susceptible to potential future attacks with
advances in quantum computing.
3. WPA-Enterprise Complexity:
o Requires RADIUS servers and additional infrastructure, making it more complex and
difficult to set up correctly. Misconfigurations can lead to vulnerabilities.
4. Backward Compatibility:
Question No 2:
Write a Python program to simulate the WPA-PSK authentication process. The program should
include:
1. Generating a PSK (Pre-shared Key) from a given passphrase using PBKDF2 (Password-
Based Key Derivation Function 2).
2. Establishing a secure handshake between a client and an access point using the PSK.
Hint: You can use libraries such as pycryptodome for implementing AES or TKIP encryption.
Code:
Output:
Question No 3:
Simulate the encryption and decryption of packets in WPA using the chosen encryption algorithm
(AES or TKIP). Implement the following:
OUTPUT:
Question No 4
1. Implement an integrity check (Message Integrity Check - MIC) for the packets sent over the WPA-
secured network.
2. Simulate the process of verifying packet integrity by adding and checking MIC values.
CODE:
OUTPUT: