Cryptographic verification methodology
Primary question: How are records canonicalised, domain-separated, signed with ML-DSA-65, and verified independently?
Records are serialised to deterministic UTF-8 canonical JSON (recursive lexicographic key sorting), hashed with SHA-256 inside a self-describing envelope, prefixed with the UTF-8 domain separator and a single 0x00 byte, and signed with pure NIST FIPS 204 ML-DSA-65. Independent verifiers reproduce every byte of this pipeline locally against a pinned 1,952-byte public key.
Reproducible FIPS 204 ML-DSA-65 test vectors
The following live vectors are generated by this instance's isolated demonstration key (pqc-demo-active-475799ad2dc96fec) and exposed at /api/test-vectors. Every vector can be checked offline with verify-pqc-evidence.mjs.
| Vector ID | Scenario | Expected State | Approved? |
|---|---|---|---|
vec-01-valid-mldsa65 | Valid ML-DSA-65 signed demonstration evidence | VALID | Yes (demo integrity) |
vec-02-tampered-record | Modified record against unmodified evidence package | INVALID | No |
vec-03-retired-key-unresolved | Evidence signed with retired demonstration key under active-only trust policy | UNRESOLVED | No |
1. Deterministic canonicalisation and digest calculation
Standard JSON serialisation does not guarantee consistent object key ordering across programming languages. Before hashing, the platform transforms any JSON record using recursive lexicographic key sorting: object keys are sorted by UTF-16 code unit order (standard JavaScript Array.prototype.sort), keys with undefined values are omitted, arrays preserve element order, and no insignificant whitespace is inserted.
First, record_digest_sha256 = SHA-256(UTF8(canonicalJson(record))). Second, the envelope object containing schema, domain, environment, production_attestation, issued_at, record_digest_sha256, and record is itself canonicalised and hashed: envelope_digest_sha256 = SHA-256(UTF8(canonicalJson(envelope))).
2. Domain separation and ML-DSA-65 signing input
Mirroring AffixIO's production API domain-separation model (affixio.attest.client-payload.v1), the verification laboratory never signs a bare hash digest. Instead, it constructs the exact byte buffer:
signing_input = UTF8("affixio.pqc-lab.evidence.v1") || 0x00 || raw_32_bytes(envelope_digest_sha256)
This 60-byte message is signed using pure NIST FIPS 204 ML-DSA-65 (empty FIPS 204 context string), yielding a 3,309-byte signature encoded as Base64. Evidence renewal chains use a distinct domain separator (affixio.pqc-lab.renewal.v1) so a renewal signature can never be replayed as a primary record attestation.
3. Public key encoding and cross-library interoperability
Raw ML-DSA-65 public keys are 1,952 bytes. In X.509 SubjectPublicKeyInfo (SPKI) DER format (OID 2.16.840.1.101.3.4.3.18), the raw key is preceded by the 22-byte ASN.1 header 308207b2300b0609608648016503040312038207a100, producing a 1,974-byte DER structure (also exported in PEM format inside every evidence package).
This encoding is verified interoperable across Node.js >= 24.7 native node:crypto (OpenSSL 3.5+), OpenSSL 3.5+ CLI (openssl pkeyutl -verify), and @noble/post-quantum/ml-dsa.
4. Threat model and verification decision matrix
| Adversarial or operational event | Detection step | Deterministic outcome | Approved? |
|---|---|---|---|
| Single character altered in digital record | Step 2: record_digest_sha256 mismatch | Invalid | No |
| Envelope issued_at or environment flag tampered | Step 3: envelope_digest_sha256 mismatch | Invalid | No |
| Signature bytes flipped, truncated, or substituted | Step 5: FIPS 204 ML-DSA-65 verification fails | Invalid | No |
| Attacker embeds self-generated public key with unknown key_id | Step 4: Trusted key store lookup rejects unknown key_id | Unresolved | No |
| Evidence signed by retired demonstration key under active-only policy | Step 4: Key status is retired | Unresolved | No |
| Evidence signed by retired key under explicit historical policy | Step 4 + Step 5 pass with historical notice | Valid (historical) | Policy-dependent |
| Malformed JSON, missing envelope, or unknown schema | Step 1: Structural / schema validation | Unresolved | No |
| Key directory unreachable and no pinned key available | Step 4: Key unavailable | Unresolved | No |
5. Independent offline verification instructions
Download any evidence package from the Verification Laboratory (evidence.json) and download our standalone zero-dependency verification script from /downloads/verify-pqc-evidence.mjs (or inspect its full source code directly). Run it locally on any machine with Node.js 24.7 or newer:
node verify-pqc-evidence.mjs evidence.json
To verify a separate or modified record file against the original evidence package, pass both paths:
node verify-pqc-evidence.mjs evidence.json modified-record.json
To verify with OpenSSL 3.5+ directly without Node.js, extract cryptography.public_key_spki_pem to pub.pem, decode cryptography.signing_input_hex to input.bin, decode cryptography.signature_b64 to sig.bin, and run: openssl pkeyutl -verify -pubin -inkey pub.pem -rawin -in input.bin -sigfile sig.bin
Relevant technical limitations
- Reproducible test vectors served at /api/test-vectors use this instance's isolated demonstration key pair. Because FIPS 204 defaults to hedged signing, fresh signatures generated for the same record differ byte-for-byte while remaining deterministically verifiable under the same public key.
Primary sources and technical standards
- NIST FIPS 204: Module-Lattice-Based Digital Signature Standard (ML-DSA), National Institute of Standards and Technology (NIST) ()
- AffixIO Published Service Attestation Keys, AffixIO ()
- AffixIO Node.js SDK (affixio@2.0.5, Apache-2.0), AffixIO ()
- AffixIO Security Boundaries and Disclosure Policy, AffixIO ()