๐Ÿ” Post-Quantum TLS โ€” Implementasi Transport Security Pasca-Kuantum

Panduan praktis membangun TLS 1.3 dengan KEM (Kyber) + Signature (Dilithium/Falcon) untuk menghadapi era kuantum. Bukan teori murni โ€” ini implementasi level produksi: hybrid key exchange, certificate chain migration, performance tuning, dan interoperabilitas dengan legacy client. Untuk fondasi matematika, lihat quantum-cryptography-primer dan hierarchy-quantum-cryptography-stack. Untuk implementasi Rust, lihat pqc-implementation-rust.


Daftar Isi


1. Arsitektur Hybrid TLS 1.3 PQC

1.1 Mengapa Hybrid?

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  TLS 1.3 Classic (Pre-Quantum)                                  โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”‚
โ”‚  ClientHello โ†’ ServerHello โ†’ EncryptedExtensions โ†’ Finished    โ”‚
โ”‚         โ”‚              โ”‚                    โ”‚                   โ”‚
โ”‚         โ–ผ              โ–ผ                    โ–ผ                   โ”‚
โ”‚   (EC)DHE          Certificate         Application Data         โ”‚
โ”‚   Key Exchange     Verify              (AES-GCM / ChaCha20)     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
 
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  TLS 1.3 Hybrid PQC (IETF Draft / RFC 9370 style)              โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”‚
โ”‚  ClientHello โ†’ ServerHello โ†’ EncryptedExtensions โ†’ Finished    โ”‚
โ”‚         โ”‚              โ”‚                    โ”‚                   โ”‚
โ”‚         โ–ผ              โ–ผ                    โ–ผ                   โ”‚
โ”‚   Hybrid KEM       Hybrid Cert         Application Data         โ”‚
โ”‚   (Classical +     Chain (Classical    (AES-GCM / ChaCha20)     โ”‚
โ”‚    PQC Kyber)      + PQC Dilithium)                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Prinsip Hybrid: shared_secret = KDF(classical_shared || pqc_shared). Jika salah satu broken (misal CRQC memecahkan ECDH), PQC component masih aman. Harus-bukan-boleh โ€” transitional period 2024-2030+ butuh dual protection.

1.2 Threat Model

ThreatClassical TLSHybrid PQC TLS
Passive eavesdrop (record now, decrypt later)๐Ÿ”ด Vulnerable (CRQC future)๐ŸŸข Safe โ€” PQC KEM unbroken
Active MitM (certificate forge)๐ŸŸก Hard (CA compromise)๐ŸŸข Safe โ€” Dilithium sig unforgeable
Downgrade attack๐ŸŸก Possible๐ŸŸข Hybrid nego fail = abort
Side-channel (timing, cache)๐ŸŸก ECDH vulnerable๐ŸŸก Kyber/Dilithium butuh constant-time impl

2. KEM: Kyber โ€” Key Encapsulation Mechanism

2.1 Parameter Set (NIST PQC Standardization)

VariantNIST Security LevelPublic Key (bytes)Ciphertext (bytes)Shared Secret (bytes)Target
Kyber-5121 (AES-128 equiv)80076832TLS 1.3 hybrid (low latency)
Kyber-7683 (AES-192 equiv)1184108832Recommended default
Kyber-10245 (AES-256 equiv)1568156832High security, higher latency

Kyber-768 adalah sweet spot untuk TLS: overhead ~1.2KB per handshake vs ~200 bytes ECDH, tapi security margin besar. Kyber-512 cukup untuk kebanyakan deployment tapi margin tipis (level 1).

2.2 Kyber Internal Structure (Module-LWE)

Kyber KEM = Module-LWE over R_q = Z_q[X]/(X^n+1) dengan n=256, q=3329
 
KeyGen():
  1. Sample s โ† ฮท_1 (secret), e โ† ฮท_1 (error)
  2. A โ† uniform matrix (seed ฯ)
  3. t = Aยทs + e          โ†’ public key = (ฯ, t)
  4. sk = (s, ฯ, t, hash(pk))
 
Encaps(pk):
  1. Sample r โ† ฮท_1, e1 โ† ฮท_2, e2 โ† ฮท_2
  2. u = A^Tยทr + e1
  3. v = t^Tยทr + e2 + encode(m)
  4. ct = (u, v)
  5. K = H(m || H(ct))
 
Decaps(sk, ct):
  1. m' = v - s^Tยทu
  2. m' = decode(m')
  3. Re-encapsulate dengan m' โ†’ ct'
  4. If ct == ct': return K = H(m' || H(ct))
     Else: return K = H(z || H(ct))  # implicit rejection (FO transform)

2.3 Constant-Time Implementation Requirements

OperationVulnerabilityMitigasi
NTT (Number Theoretic Transform)Timing via coefficient accessFixed-loop NTT, no data-dependent branches
Polynomial sampling (CBD)Rejection sampling timingConstant-time binomial sampling
FO Transform (re-encapsulation)Branch on ct comparisonConstant-time compare + select
Hash (SHA3-256/512)โ€”Hardware SHA3 (SHA-NI) atau portable constant-time

Referensi implementasi: pqc-rust/kyber crate, liboqs, BoringSSL PQC branch. Semua production-grade sudah constant-time.


3. Signature: Dilithium & Falcon

3.1 Dilithium (Primary โ€” Lattice-based)

VariantNIST LevelPublic KeySignatureUse Case
Dilithium-221312 B2420 BTLS server cert (recommended)
Dilithium-331952 B3293 BRoot CA, long-term
Dilithium-552592 B4595 BMaximum security

Struktur Dilithium: Module-LWE + Module-SIS dengan Fiat-Shamir with Aborts โ€” rejection sampling membuat signature size variable tapi bounded.

3.2 Falcon (Alternative โ€” NTRU Lattice)

VariantNIST LevelPublic KeySignatureNote
Falcon-5121897 B~666 BSmaller sig, but floating-point NTT (harder constant-time)
Falcon-102451793 B~1280 BHigh security

Falcon butuh floating-point arithmetic untuk NTT โ€” sulit constant-time di side-channel resistant hardware. Dilithium preferred untuk TLS certificate (integer-only). Falcon cocok untuk embedded/space-constrained.

3.3 Hybrid Certificate Chain

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Hybrid X.509 Certificate (IETF draft-ietf-lamps-pqc)     โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”‚
โ”‚  Subject: server.example.com                               โ”‚
โ”‚  Issuer: Hybrid CA                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ SubjectPublicKeyInfo:                                โ”‚  โ”‚
โ”‚  โ”‚   Algorithm: id-KEM-Kyber768 + id-SIG-Dilithium2    โ”‚  โ”‚
โ”‚  โ”‚   Public Key:  [Kyber PK || Dilithium PK]           โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚  Extensions:                                               โ”‚
โ”‚  - SubjectAltName: DNS:server.example.com                 โ”‚
โ”‚  - KeyUsage: keyEncipherment, digitalSignature            โ”‚
โ”‚  - ExtendedKeyUsage: serverAuth                           โ”‚
โ”‚  - 1.3.6.1.5.5.7.1.24 (TLS Feature) โ€” hybrid flag        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Migration Path:

  1. Phase 1 (2024-2026): Dual cert โ€” classical (RSA/ECDSA) + PQC (Dilithium) di server, client negotiate hybrid
  2. Phase 2 (2026-2028): Hybrid cert tunggal (composite key), legacy client fallback ke classical-only
  3. Phase 3 (2028+): PQC-only, classical deprecated

4. Certificate Chain Migration

4.1 Composite Key vs Dual Cert

ApproachProsCons
Dual Certificate (2 cert di chain)Compatible dengan legacy client, rollback mudahChain size 2x, management complexity
Composite Key (1 cert, 2 PK)Single cert, smaller chainButuh client support composite OID, CA tooling update
Hybrid KEM + Classical SigTransitional, minimal changeTidak full PQC โ€” sig masih classical

Rekomendasi produksi 2026: Dual Certificate โ€” sudah didukung rustls-pqc, BoringSSL, OpenSSL 3.5+. CA seperti DigiCert, GlobalSign sudah pilot.

4.2 CA Infrastructure Update

# Generate hybrid CA (conceptual โ€” tooling belum standar)
# Step 1: Classical CA
openssl genpkey -algorithm ED25519 -out ca_classical.key
openssl req -x509 -new -key ca_classical.key -sha256 -days 3650 -out ca_classical.crt
 
# Step 2: PQC CA (Dilithium) โ€” butuh liboqs/oqs-provider
# openssl genpkey -provider oqs -algorithm dilithium2 -out ca_pqc.key
# openssl req -x509 -new -key ca_pqc.key -provider oqs -days 3650 -out ca_pqc.crt
 
# Step 3: Issue hybrid server cert
# Server CSR dengan composite key (Kyber768 + Dilithium2)
# CA sign dengan dual key (classical + PQC)

Real-world: Gunakan oqs-provider (OpenSSL 3) atau oqs-rust untuk generate. CA production pakai HSM yang support PQC (Utimaco, Thales, Futurex โ€” firmware update 2024+).


5. Hybrid Key Exchange di Rustls / BoringSSL

5.1 Rustls PQC (rustls-pqc / aws-lc-rs PQC)

// Cargo.toml
[dependencies]
rustls = { version = "0.23", features = ["tls12", "aws-lc-rs"] }
aws-lc-rs = { version = "0.23", features = ["pqc"] }  # PQC enabled
# Atau: rustls-pqc = "0.1" (fork terpisah)
 
// Hybrid Key Exchange Configuration
use rustls::crypto::aws_lc_rs::cipher_suite::TLS13_AES_256_GCM_SHA384;
// PQC cipher suites belum distandarkan di rustls 0.23 stable โ€” pakai branch pqc-experimental
 
// Contoh konfigurasi server hybrid
let config = rustls::ServerConfig::builder()
    .with_safe_defaults()
    .with_no_client_auth()
    .with_single_cert(certs, key)?;  // cert harus hybrid (dual)
 
// Client: enable hybrid KEM groups
let mut root_store = rustls::RootCertStore::empty();
root_store.add(&ca_cert)?;
let config = rustls::ClientConfig::builder()
    .with_root_certificates(root_store)
    .with_no_client_auth();

5.2 Supported Hybrid Groups (Draft IETF)

Group NameClassicalPQCIANA Code (Draft)
X25519Kyber768Draft00X25519Kyber-7680x6399
SecP256r1Kyber768Draft00P-256Kyber-7680x639A
X25519Kyber512Draft00X25519Kyber-5120x639B

Status 2026: X25519Kyber768Draft00 adalah de facto standard โ€” didukung Cloudflare, Google, AWS, Mozilla. RFC 9370 akan menormalkannya.

5.3 BoringSSL / Google Implementation

// BoringSSL hybrid KEM (internal)
SSL_CTX_set1_groups_list(ctx, "X25519Kyber768Draft00:X25519:P-256");
 
// ClientHello akan mengirim supported_groups:
//   0x6399 (X25519Kyber768Draft00), 0x001D (X25519), 0x0017 (P-256)
 
// Server memilih hybrid group jika client support

6. Performance Benchmark & Tuning

6.1 Handshake Overhead Comparison

Cipher SuiteClientHello SizeServerHello SizeTotal Handshake BytesCPU Cycles (est.)
TLS13-AES256-GCM-SHA384 (X25519)~200 B~300 B~1.2 KB500K
X25519Kyber768Draft00~1.1 KB~1.4 KB~3.5 KB1.8M
X25519Kyber512Draft00~900 B~1.1 KB~3.0 KB1.4M
P-256 + Kyber768~1.1 KB~1.4 KB~3.5 KB2.1M

Overhead: ~2-3x handshake bytes, ~3-4x CPU cycles. Tapi: handshake cuma sekali per session โ€” session resumption (PSK) amortisasi overhead.

6.2 Optimasi Produksi

// 1. Session Resumption (PSK) โ€” wajib enable
let config = rustls::ServerConfig::builder()
    .with_safe_defaults()
    .with_client_cert_verifier(Arc::new(verifier))
    .with_single_cert(certs, key)?;
config.max_early_data_size = 0;  // disable 0-RTT untuk security
config.ticketer = rustls::Ticketer::new();  // session ticket
 
// 2. Connection Pooling / Keep-Alive
// HTTP/2 + TLS hybrid: satu handshake, banyak request
 
// 3. Hardware Acceleration
// - AWS Nitro Enclaves: AES-NI + SHA-NI
// - Intel QAT: offload Kyber NTT (experimental)
// - ARMv8.4-A: SHA3/SM3 instructions
 
// 4. Certificate Compression (RFC 8879)
// Compress certificate chain sebelum kirim
// openssl s_client -cert_compression zlib

6.3 Real-World Latency (Cloudflare Data 2024)

MetricClassicalHybrid (X25519Kyber768)Delta
Handshake latency (p50)12 ms18 ms+50%
Handshake latency (p99)45 ms78 ms+73%
CPU per handshake0.8 ms2.1 ms+162%
Session resumption hit85%85%=

Kesimpulan: Overhead signifikan tapi acceptable untuk security-critical. Session resumption mitigasi 85% handshake.


7. Interoperabilitas & Fallback Strategy

7.1 Client Support Matrix (2026)

ClientHybrid SupportVersion
Chromeโœ… X25519Kyber768Draft00116+ (flag), 120+ default
Firefoxโœ… X25519Kyber768Draft00118+ (flag), 125+ default
Safari๐ŸŸก Experimental17+ (behind flag)
curlโœ… via BoringSSL8.6+
Python requests๐ŸŸก Butuh urllib3 + pyopenssl PQC2.31+
Go stdlibโœ… X25519Kyber7681.22+
Rust reqwestโœ… via rustls-pqc0.12+
OpenSSLโœ… via oqs-provider3.5+
Java๐ŸŸก JDK 21+ (experimental)21+

7.2 Fallback Strategy

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Server Config: Hybrid Priority                             โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”‚
โ”‚  supported_groups = [                                       โ”‚
โ”‚    "X25519Kyber768Draft00",  # 1st: Hybrid PQC              โ”‚
โ”‚    "X25519",                 # 2nd: Classical modern        โ”‚
โ”‚    "P-256"                   # 3rd: Classical legacy        โ”‚
โ”‚  ]                                                          โ”‚
โ”‚                                                             โ”‚
โ”‚  ClientHello supported_groups:                              โ”‚
โ”‚  - Modern browser: [X25519Kyber768, X25519, P-256]         โ”‚
โ”‚    โ†’ Server pilih X25519Kyber768 โœ…                         โ”‚
โ”‚  - Legacy client (curl 7.68): [X25519, P-256]              โ”‚
โ”‚    โ†’ Server pilih X25519 โš ๏ธ (classical only)                โ”‚
โ”‚  - Very old (IE11): [P-256]                                โ”‚
โ”‚    โ†’ Server pilih P-256 โš ๏ธ (classical only)                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Policy: Tidak pernah fallback ke non-hybrid jika client support hybrid. Hanya fallback jika client tidak mengirim hybrid group.


8. Deployment Checklist Produksi

โ˜ CA Infrastructure: Dual cert issuance (classical + PQC) atau composite key
โ˜ Server Cert: Hybrid certificate chain deployed
โ˜ TLS Library: rustls 0.23+pqc / BoringSSL / OpenSSL 3.5+oqs-provider
โ˜ Cipher Suites: X25519Kyber768Draft00 enabled, priority #1
โ˜ Session Resumption: PSK tickets enabled, lifetime 24h
โ˜ Certificate Compression: RFC 8879 enabled (zlib/brotli)
โ˜ Monitoring: Handshake latency p50/p99, hybrid negotiation rate
โ˜ Fallback Testing: Legacy client (curl 7.68, Python 3.8) still connect
โ˜ HSM: PQC firmware loaded (Utimaco/Thales/Futurex 2024+)
โ˜ Cert Rotation: Automation untuk dual cert (cert-manager + pqc issuer)
โ˜ Incident Response: Playbook untuk PQC key compromise (rotate both keys)


Post-Quantum TLS ยท Hybrid = Classical + PQC ยท Kyber-768 + Dilithium-2 = Sweet Spot ยท Session Resumption = Overhead Killer ยท Dual Cert = Migration Path ยท 2026 = Production Ready