End-to-End Encryption (E2EE) คืออะไร?
End-to-End Encryption (E2EE) เป็นวิธีเข้ารหัสข้อมูลที่ เฉพาะผู้ส่งและผู้รับเท่านั้นที่ถอดรหัสได้ ข้อมูลจะถูกเข้ารหัสบนอุปกรณ์ผู้ส่ง (Client-side) และถอดรหัสบนอุปกรณ์ผู้รับ ไม่มีฝ่ายกลาง (Server, ISP, Router, แม้แต่ผู้ให้บริการ) สามารถอ่านได้
หลักการทำงานของ E2EE
- Key Generation: แต่ละผู้ใช้มี Key Pair: Public Key (แจกจ่ายสาธารณะ) และ Private Key (เก็บความลับ)
- Encryption: ผู้ส่งใช้ Public Key ของผู้รับ เข้ารหัสข้อความ
- Transmission: ข้อมูลเข้ารหัส (Ciphertext) ส่งผ่าน Server/Network
- Decryption: ผู้รับใช้ Private Key ของตน ถอดรหัสได้ข้อความต้นฉบับ
- Forward Secrecy: ใช้ Session Key ชั่วคราว (Ephemeral) สำหรับแต่ละเซสชัน ป้องกันการถอดรหัสย้อนหลัง
E2EE vs Encryption อื่นๆ
| ประเภท | จุดเข้ารหัส | จุดถอดรหัส | Server อ่านได้? | ตัวอย่าง |
|---|---|---|---|---|
| E2EE | Client (Sender) | Client (Receiver) | ❌ ไม่ได้ | Signal, WhatsApp, Threema, Wire, Matrix/Element |
| Transport Encryption (TLS/SSL) | Client | Server | ✅ ได้ (Terminate at Server) | HTTPS, SMTP/STARTTLS, IMAPS |
| Link Encryption | Per Hop (Router-to-Router) | Per Hop | ✅ ได้ (แต่ละ Hop) | IPsec, MACsec, WPA2/WPA3 |
| Encryption at Rest | Storage | Storage | ✅ ได้ (ถ้ามี Key) | BitLocker, LUKS, FileVault |
โปรโตคอลและเทคโนโลยี E2EE หลัก
- Signal Protocol (Double Ratchet): ใช้ใน Signal, WhatsApp, Facebook Messenger (Secret Conversation), Skype (Private Conversation), Google RCS
- MLS (Message Layer Security): มาตรฐาน IETF สำหรับ Group Messaging E2EE
- PGP/GPG (OpenPGP): Email Encryption (ProtonMail, Thunderbird/Enigmail)
- S/MIME: Email Encryption ใช้ Certificate (Enterprise)
- WebRTC (DTLS-SRTP): Voice/Video Call E2EE (Signal, WhatsApp, FaceTime, Jitsi)
- IPsec (ESP): VPN Site-to-Site (E2EE ระหว่าง Gateway)
- WireGuard: Modern VPN Protocol (E2EE ระหว่าง Peer)
- TLS 1.3 (0-RTT, PSK): ไม่ใช่ E2EE แต่อยู่ใกล้เคียง (Encrypted Client Hello - ECH)
วิธีเปิดใช้งาน E2EE บนแอปยอดนิยม
Signal (Default E2EE)
เปิดใช้งานอัตโนมัติ ไม่ต้องตั้งค่า
Default E2EE สำหรับ Chat, Call, Backup (Optional: End-to-End Encrypted Backup ใน Settings → Chats → Chat Backup)
Facebook Messenger
- เปิด Chat → กดไอคอน i / Profile
- เลือก Go to Secret Conversation
- หรือ: New Message → ไอคอนล็อค (🔒) → เลือก Contact
Telegram
ไม่ใช่ Default** ต้องใช้ Secret Chat (ไอคอนล็อค) เท่านั้น Cloud Chat ไม่ใช่ E2EE
Email (PGP/GPG)
- สร้าง Key Pair:
gpg --full-generate-key - แชร์ Public Key ให้ผู้รับ
- นำเข้า Public Key ของผู้รับ:
gpg --import publickey.asc - เข้ารหัส:
gpg --encrypt --recipient "email@domain.com" file.txt
การ Implement E2EE (สำหรับ Developer)
- เลือก Library ที่ผ่าน Audit: libsignal (Signal Protocol), OpenPGP.js, WebCrypto API, Sodium/libsodium
- Key Management: Key Generation, Storage (Secure Enclave/Keystore), Rotation, Revocation, Backup
- Forward Secrecy: Double Ratchet หรือ MLS สำหรับ Group
- Authentication: Verify Safety Number / QR Code / Fingerprint (ป้องกัน MitM)
- Metadata Protection: Sealed Sender, Private Information Retrieval (PIR)
- Audit & Testing: Third-party Audit, Bug Bounty, Formal Verification
ข้อจำกัดและความท้าทายของ E2EE
- Key Management คשה: User หาย Key = หายข้อมูล (ไม่มี Recovery)
- Metadata ยังมองเห็น: ใครส่งให้ใคร, เวลา, ขนาด, IP (เว้นแต่จะมี Metadata Protection)
- Device Compromise: ถ้า Endpoint โดนแฮก E2EE ไม่ช่วย
- Group Chat Complexity: Key Distribution, Forward Secrecy, Post-Compromise Security
- Legal/Regulatory: บางประเทศบังคับ Backdoor (EARN IT Act, UK Online Safety Bill, อินเดีย, ไทย PDPA/CCA)
- Performance: Client-side Crypto ใช้ CPU/Battery มากกว่า
E2EE จำเป็นไหม?
จำเป็นสำหรับ: ข้อมูล nhạy cảm (การเงิน, สุขภาพ, กฎหมาย, สื่อสารส่วนตัว, Trade Secrets)
ไม่จำเป็นสำหรับ: ข้อมูลสาธารณะ, Internal System-to-System (ใช้ mTLS/IPsec เพียงพอ)
สรุป
E2EE ให้ความปลอดภัยสูงสุดสำหรับการสื่อสาร: เฉพาะปลายทางเท่านั้นที่อ่านได้ ใช้ Signal Protocol (Double Ratchet) เป็นมาตรฐานโดมิแนนต์ ต้องจัดการ Key อย่างระมัดระวัง และควรใช้แอปที่ผ่าน Audit (Signal, Threema, Wire, Element/Matrix) สำหรับ Developer: ใช้ Library มาตรฐาน อย่าสร้าง Crypto เอง