Learning outcomes, challenges encountered, future work, and references for the Hybrid Post-Quantum File Transfer Tool.
This project implements a hybrid post-quantum encrypted file transfer web application โ entirely in the browser using HTML, CSS, and JavaScript with the Web Crypto API.
The goal was to demonstrate that cutting-edge cryptography, while mathematically complex, can be made accessible and interactive. By showing the actual matrix operations, hex keys, and step-by-step process, students can understand the mechanics behind NIST's 2024 post-quantum standards.
Not a simulation โ actual browser cryptography
Real matrix operations, error sampling, correctness proof
Domain-separated combination of both secrets
Authenticated encryption, custom .hpqc file format
Increase ฮท to break decryption โ shows parameter importance
Deep understanding of LWE, its connection to lattice hard problems (SVP, SIVP), and why random errors create computational hardness. The mathematical reduction from LWE to worst-case lattice problems is elegant and non-trivial.
Followed the NIST PQC competition (2016-2024). Kyber (ML-KEM, FIPS 203) emerged as the primary KEM standard. Understanding the design philosophy: security proofs, efficiency trade-offs, implementation simplicity.
Why hybrid is NIST's recommendation for the transition period (2024-2030+). The composability of KEMs: if either component is secure, the combined key is secure. Domain separation via labeled hashing.
The browser's native crypto API is powerful: ECDH, AES-GCM, SHA-256 all natively available. The API is subtly different from Node.js's crypto module โ promise-based, with strict key extractability policies.
Math.random() is not cryptographically secure. All sampling uses crypto.getRandomValues() for uniform bits, then constructs the centered binomial distribution from uniform bits. This mirrors how real Kyber samples its error distribution.
crypto.subtle.importKey(..., false, ...) are non-extractable by design โ you can't read the raw bytes back. This required careful design: derive the key bytes first (for display), then import separately for encryption operations.
Compile the Open Quantum Safe's liboqs library to WebAssembly. This would give a production-grade Kyber-768 implementation running in the browser, with n=256, q=3329 โ real security parameters.
Add a WebSocket server (Node.js + ws) so Alice and Bob can actually transfer files over a network. The key exchange would run over the WebSocket, demonstrating a real-world use case.
Integrate into TLS via HKDF and proper KEM transport. Real hybrid PQC in TLS 1.3 uses X25519Kyber768 โ the ECDH + Kyber combination as a single KEM. This is already deployed by Cloudflare and Google.
On Lattices, Learning with Errors, Random Linear Codes, and Cryptography.
Oded Regev. STOC 2005, J. ACM 56(6), 2009.
The foundational paper introducing LWE and proving it is as hard as worst-case lattice problems (SIVP, GapSVP). Essential reading for understanding the security foundation.
View Paper โCRYSTALS-Kyber: A CCA-Secure Module-Lattice-Based KEM.
J. Bos, L. Ducas, E. Kiltz, T. Lepoint, V. Lyubashevsky, J.M. Schanck, P. Schwabe, G. Seiler, D. Stehlรฉ. EuroS&P 2018.
The Kyber paper. Introduces the module-LWE approach for efficient KEM construction and provides the security proof for Kyber.CPA and Kyber.CCA2 security.
IACR ePrint โModule-Lattice-Based Key-Encapsulation Mechanism Standard (FIPS 203).
NIST, August 2024.
The official NIST standard for ML-KEM (based on Kyber). Defines the exact parameter sets, algorithms, and security requirements. This is the algorithm that production systems should implement.
NIST Standard โPost-Quantum Cryptography.
Daniel J. Bernstein, Tanja Lange. Nature 549, 188โ194 (2017).
An accessible survey of the post-quantum landscape, covering lattice, code-based, hash-based, and multivariate approaches. Excellent starting point for understanding the field.
View Article โOpen Quantum Safe (OQS) Project.
University of Waterloo, 2016โpresent.
The liboqs library implements production-grade post-quantum algorithms including Kyber, Dilithium, and others. Used by OpenSSL, OpenSSH, and other major projects for hybrid PQC integration.
OQS Project โWeb Cryptography API (W3C Recommendation).
W3C, 2017. MDN Documentation โ continuously updated.
The cryptographic API used in this demo for ECDH, AES-256-GCM, and SHA-256. Provides native, hardware-accelerated cryptography in all modern browsers without any dependencies.
MDN Reference โ