arXiv:2611.08200cs.CRNov 2026

Manuscript Offprint

arXiv:2611.08200

Zirah: A Post-Quantum True Random Number Generator Hardware Signer With an Avalanche Noise

Muhammad Shaheer Bin Junaid

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Muhammad Shaheer Bin Junaid

Independent Researcher

Karachi, Pakistan

contact@mshaheerbjunaid.com

ORCID: 0009-0002-4088-6232

Abstract- Zirah is a hardware signer built around an STM32F407 microcontroller, and its purpose is to find out, on inexpensive hardware, where a post-quantum signing key is exposed and what actually protects it. The device draws every random bit from a reverse-biased 2N3904 junction in avalanche breakdown, amplified by an LM358 and screened by SP 800-90B health tests, computes ML-DSA-65 (FIPS 204, hedged) on the STM32 with two-share arithmetic masking of the secret-key multiplications, and adds ECDSA P-256 from an ATECC608 secure element over the same digest, once a person has matched an eight-digit digest prefix on its OLED with the PC and pressed a button. A desktop application and a command-line tool drive the board and verify its output, and because only a 32-byte manifest digest reaches the device, it signs files of any type and size, returning signed copies for PDF, Office Open XML, ZIP, PNG and JPEG files and detached records for every other format. NIST's SP 800-90B tool rejected the IID assumption for 1,000,000 raw samples and assessed 6.898 bits of min-entropy per byte on the non-IID track, against the 1 bit the firmware credits, while spectral lines near 116 Hz that hold about 5 % of the variance remain unexplained. At 168 MHz the masked signature took a median of 157 ms over 20 runs and a complete signing operation under 0.8 s, and the signer matched the pq-crystals reference in 1,976 checks natively and on an emulated Cortex-M4. The ATECC608 can neither store the 4,032-byte ML-DSA-65 key nor compute with it, so that key sits in ordinary flash behind readout protection, and on an earlier board, before that protection was enabled, a debugger copied it out and the copy produced a valid ML-DSA-65 signature without the device, although the leakage results come from an instruction-level emulator and nothing here is certified.

Keywords- Hardware Security; Embedded Security; Post-Quantum Cryptography; True Random Number Generation; ML-DSA; Side-Channel Masking; Secure Elements.

1. Introduction

A signature on a contract, a firmware release or a certificate is often checked years after it was made, which is why the timetable for retiring classical signatures matters to anyone who signs files today. NIST's report on the transition to post-quantum cryptography, published in final form in October 2026, deprecates ECDSA at every security strength after 2030 and disallows it after 2035, because a cryptographically relevant quantum computer would break it [1]. The post-quantum replacement, ML-DSA, was standardised in FIPS 204 in August 2024 [2], and while confidence in it builds, many systems are expected to carry a classical and a post-quantum signature side by side. The same NIST report accepts such dual signatures as long as at least one component algorithm is approved and every component signature verifies, and the IETF's composite ML-DSA specification, now waiting in the RFC Editor queue, defines one way to package them [3]. The migration therefore has a shape, and hardware that signs has to fit into it.

The inexpensive hardware that usually protects signing keys has not caught up with that shape. The ATECC608, a widely sold secure element, implements ECDSA and ECDH on P-256, SHA-256 with HMAC, and AES-128 [4]. It has no lattice arithmetic, and the largest slot in its data zone holds 416 bytes [5], roughly a tenth of the 4,032 bytes of an ML-DSA-65 secret key [2]. A device built around such a chip can keep its classical key inside the chip, but its post-quantum key has to be stored and used by an ordinary microcontroller, so the half of the signature that is meant to survive a quantum attacker ends up with the weaker protection.

Zirah is a piece of hardware built to study that constraint, and this paper reports what I built and what I measured on it. It began as a true random number generator, a reverse-biased transistor junction whose noise an STM32F407 samples, tests and conditions, and it grew into a signing device once that randomness had a demanding use: keys, masks and hedging values for ML-DSA-65 signatures that the same STM32F407 computes with masked secret-key arithmetic, joined by an ATECC608 that adds an ECDSA P-256 signature over the same digest. A desktop application and a command-line tool are the device's interface to a PC. They send it only a digest of a manifest that describes a file, so a firmware image, a spreadsheet, a photograph or a compiled program is signed by the same path as a PDF, and they check every signature it returns. A person has to compare a digest prefix on the board's OLED with the one on the PC and press a button before anything is signed, and my aim throughout was a prototype whose properties are stated exactly, including the ones that fall short of a product.

The consequence of the constraint was not hypothetical for me. On the STM32F4DISCOVERY board I used before the board measured here, with readout protection still at its factory level, a debugger copied the ML-DSA-65 key out of flash, and the copy produced a valid post-quantum signature with no device involved. The ATECC608 on the same build kept its classical key throughout. That asymmetry, a secure element sitting beside a post-quantum key it cannot protect, is the thread that runs through the rest of this paper.

The contributions are the following, listed in the order the sections address them. I describe the device itself, with its wiring, its confirmation step and its trust model, and an avalanche-noise entropy source built from discrete parts, with SP 800-90B health tests on the device, a SHAKE256 conditioner and the faults found while building it (Sections 4 and 5). I give a masked ML-DSA-65 signer for the STM32F407, derived from the pq-crystals reference code, whose secret vectors exist in RAM only as two arithmetic shares refreshed before every signature in two separate passes over coefficients visited in random order, and whose signatures stay byte-identical to the reference (Section 6). I set out what the secure element protects in such a device and what it leaves to the microcontroller's readout protection, including the key extraction on the earlier board (Section 7). I describe the host software that extends the device, with a signed manifest that binds a file's content, name, size and times, signed copies of PDF, Office Open XML, ZIP, PNG and JPEG files that open like the originals, detached records for every other format, and a verification policy that rejects a signature stripped of its ECDSA half (Section 8). Finally, I report the measurements on the finished device, among them an SP 800-90B assessment of 1,000,000 raw samples with NIST's own tool (Sections 9 and 10), and the source code, the circuit drawings and the raw measurement data behind them are released in an open archive [6].

I make no claim that Zirah resists side-channel or fault attacks, and the evidence would not support one. Only the secret-key products are masked, the leakage evaluation ran in an instruction-level emulator rather than on the chip, and the entropy results describe one board measured in one session. The device is a single prototype with no certification or independent audit, and the places where it falls short are as much a part of the result as the places where it works.

References (25)