PTK ใน Cybersecurity / Wi-Fi Security (802.11i / WPA2/WPA3)
PTK = Pairwise Transient Key (คีย์ช่วงคู่ชั่วคราว)
เป็น Session Key ที่สร้างขึ้นเฉพาะระหว่าง Supplicant (Client) และ Authenticator (AP) ในกระบวนการ 4-Way Handshake ของ WPA2/WPA3-Enterprise และ WPA2/WPA3-Personal
การสร้าง PTK (Key Derivation)
PTK = PRF-X(PMK, "Pairwise key expansion",
MAC_Address_AP || MAC_Address_Client ||
ANonce || SNonce)
- PMK (Pairwise Master Key): ใน WPA2-Personal = PSK (Pre-shared Key) ที่derive จาก Passphrase + SSID (PBKDF2-SHA1, 4096 rounds) | ใน Enterprise = MSK จาก RADIUS/EAP
- PRF-X: Pseudo-Random Function (HMAC-SHA1 สำหรับ WPA2, HMAC-SHA256/SHA384 สำหรับ WPA3)
- ANonce: Random Number จาก AP (Authenticator Nonce)
- SNonce: Random Number จาก Client (Supplicant Nonce)
- MAC Addresses: ของ AP และ Client
องค์ประกอบของ PTK (PTK Components)
PTK ถูกแบ่งออกเป็น 3-5 Sub-keys (ขึ้นอยู่กับ Cipher Suite):
| Sub-key | ขนาด (WPA2-AES) | หน้าที่ |
|---|---|---|
| KCK (Key Confirmation Key) | 128 bits | คำนวณ MIC (Message Integrity Code) ใน Handshake Messages 2, 3, 4 เพื่อยืนยันความสมบูรณ์ของ Handshake |
| KEK (Key Encryption Key) | 128 bits | เข้ารหัส GTK (Group Temporal Key) ใน Message 3 |
| TK (Temporal Key) | 128 bits (CCMP/AES) | เข้ารหัส/ถอดรหัสข้อมูล Unicast Traffic ระหว่าง Client-AP (Data Encryption) |
| TK (Michael MIC Key) - สำหรับ TKIP | 128 bits | Michael MIC สำหรับ Integrity (TKIP ถูก Deprecated) |
4-Way Handshake (WPA2) - สร้างและยืนยัน PTK
- Message 1 (AP → Client): ANonce
- Message 2 (Client → AP): SNonce + MIC (คำนวณจาก PTK ที่ derive เอง) → AP ตรวจสอบ MIC → รู้ว่า Client มี PMK เดียวกัน
- Message 3 (AP → Client): GTK (เข้ารหัสด้วย KEK) + MIC → Client ถอดรหัส GTK, ตรวจ MIC → ติดตั้ง PTK, GTK
- Message 4 (Client → AP): MIC (ยืนยันติดตั้ง PTK/GTK สำเร็จ) → AP ติดตั้ง PTK เริ่มส่งข้อมูลเข้ารหัส
ความสำคัญของ PTK
- Uniqueness: PTK แตกต่างกันไปในแต่ละ Session (Nonce ต่างกัน) → Forward Secrecy (ระดับหนึ่ง)
- Per-Session Encryption: TK ใช้เข้ารหัส Unicast Traffic เพียง Session นั้น
- Key Confirmation: KCK รับรองว่า Handshake ไม่ถูก Tamper
- Group Key Distribution: KEK ใช้ส่ง GTK อย่างปลอดภัยสำหรับ Broadcast/Multicast
PTK ใน WPA3 (SAE - Simultaneous Authentication of Equals)
- ไม่ใช้ 4-Way Handshake ใช้ SAE (Dragonfly Handshake) แทน
- ยังสร้าง PTK (Pairwise Transient Key) แต่ derivation แตกต่าง: ใช้ Password Element (PWE) + Scalar/Element Exchange
- ให้ Forward Secrecy จริง (แตก PSK ก็ไม่ถอดรหัส Session เก่าได้)
- ป้องกัน Offline Dictionary Attack
PTK อื่นๆ ที่อาจสับสน (Non-WiFi Context)
| Acronym | Full Form | Context |
|---|---|---|
| PTK | Permission to Kill | Gaming / Military Slang |
| PTK | Protein Tyrosine Kinase | Biology / Medicine |
| PTK | Phi Theta Kappa | Honor Society (US Colleges) |
| PTK | Phototherapeutic Keratectomy | Ophthalmology |
| PTK | Portable Tool Kit | Software Dev (Legacy) |
สรุป
ในบริบท Cybersecurity/Wi-Fi: PTK = Pairwise Transient Key เป็น Session Key ที่derive จาก PMK ผ่าน 4-Way Handshake (WPA2) หรือ SAE (WPA3) ประกอบด้วย KCK, KEK, TK ใช้สำหรับยืนยัน Handshake, เข้ารหัส GTK, และเข้ารหัส Unicast Traffic ตามลำดับ