pqblocks-tls-interop
TLS 1.3 hybrid key exchange (X25519MLKEM768 / RFC 10024) endpoint probe, downgrade detector, and key material validator.
Overview
pqblocks-tls-interop is a lightweight, zero-dependency Python library and CLI tool designed to validate post-quantum TLS 1.3 endpoints. It verifies support for the standardized X25519MLKEM768 hybrid key exchange group per RFC 10024 and validates key derivation per RFC 9954.
The tool operates without completing a full TLS application session: it probes server Hello extensions, detects hybrid group negotiation, alerts on classical downgrades (e.g. classical X25519 only), and validates wire-format key share structures.
Key Capabilities
- RFC 10024 Compliance: Validates hybrid group codepoint
4588(0x11EC) and enforces ML-KEM shared secret first concatenation. - Downgrade Detection: Detects when servers fail to negotiate hybrid groups or downgrade to classical X25519 (codepoint
29), exiting with distinct return codes for CI/CD gates. - Key Material Derivation: Implements RFC 10024 combined secret derivation and RFC 9954 SHA-384 key material derivation.
- Zero Third-Party Runtime Dependencies: Built entirely with Python's standard library (
socket,ssl,struct,hashlib).
Installation
pip install pqblocks-tls-interop
No external cryptographic libraries or C compilers are required.
Quickstart
Python API
from pqblocks_tls_interop import derive_shared_secret_10024, derive_key_material_rfc9954
from pqblocks_tls_interop.verifier.probe import HybridGroupProbe
# 1. Inspect RFC 10024 shared secret specifications
layout = HybridGroupProbe.get_shared_secret_layout()
print(layout["group_name"]) # X25519MLKEM768
print(layout["codepoint"]) # 4588
# 2. Derive combined hybrid shared secret (64 bytes: 32 bytes ML-KEM || 32 bytes X25519)
classical_ss = b"\x01" * 32
mlkem_ss = b"\x02" * 32
combined = derive_shared_secret_10024(classical_ss, mlkem_ss)
assert combined == mlkem_ss + classical_ss
# 3. Derive key material per RFC 9954 (48-byte SHA-384 digest)
km = derive_key_material_rfc9954(classical_ss, mlkem_ss)
assert len(km) == 48
# 4. Probe an external endpoint
probe = HybridGroupProbe("example.com", port=443, timeout=5.0)
result = probe.probe(sni="example.com")
if result.downgrade_detected:
print(f"Warning: Endpoint downgraded to classical ({result.error_reason})")
Command Line Interface
# Print RFC 10024 wire format layout
pqblocks-tls-interop --layout
# Probe a TLS server
pqblocks-tls-interop example.com -p 443 --sni example.com
CLI Exit Codes
0: Hybrid group successfully negotiated (or--layoutprinted).1: Hybrid group not offered or downgrade to classical detected.2: Network operational error or invalid arguments.
Performance Summary
Measured on Linux x86_64 across 1,000 iterations:
| Operation | Standard | Latency (Mean) | Throughput |
|---|---|---|---|
derive_shared_secret_10024 |
RFC 10024 | 0.00021 ms | ~4,700,000 ops/sec |
derive_key_material_rfc9954 |
RFC 9954 | 0.00264 ms | ~379,000 ops/sec |
get_shared_secret_layout |
RFC 10024 | 0.00040 ms | ~2,470,000 ops/sec |
ProbeResult.to_json |
JSON Serializer | 0.00474 ms | ~210,000 ops/sec |
For complete benchmark methodology, see BENCHMARKS.md.
Security & Verification
- Tested against official NIST ACVP server ML-KEM decapsulation test vectors (
ML-KEM-encapDecap-FIPS203). - 235 automated unit and integration tests covering wire format parsing, SNI transport, downgrade detection, and edge cases.
- 99% statement coverage across codebase.
For details, see SECURITY_NOTES.md and TESTING.md.
License
Metadata
Release files for pqblocks-tls-interop 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pqblocks_tls_interop-0.1.0.tar.gz | 30.1 kB | Without provenance | Details for pqblocks_tls_interop-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pqblocks_tls_interop-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pqblocks_tls_interop-0.1.0-py3-none-any.whl |
Total release size: 43.7 kB
Release files / pqblocks_tls_interop-0.1.0.tar.gz
| Download URL | pqblocks_tls_interop-0.1.0.tar.gz |
|---|---|
| Size | 30.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e1c372ac5395ee93651851750385069e0fa136104cdac9e88f7506aa6e83fe8
|
|
BLAKE2b-256 checksum How to use checksums |
216dfbae04d59a43869e86d59bd03cfbc2f4539835425c9f6f089a1fb53f535e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pqblocks_tls_interop-0.1.0-py3-none-any.whl
| Download URL | pqblocks_tls_interop-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4577d7e3be356c51981c72727df1ee7f91636c7927e9acd12bc5f0c2015298a3
|
|
BLAKE2b-256 checksum How to use checksums |
2bc9c9a3546fc0b63b9c1f0b9d0622d221e73d6407a2759a6212a45fdf1cbfb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for pqblocks-tls-interop 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.