You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement FIPS 203 (ML-KEM) Support for Quantum-Resistant Key Encapsulation in OpenTDFKit
Description
Implement support for FIPS 203 (Module-Lattice-Based Key-Encapsulation Mechanism Standard), also known as ML-KEM, to provide quantum-resistant key encapsulation for OpenTDFKit. This enhancement builds upon the existing post-quantum cryptography (PQC) roadmap outlined in Issue #22 and provides concrete implementation steps for the Swift/iOS ecosystem.
Cross-Repository Coordination: This issue is linked to opentdf-rs Issue #60, which implements the same FIPS 203 support in Rust. Both implementations must interoperate to ensure TDF files encrypted by one SDK can be decrypted by the other.
Background on FIPS 203
FIPS 203 is the NIST-standardized Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM), finalized in August 2024. It is based on the CRYSTALS-Kyber algorithm and provides quantum-resistant key encapsulation with three security levels:
Harvest-Now-Decrypt-Later (HNDL): Adversaries can store encrypted TDF files today and decrypt them when quantum computers become available (estimated 10-15 years)
Long-term Data Protection: TDF is designed for long-term encrypted storage, making quantum resistance critical
Mobile Security: iOS/macOS devices are high-value targets for quantum decryption
Zero Trust Alignment: PQC strengthens the Zero Trust security model
2. Standards Compliance
NIST has finalized FIPS 203 (August 2024), making ML-KEM production-ready
Future regulatory requirements likely to mandate post-quantum cryptography
Early adoption positions OpenTDFKit as a security leader in the Swift ecosystem
3. Ecosystem Maturity
Swift can leverage proven C/C++ libraries through interop:
liboqs: Open Quantum Safe library with ML-KEM support
PQClean: Reference implementations
Signal has successfully deployed ML-KEM in production (SPQR protocol)
Rust implementation (opentdf-rs) provides reference for interoperability
4. Current Vulnerability
OpenTDFKit currently uses quantum-vulnerable algorithms:
❌ P-256/P-384/P-521 ECDH (Key agreement) - Vulnerable to Shor's algorithm
❌ ECDSA P-256/P-384/P-521 (Signatures) - Vulnerable to Shor's algorithm
✅ AES-256-GCM - Already quantum-resistant
✅ HMAC-SHA256 - Already quantum-resistant
Proposed Implementation
Phase 1: ML-KEM-768 Integration (Months 1-4)
1.1 Choose Swift Integration Approach
Option A: C Library Bridging via liboqs (Recommended for Phase 1)
// Use liboqs via Swift C interop
import liboqs
publicclassMlKemWrapper{privateletkem:OQS_KEMinit()throws{guardlet kem =OQS_KEM_new(OQS_KEM_alg_ml_kem_768)else{throwKemError.initializationFailed
}self.kem = kem
}func generateKeyPair()throws->(publicKey:Data, privateKey:Data){varpublicKey=[UInt8](repeating:0, count:Int(kem.length_public_key))varprivateKey=[UInt8](repeating:0, count:Int(kem.length_secret_key))letresult=OQS_KEM_keypair(kem,&publicKey,&privateKey)guard result == OQS_SUCCESS else{throwKemError.keyGenerationFailed
}return(Data(publicKey),Data(privateKey))}func encapsulate(publicKey:Data)throws->(ciphertext:Data, sharedSecret:Data){varciphertext=[UInt8](repeating:0, count:Int(kem.length_ciphertext))varsharedSecret=[UInt8](repeating:0, count:Int(kem.length_shared_secret))letresult= publicKey.withUnsafeBytes{ pubKeyPtr inOQS_KEM_encaps(kem,&ciphertext,&sharedSecret, pubKeyPtr.baseAddress)}guard result == OQS_SUCCESS else{throwKemError.encapsulationFailed
}return(Data(ciphertext),Data(sharedSecret))}func decapsulate(ciphertext:Data, privateKey:Data)throws->Data{varsharedSecret=[UInt8](repeating:0, count:Int(kem.length_shared_secret))letresult= ciphertext.withUnsafeBytes{ ctPtr in
privateKey.withUnsafeBytes{ skPtr inOQS_KEM_decaps(kem,&sharedSecret, ctPtr.baseAddress, skPtr.baseAddress)}}guard result == OQS_SUCCESS else{throwKemError.decapsulationFailed
}returnData(sharedSecret)}}
Must coordinate on protocol extensions and test vectors
Interoperability required for cross-platform TDF support
Dependencies
Swift Packages
// Package.swift
dependencies:[.package(url:"https://github.com/apple/swift-crypto.git", from:"3.0.0"),
// Add liboqs via system library or SPM wrapper
]
System Libraries
liboqs: Open Quantum Safe library for ML-KEM
Install via Homebrew: brew install liboqs
Link via Swift Package Manager or manual bridging
External Coordination
OpenTDF Specification: Coordinate with OpenTDF community for PQC protocol extensions
opentdf-rs: Joint RFC and implementation planning for interoperability
KAS Servers: KAS implementations must support PQC rewrap protocol
Swift Crypto Ecosystem: Monitor Apple's CryptoKit roadmap for native PQC support
Risks & Mitigations
Risk
Likelihood
Impact
Mitigation
OpenTDF spec divergence
HIGH
HIGH
Coordinate with community via RFC before implementation
opentdf-rs incompatibility
HIGH
HIGH
Joint test vectors and continuous integration testing
C bridging complexity
MEDIUM
MEDIUM
Use proven liboqs library, extensive testing
Performance on iOS
MEDIUM
MEDIUM
Benchmark early, optimize hot paths, async operations
Library immaturity
LOW
MEDIUM
Use proven libraries (liboqs, used in production)
Key size overhead
LOW
LOW
+2KB per KAS acceptable for security benefit
Swift ecosystem gaps
MEDIUM
HIGH
Contribute to ecosystem, monitor Apple's roadmap
Timeline
Phase 1: ML-KEM Implementation (Months 1-4)
Month 1: Setup liboqs integration and Swift bridging
Month 2: Implement ML-KEM wrapper and key encapsulation
Month 3: Add comprehensive tests and benchmarks
Month 4: Documentation and code review
Phase 2: Hybrid Mode (Months 5-8)
Month 5: Implement HybridKeyEncapsulation
Month 6: NanoTDF header format updates
Month 7: Integration testing with KAS
Month 8: Cross-platform interoperability testing with opentdf-rs
Phase 3: Production Readiness (Months 9-12)
Month 9: Security audit preparation
Month 10: Performance optimization for iOS/macOS
Month 11: Beta release with opt-in PQC support
Month 12: Documentation and migration guides
Performance Targets
Based on current OpenTDFKit benchmarks and mobile constraints:
Implement FIPS 203 (ML-KEM) Support for Quantum-Resistant Key Encapsulation in OpenTDFKit
Description
Implement support for FIPS 203 (Module-Lattice-Based Key-Encapsulation Mechanism Standard), also known as ML-KEM, to provide quantum-resistant key encapsulation for OpenTDFKit. This enhancement builds upon the existing post-quantum cryptography (PQC) roadmap outlined in Issue #22 and provides concrete implementation steps for the Swift/iOS ecosystem.
Cross-Repository Coordination: This issue is linked to opentdf-rs Issue #60, which implements the same FIPS 203 support in Rust. Both implementations must interoperate to ensure TDF files encrypted by one SDK can be decrypted by the other.
Background on FIPS 203
FIPS 203 is the NIST-standardized Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM), finalized in August 2024. It is based on the CRYSTALS-Kyber algorithm and provides quantum-resistant key encapsulation with three security levels:
Recommended: ML-KEM-768 (192-bit security) provides strong quantum resistance with reasonable key/ciphertext sizes.
Motivation
1. Quantum Threat Protection
2. Standards Compliance
3. Ecosystem Maturity
4. Current Vulnerability
OpenTDFKit currently uses quantum-vulnerable algorithms:
Proposed Implementation
Phase 1: ML-KEM-768 Integration (Months 1-4)
1.1 Choose Swift Integration Approach
Option A: C Library Bridging via liboqs (Recommended for Phase 1)
1.2 Implement Key Encapsulation Protocol
1.3 Add Comprehensive Tests
Phase 2: Hybrid Classical + PQC Mode (Months 5-8)
Implement hybrid mode combining ECDH with ML-KEM:
Phase 3: NanoTDF Format Integration (Months 9-12)
Update NanoTDF header to support PQC metadata:
TDF manifest schema for PQC:
{ "encryptionInformation": { "keyAccess": [{ "type": "hybrid", "version": "v2-pqc-hybrid", "classical": { "algorithm": "ECDH-P256", "ephemeralPublicKey": "base64_ecdh_public_key" }, "postQuantum": { "algorithm": "ML-KEM-768", "ciphertext": "base64_mlkem_ciphertext" }, "url": "https://kas.example.com", "protocol": "kas", "policyBinding": {...} }] } }Acceptance Criteria
Functional Requirements
Testing Requirements
Documentation Requirements
Security Requirements
Related Issues
Issue Adopt Post-Quantum Cryptography with Hybrid Approach #22: Adopt Post-Quantum Cryptography with Hybrid Approach
opentdf-rs Issue #60: Implement FIPS 203 (ML-KEM) Support
Dependencies
Swift Packages
System Libraries
brew install liboqsExternal Coordination
Risks & Mitigations
Timeline
Phase 1: ML-KEM Implementation (Months 1-4)
Phase 2: Hybrid Mode (Months 5-8)
Phase 3: Production Readiness (Months 9-12)
Performance Targets
Based on current OpenTDFKit benchmarks and mobile constraints:
References
Standards & Specifications
Implementations & Libraries
Research & Analysis
Labels
enhancement- New feature requestcryptography- Cryptographic implementationpost-quantum- Post-quantum cryptographysecurity- Security enhancementFIPS- FIPS standards complianceinteroperability- Cross-platform compatibilityPriority
HIGH - Critical for long-term security, future compliance, and ecosystem interoperability
Notes