Loading
feat: Add Post-Quantum Cryptography support (HQC-256 + Falcon-1024)
Description
This PR adds post-quantum cryptography (PQC) support to libssh, implementing quantum-resistant algorithms following NIST recommendations:
- HQC-256: Quantum-resistant key exchange (KEX)
- Falcon-1024: Quantum-resistant digital signatures
Motivation
Current public-key algorithms (RSA, ECDH, ECDSA) are vulnerable to quantum computer attacks. This implementation prepares libssh for the post-quantum era while maintaining backward compatibility.
Implementation
Key Exchange (HQC-256):
- New KEX algorithm:
hqc256-sha256@libssh.org - Integrated with existing KEX negotiation
- Public key: 7,245 bytes, Ciphertext: 14,421 bytes
Digital Signatures (Falcon-1024):
- New host key type:
ssh-falcon1024@libssh.org - OpenSSH format serialization support
- Public key: 1,793 bytes, Signature: ~1,280 bytes
Testing:
- Added
classic-message-testclient for performance comparison - Benchmark results: <1% latency overhead vs classical algorithms
- Example server and key generation tools included
Dependencies
Requires liboqs v0.15.0+ (https://github.com/open-quantum-safe/liboqs)
Build with: cmake .. -DWITH_LIBOQS=ON
Checklist
- Commits have
Signed-off-by:with name/author being identical to the commit author - Code modified for feature
- Test suite updated with functionality tests
- Test suite updated with negative tests
- Documentation updated
Known Issues
- liboqs external headers trigger
-Werror=pedanticwarnings (typedef redefinitions) - Suggest compiler flag exception for liboqs includes
- Willing to add unit tests with maintainer guidance on preferred framework
References
- NIST PQC: https://csrc.nist.gov/projects/post-quantum-cryptography
- Falcon: https://falcon-sign.info/
- HQC: https://pqc-hqc.org/
Part of undergraduate thesis on PQC integration in SSH protocols.
Edited by Rafael Bosi