Skip to content

About

Reproducible post-quantum cryptography tests for Zephyr, MQTT over TLS, and HTTPS.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

PQC testing

Post-quantum cryptography feasibility tests for Zephyr, firmware signatures, MQTT over TLS (MQTTS), MQTT over secure WebSockets (WSS), and HTTPS, by Dynamic Devices.

This is an experimental test project, not a production-ready security stack or a claim of PQC compliance. The harnesses test signatures, host loopback TLS and emulated verification, plus live strict-PQC HTTPS/MQTTS connections. They do not implement Zephyr TLS. See reproduction instructions for setup, test order and limitations.

Test the running HTTPS and MQTT servers

Run the explained 25-test table against an authorised lab:

python3 server_test.py --host mqtt.example.test \
  --https-port 8090 --mqtt-port 8890 --wss-port 8891 \
  --cafile /path/to/lab-ca.pem --password-file /path/to/mqtt-password.txt

For our running lab, use mqtt.dynamicdevices.co.uk as the host. Obtain its public CA and test password from the operator; keep credentials outside this repository. Python's TLS library and the OpenSSL CLI both need OpenSSL3.5+. No pip dependencies are required for this runner.

Results explain PQC negotiation, real HTTPS/MQTT delivery, classical-only rejection, trust/name validation and MQTT authentication/ACLs. Network/setup errors never count as successful rejection. See server-test instructions and result meanings, including prerequisites and exit codes.

Example live test output

The 25-check public run on 3 December 2026 passed in full, including the new direct Mosquitto WSS endpoint wss://mqtt.dynamicdevices.co.uk:8891/mqtt. TLS terminates at Mosquitto, not a proxy or HTTP-to-MQTT adapter.

Endpoint Application check Required TLS profile
HTTPS 8090 HTTP 200 and lab page TLS 1.3, X25519MLKEM768, ML-DSA-65
MQTTS 8890 MQTT 5, QoS 1 exact delivery Same
WSS 8891 /mqtt HTTP 101, mqtt subprotocol, MQTT 5 QoS 1 exact delivery Same
25 PASS | 0 FAIL | 0 ERROR

MQTT over PQC WSS :8891
  Protocol: WSS / HTTP101 / mqtt subprotocol / MQTT 5 / QoS 1 / exact payload delivered
  Transport: TLSv1.3
  Hybrid group: X25519MLKEM768
  TLS authentication: mldsa65
  Certificate algorithms: key ML-DSA-65; signature ML-DSA-65
  Trust: CA chain and hostname verified against supplied lab CA

PASS  WSS PQC TLS
PASS  WSS reject classical group
PASS  WSS reject classical signature
PASS  WSS reject TLS1.2
PASS  WSS reject wrong name
PASS  WSS reject untrusted CA
PASS  WSS MQTT publish/subscribe
PASS  WSS MQTT reject bad password
PASS  WSS MQTT reject forbidden topic

A negative PASS means the expected rejection was observed, not a connection failure. These results prove the OpenSSL/Python client path. Browser support for hybrid key exchange alone is insufficient: this lab also requires ML-DSA-65 certificate authentication and explicit trust in its CA. See native WSS setup and limitations.

Earlier HTTPS/MQTTS report

Captured on 3 December 2026 against the Dynamic Devices lab: 16 passed, 0 failed, 0 errors. Timings and certificate lifetime below are a snapshot, not current monitoring. Interactive terminals colour PASS green, FAIL red and ERROR amber; this Markdown example is plain text. Use --color always to force terminal colour or --color never to disable it.

Show the full report, including protocols and verified certificate details
PQC SERVER CHECK
────────────────────────────────────────────────────────────────────────────────────────────────────
16 PASS | 0 FAIL | 0 ERROR
  Server: mqtt.dynamicdevices.co.uk
  Client CLI: OpenSSL 3.5.5 27 Jan 2026 (Library: OpenSSL 3.5.5 27 Jan 2026)
  Python TLS: OpenSSL 3.5.5 27 Jan 2026

HTTPS :8090
────────────────────────────────────────────────────────────────────────────────────────────────────
  Protocol: HTTP/1.1 / HTTP 200
  Transport: TLSv1.3
  Hybrid group: X25519MLKEM768
  TLS authentication: mldsa65
  Cipher: TLS_AES_256_GCM_SHA384
  Certificate subject: commonName=mqtt.dynamicdevices.co.uk
  Issued by: commonName=Dynamic Devices PQC Test CA
  DNS / SAN: DNS:mqtt.dynamicdevices.co.uk
  Certificate algorithms: key ML-DSA-65; signature ML-DSA-65
  Valid from: Dec  3 14:39:22 2026 GMT
  Expires: Jan  2 14:39:22 2027 GMT (29 full days remaining)
  Leaf SHA256: 91e46ac6a90bd5886b529a1ccd58fe189861673e554b6dae5f50b5210129afc7
  Trust: CA chain and hostname verified against supplied lab CA

RESULT  TEST                                                                                    TIME
PASS    HTTPS PQC TLS                                                                         223 ms
  Observed: TLS1.3; X25519MLKEM768; mldsa65; TLS_AES_256_GCM_SHA384
  Means: Verified hybrid key exchange AND ML-DSA-65 server authentication.

PASS    HTTPS reject classical group                                                          102 ms
  Observed: Expected rejection — Server sent fatal TLS rejection alert
  Means: X25519-only key exchange must fail: no classical-only fallback.

PASS    HTTPS reject classical signature                                                      103 ms
  Observed: Expected rejection — Server sent fatal TLS rejection alert
  Means: RSA-only authentication must fail: ML-DSA-65 capability is required.

PASS    HTTPS reject TLS1.2                                                                   111 ms
  Observed: Expected rejection — Server sent fatal TLS rejection alert
  Means: Older TLS protocol must fail: this listener requires TLS1.3.

PASS    HTTPS reject wrong name                                                               101 ms
  Observed: Expected rejection — Certificate verification rejected (code 62)
  Means: Client must reject a certificate for another DNS name.

PASS    HTTPS reject untrusted CA                                                             106 ms
  Observed: Expected rejection — Certificate verification rejected (code 19)
  Means: Client with an empty trust store must reject the lab chain.

PASS    HTTPS page                                                                            255 ms
  Observed: HTTP 200; page matched; group 0x11ec; leaf SHA256 91e46ac6a90bd588…; expires Jan  2
    14:39:22 2027 GMT
  Means: A verified Python TLS connection transfers the expected lab page.


MQTTS / MQTT :8890
────────────────────────────────────────────────────────────────────────────────────────────────────
  Protocol: MQTT 5 / QoS 1 / exact payload delivered
  Transport: TLSv1.3
  Hybrid group: X25519MLKEM768
  TLS authentication: mldsa65
  Cipher: TLS_AES_256_GCM_SHA384
  Certificate: Same verified leaf as HTTPS :8090

RESULT  TEST                                                                                    TIME
PASS    MQTTS PQC TLS                                                                         202 ms
  Observed: TLS1.3; X25519MLKEM768; mldsa65; TLS_AES_256_GCM_SHA384
  Means: Verified hybrid key exchange AND ML-DSA-65 server authentication.

PASS    MQTTS reject classical group                                                          101 ms
  Observed: Expected rejection — Server sent fatal TLS rejection alert
  Means: X25519-only key exchange must fail: no classical-only fallback.

PASS    MQTTS reject classical signature                                                       91 ms
  Observed: Expected rejection — Server sent fatal TLS rejection alert
  Means: RSA-only authentication must fail: ML-DSA-65 capability is required.

PASS    MQTTS reject TLS1.2                                                                   108 ms
  Observed: Expected rejection — Server sent fatal TLS rejection alert
  Means: Older TLS protocol must fail: this listener requires TLS1.3.

PASS    MQTTS reject wrong name                                                               116 ms
  Observed: Expected rejection — Certificate verification rejected (code 62)
  Means: Client must reject a certificate for another DNS name.

PASS    MQTTS reject untrusted CA                                                             106 ms
  Observed: Expected rejection — Certificate verification rejected (code 19)
  Means: Client with an empty trust store must reject the lab chain.

PASS    MQTT publish/subscribe                                                                604 ms
  Observed: MQTT5; QoS1; 58 bytes delivered exactly; group 0x11ec
  Means: Real authenticated delivery, not merely a successful TLS handshake.

PASS    MQTT reject bad password                                                              227 ms
  Observed: Expected rejection — CONNACK 0x87: bad credentials/not authorised
  Means: TLS encryption does not replace MQTT authentication.

PASS    MQTT reject forbidden topic                                                           357 ms
  Observed: Expected rejection — PUBACK 0x87: Not authorised
  Means: Test user may publish to lab/#, not arbitrary broker topics.


HOW TO READ THIS
────────────────────────────────────────────────────────────────────────────────────────────────────

PASS on a rejection test means the unwanted connection was refused for the expected reason.
FAIL means the expected behaviour was not observed.
ERROR means no security conclusion: fix client setup/network and rerun.
These tests are not a compliance certificate.

What has been tested

The following results come from the original local experiments. Ported-source validation is recorded separately; do not assume the whole matrix has been rerun.

Area Observed result Remaining work
Firmware signatures ML-DSA-44 cross-build for nRF52840; bidirectional signature interoperability with OpenSSL; ARM emulation accepts valid firmware and rejects eight invalid cases Physical-device measurements and boot/update integration
HTTPS Loopback and deployed TLS1.3 with X25519MLKEM768; real verified HTTPS transfer and negative controls Zephyr networking client
Certificates Host TLS with ML-DSA-65 CA and server certificates; strict hybrid key exchange; classical-only key exchange and signature capabilities rejected Embedded TLS compatibility and deployment
MQTTS Deployed Mosquitto: verified PQC TLS, authenticated MQTT5 QoS1 publish/subscribe; bad password, forbidden topic and classical-only clients rejected Zephyr networking client
Zephyr native simulator Zephyr4.4.2 application with host OpenSSL3.5.5: 10 live HTTPS/MQTT and rejection checks pass Embedded TLS provider and physical-board measurements; host TLS is not an MCU result

Hybrid key exchange is not the same as a post-quantum certificate signature. The initial HTTPS tests used classical ECDSA certificates. The separate certificate experiment used ML-DSA-65 signatures. Neither result proves that Zephyr's TLS stack supports those combinations.

Strict test server

A separate lightweight container hosts Mosquitto and a static HTTPS server. The tested public ports are 8890 for MQTTS and 8090 for HTTPS. The Python runner checks an existing deployment; it does not provision servers.

The strict test profile is TLS 1.3, X25519MLKEM768 key exchange and ML-DSA-65 server authentication, without classical-only fallback. A passing test must observe the negotiated group and signature, perform a real MQTT exchange or HTTPS transfer, and prove that classical-only clients fail.

Use a private laboratory CA and hostname-specific server certificate, with SAN, serverAuth EKU, digitalSignature key usage and CA:false for the leaf. The public examples will use mqtt.example.test. Keep all private keys and credentials outside the repository. Lab certificates are not publicly trusted browser certificates or a production PKI recommendation.

The deployed web server is Nginx. The dated package versions, verified service sandbox, runtime-directory fix and restart checks are captured in server hardening, without private infrastructure identifiers, credentials or deployment logs.

Run the Zephyr simulator

See the simulator setup guide for a fresh Linux installation, build commands, server credentials, expected output and ESP32 / ESP8266 limitations.

python simulator_test.py \
  --host mqtt.example.test \
  --cafile /path/outside/repository/lab-ca.pem \
  --password-file /path/outside/repository/mqtt-password.txt

On 3 December 2026, the pinned Zephyr 4.4.2 native_sim/native/64 application passed 10/10 live HTTPS/MQTTS checks against the deployed lab. Its TLS backend is host OpenSSL 3.5.5, not Zephyr Mbed TLS. Zephyr application code performs the HTTP/MQTT exchanges; this does not prove embedded PQC TLS or an ESP32 hardware port. The existing Python server runner has 16 checks; the simulator's smaller ten-check matrix is documented separately.

Remaining work

Complete ported-source publication, then integrate and measure a Zephyr embedded-TLS networking client. The host-offloaded simulator above is available now; on-device PQC TLS, ESP32 memory/timing measurements and a suitable embedded TLS provider remain unfinished. Do not copy private infrastructure records or raw local logs into the public package.

The local experiments used OpenSSL 3.5.5, Zephyr 4.4.2 at commit dccb09599635bdff17633fa7e9dab014b91dce90, and the Dilithium reference implementation at commit d35ba3fe5449bee3e6d43e1f296c3ca818bd36be. These are experiment identities, not a blanket recommendation to deploy those versions without checking current support and advisories.

Licence

Our original code and documentation are licensed under the MIT licence. Third-party components retain their own licences; see THIRD_PARTY.md.

Assisted-by: Briar

About

Reproducible post-quantum cryptography tests for Zephyr, MQTT over TLS, and HTTPS.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages